Unable to know the reason for the response "This tracking number cannot be found. Please check the number or contact the sender" - response

I am getting a response "This tracking number cannot be found. Please check the number or contact the sender.", which is present in this object.
when I execute a php code to get tracking-id(781193603730) status data got from Fedex. But when I try to check the status of tracking id by loging into their portal I am able to get response. I need help on this, please help. Response object =>
stdClass Object
(
[HighestSeverity] => SUCCESS
[Notifications] => stdClass Object
(
[Severity] => SUCCESS
[Source] => trck
[Code] => 0
[Message] => Request was successfully processed.
[LocalizedMessage] => Request was successfully processed.
)
[TransactionDetail] => stdClass Object
(
[CustomerTransactionId] => *** Track Request using PHP ***
)
[Version] => stdClass Object
(
[ServiceId] => trck
[Major] => 16
[Intermediate] => 0
[Minor] => 0
)
[CompletedTrackDetails] => stdClass Object
(
[HighestSeverity] => SUCCESS
[Notifications] => stdClass Object
(
[Severity] => SUCCESS
[Source] => trck
[Code] => 0
[Message] => Request was successfully processed.
[LocalizedMessage] => Request was successfully processed.
)
[DuplicateWaybill] =>
[MoreData] =>
[TrackDetailsCount] => 0
[TrackDetails] => stdClass Object
(
[Notification] => stdClass Object
(
[Severity] => ERROR
[Source] => trck
[Code] => 9040
[Message] => This tracking number cannot be found. Please check the number or contact the sender.
[LocalizedMessage] => This tracking number cannot be found. Please check the number or contact the sender.
)
[TrackingNumber] => 781193603730
[StatusDetail] => stdClass Object
(
[Location] => stdClass Object
(
[Residential] =>
)
)
[PackageSequenceNumber] => 0
[PackageCount] => 0
[DeliveryAttempts] => 0
[TotalUniqueAddressCountInConsolidation] => 0
[DeliveryOptionEligibilityDetails] => Array
(
[0] => stdClass Object
(
[Option] => INDIRECT_SIGNATURE_RELEASE
[Eligibility] => INELIGIBLE
)
[1] => stdClass Object
(
[Option] => REDIRECT_TO_HOLD_AT_LOCATION
[Eligibility] => INELIGIBLE
)
[2] => stdClass Object
(
[Option] => REROUTE
[Eligibility] => INELIGIBLE
)
[3] => stdClass Object
(
[Option] => RESCHEDULE
[Eligibility] => INELIGIBLE
)
)
)
)
)

I found that the fedex tracking id that I was testing was real, and the credentials that I was using for fedex tracking api were of test/sandbox type not production.

Related

Validate Twilio Notify deliveryCallbackUrl - What is the desired format for a nested request?

I'm working on a project that uses Twilio Notify for mass text notifications. I would like to track the status of individual messages, so I added a deliveryCallbackUrl to the notification resource.
$notification = $service->notifications->create([
"toBinding" => $binding,
"body" => $message_text,
"deliveryCallbackUrl" => "https://username:password#mysite/notification_delivery_callback.php"
]);
I can successfully receive the callback payload, but when I attempt to validate the request, it fails.
use Twilio\Rest\Client;
use Twilio\Security\RequestValidator;
$configs = get_configs();
$signature = $_SERVER["HTTP_X_TWILIO_SIGNATURE"];
$request_url = $_SERVER['SCRIPT_URI'];
$validator = new RequestValidator($configs['twilio_auth_token']);
$request = $_REQUEST;
// $is_valid always returns false
$is_valid = $validator->validate($signature, $request_url, $request);
The payload is nested and includes json.
Array(
[NotificationSid] => NTxxxxxxxxx
[ServiceSid] => ISxxxxxxxxx
[Count] => 4
[IsFinal] => true
[DeliveryState] => Array(
[3] => {"status":"SENT","type":"sms","identity":"xxxxxxxxx","sid":"SMxxxxxxxxx"}
[2] => {"status":"SENT","type":"sms","identity":"xxxxxxxxx","sid":"SMxxxxxxxxx"}
[1] => {"status":"SENT","type":"sms","identity":"xxxxxxxxx","sid":"SMxxxxxxxxx"}
[0] => {"status":"SENT","type":"sms","identity":"xxxxxxxxx","sid":"SMxxxxxxxxx"}
)
[AccountSid] => ACxxxxxxxxx
[SequenceId] => 0
)
It seems the DeliveryState array is the issue, as I am able to successfully validate non-nested requests for other webhooks. I've crawled through Twilio help docs, but so far, haven't found anything about how to validate nested requests. I've attempted to flatten the array and escape the json (one or the other, both at the same time), but no luck.
Array(
...
[DeliveryState] => Array(
[0] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
[1] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
[2] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
[3] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
)
...
)
Array(
...
[0] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
[1] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
[2] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
[3] => "{\"status\":\"SENT\",\"type\":\"sms\",\"identity\":\"xxxxxxxxx\",\"sid\":\"SMxxxxxxxxx\"}"
...
)
Does anyone know what the desired format is to validate this properly?
Worked with Twilio Support to solve the issue.
There was a bug in the sdk: The PHP library didn't support multi-dimensional arrays in the RequestValidator (twilio/sdk has been fixed and updated to 6.42.1)
Format: The validator is looking for a specific format -- need to unnest the DeliveryState array and reformat the keys (order is also important)
Example format that passes validation
(
[NotificationSid] => NTxxx
[ServiceSid] => ISxxx
[Count] => 5
[IsFinal] => true
[DeliveryState[0]] => {"status":"SENT","type":"sms","identity":"xxxxxxxxxx","sid":"SMxxx"}
[DeliveryState[1]] => {"status":"SENT","type":"sms","identity":"xxxxxxxxxx","sid":"SMxxx"}
[DeliveryState[2]] => {"status":"SENT","type":"sms","identity":"xxxxxxxxxx","sid":"SMxxx"}
[DeliveryState[3]] => {"status":"SENT","type":"sms","identity":"xxxxxxxxxx","sid":"SMxxx"}
[DeliveryState[4]] => {"status":"SENT","type":"sms","identity":"xxxxxxxxxx","sid":"SMxxx"}
[AccountSid] => ACxxx
[SequenceId] => 0
)

original_transaction_id is not coming while validating Apple receipt after Successful IAP

I have Auto-renewable IAP plan in my App, which user has to purchase to listen full song. The issue has occurred moments after the user has made the in-app purchase and the app has been notified as to the successful transaction, then the appStoreReceipt in the app is validated.
I have base64 encoded string(that I can share in personal) and I am adding response after I verified the receipt, Also I have included master shared secret and app specific shared secret.
I also raised a bug on Apple feedback assistance, but they are not replying me since last week.
I hope anyone can help me out with this.
This is the response after validation of receipt:
<pre>ReceiptValidator\iTunes\ProductionResponse Object
(
[result_code:protected] => 0
[bundle_id:protected] => com.allaccess
[app_item_id:protected] => 1479910471
[original_purchase_date:protected] => Carbon\Carbon Object
(
[date] => 2020-06-04 17:28:14.000000
[timezone_type] => 1
[timezone] => +00:00
)
[request_date:protected] => Carbon\Carbon Object
(
[date] => 2020-08-25 15:40:51.000000
[timezone_type] => 1
[timezone] => +00:00
)
[receipt_creation_date:protected] => Carbon\Carbon Object
(
[date] => 2020-06-04 17:28:14.000000
[timezone_type] => 1
[timezone] => +00:00
)
[receipt:protected] => Array
(
[receipt_type] => Production
[adam_id] => 1479910471
[app_item_id] => 1479910471
[bundle_id] => com.allaccess
[application_version] => 1.0.1
[download_id] => 28071597429667
[version_external_identifier] => 836208084
[receipt_creation_date] => 2020-06-04 17:28:14 Etc/GMT
[receipt_creation_date_ms] => 1591291694000
[receipt_creation_date_pst] => 2020-06-04 10:28:14 America/Los_Angeles
[request_date] => 2020-08-25 15:40:50 Etc/GMT
[request_date_ms] => 1598370050555
[request_date_pst] => 2020-08-25 08:40:50 America/Los_Angeles
[original_purchase_date] => 2020-06-04 17:28:14 Etc/GMT
[original_purchase_date_ms] => 1591291694000
[original_purchase_date_pst] => 2020-06-04 10:28:14 America/Los_Angeles
[original_application_version] => 1.0.1
[in_app] => Array
(
)
)
[latest_receipt:protected] =>
[latest_receipt_info:protected] => Array
(
)
[purchases:protected] => Array
(
)
[pending_renewal_info:protected] => Array
(
)
[raw_data:protected] => Array
(
[receipt] => Array
(
[receipt_type] => Production
[adam_id] => 1479910471
[app_item_id] => 1479910471
[bundle_id] => com.allaccess
[application_version] => 1.0.1
[download_id] => 28071597429667
[version_external_identifier] => 836208084
[receipt_creation_date] => 2020-06-04 17:28:14 Etc/GMT
[receipt_creation_date_ms] => 1591291694000
[receipt_creation_date_pst] => 2020-06-04 10:28:14 America/Los_Angeles
[request_date] => 2020-08-25 15:40:50 Etc/GMT
[request_date_ms] => 1598370050555
[request_date_pst] => 2020-08-25 08:40:50 America/Los_Angeles
[original_purchase_date] => 2020-06-04 17:28:14 Etc/GMT
[original_purchase_date_ms] => 1591291694000
[original_purchase_date_pst] => 2020-06-04 10:28:14 America/Los_Angeles
[original_application_version] => 1.0.1
[in_app] => Array
(
)
)
[status] => 0
[environment] => Production
)
[is_retryable:protected] =>
)
Here, there is no original_transaction_id. I am facing this issue since last month.
Thank you

Twilio Browser Call Sends Wrong Call Sid in POST

I have setup browser calls and in my TwiML App , setup the Status CallBack url . Twilio posts the status in the format
array (
'ApiVersion' => '2010-04-01',
'Called' => NULL,
'CallStatus' => 'completed',
'Duration' => '1',
'From' => 'client:browser',
'CallDuration' => '13',
'Direction' => 'inbound',
'Timestamp' => 'Mon, 16 Apr 2018 19:35:26 +0000',
'AccountSid' => 'asdasdasdadasdasdasdasdasdasdas',
'CallbackSource' => 'call-progress-events',
'ApplicationSid' => 'rwerwerwerwewewewewwrwe',
'Caller' => 'client:browser',
'SequenceNumber' => '0',
'To' => NULL,
'CallSid' => 'CA9c6408108969fsf6f1c53396003d931',
)
I am trying to get the call to ,from and other details. I did was
$callsid = $_POST['CallSid'];
$call = $client->calls($callsid)->fetch();
But it failed everytime. When I checked my dashboard for the CallSod , it is different from what they sent in the webhook.
Is there something I am missing ?
Resolved it. I need to get the Child Call SID to get that information .
$call = $client->calls->read(
array("ParentCallSid" => $callsid )
);

Return upcoming YouTube API V3 video schedule date?

I'm looking to return the schedule date for a stream in YouTube.
Example of scheduled streams:
YT Link: https://www.youtube.com/channel/UCP7jMXSY2xbc3KCAE0MHQ-A
This is my code to pull this data out using the YouTube v3 API:
$videos = $this->yt->searchAdvanced(array(
'q' => '',
'part' => 'snippet',
'channelId' => $this->channel_id,
'eventType' => $event_type, // Upcoming
'type' => 'video',
'order' => 'date',
'maxResults' => $max,
'key' => YOUTUBE_API_KEY
));
Here is the object that is returned from this:
If I use my function to get video info this is all the information I can get. This is using parts:
id, snippet, contentDetails, player, statistics, status
: Where is the scheduled date? :
stdClass Object
(
[kind] => youtube#video
[etag] => "q5k97EMVGxODeKcDgp8gnMu79wM/KAZsrzeX5ImiUQpLbwhPR7lo9mA"
[id] => qUAmTYHEyM8
[snippet] => stdClass Object
(
[publishedAt] => 2016-03-03T06:48:50.000Z
[channelId] => UCP7jMXSY2xbc3KCAE0MHQ-A
[title] => Match 3 - Google DeepMind Challenge Match: Lee Sedol vs AlphaGo
[description] => Watch DeepMind's program AlphaGo take on the legendary Lee Sedol (9-dan pro), the top Go player of the past decade, in a $1M 5-game challenge match in Seoul. This is the livestream for Match 3 to be played on: 12th March 13:00 KST (local), 04:00 GMT; note for US viewers this is the day before on: 11th March 20:00 PT, 23:00 ET.
In October 2015, AlphaGo became the first computer program ever to beat a professional Go player by winning 5-0 against the reigning 3-times European Champion Fan Hui (2-dan pro). That work was featured in a front cover article in the science journal Nature in January 2016.
Match commentary by Michael Redmond (9-dan pro) and Chris Garlock.
[thumbnails] => stdClass Object
(
[default] => stdClass Object
(
[url] => https://i.ytimg.com/vi/qUAmTYHEyM8/default_live.jpg
[width] => 120
[height] => 90
)
[medium] => stdClass Object
(
[url] => https://i.ytimg.com/vi/qUAmTYHEyM8/mqdefault_live.jpg
[width] => 320
[height] => 180
)
[high] => stdClass Object
(
[url] => https://i.ytimg.com/vi/qUAmTYHEyM8/hqdefault_live.jpg
[width] => 480
[height] => 360
)
[standard] => stdClass Object
(
[url] => https://i.ytimg.com/vi/qUAmTYHEyM8/sddefault_live.jpg
[width] => 640
[height] => 480
)
[maxres] => stdClass Object
(
[url] => https://i.ytimg.com/vi/qUAmTYHEyM8/maxresdefault_live.jpg
[width] => 1280
[height] => 720
)
)
[channelTitle] => DeepMind
[categoryId] => 28
[liveBroadcastContent] => upcoming
[localized] => stdClass Object
(
[title] => Match 3 - Google DeepMind Challenge Match: Lee Sedol vs AlphaGo
[description] => Watch DeepMind's program AlphaGo take on the legendary Lee Sedol (9-dan pro), the top Go player of the past decade, in a $1M 5-game challenge match in Seoul. This is the livestream for Match 3 to be played on: 12th March 13:00 KST (local), 04:00 GMT; note for US viewers this is the day before on: 11th March 20:00 PT, 23:00 ET.
In October 2015, AlphaGo became the first computer program ever to beat a professional Go player by winning 5-0 against the reigning 3-times European Champion Fan Hui (2-dan pro). That work was featured in a front cover article in the science journal Nature in January 2016.
Match commentary by Michael Redmond (9-dan pro) and Chris Garlock.
)
)
[contentDetails] => stdClass Object
(
[duration] => PT0S
[dimension] => 2d
[definition] => sd
[caption] => false
[licensedContent] => 1
)
[status] => stdClass Object
(
[uploadStatus] => uploaded
[privacyStatus] => public
[license] => youtube
[embeddable] => 1
[publicStatsViewable] => 1
)
[statistics] => stdClass Object
(
[viewCount] => 41
[likeCount] => 1
[dislikeCount] => 0
[favoriteCount] => 0
[commentCount] => 0
)
[player] => stdClass Object
(
[embedHtml] =>
)
)
Note that the published date I highlighted is NOT the schedule date.
As you can see there is no scheduled date. Do I need to pass more data to 'part'? Their API suggests there's no more data that can be pulled back too.
https://developers.google.com/youtube/v3/docs/search/list#request
Thanks
Okay I worked it out.
Simply add liveStreamingDetails to the part parameter.
I was trying to achieve this through search.list. Instead use the videos.list with liveStreamingDetails to get the schedule date as search.list doesn't support liveStreamingDetails.
Cheers
The YouTube Live Streaming API's list documentation has a relevant example:
list (by broadcast status) ...retrieve information about all, active, completed, or upcoming live broadcasts. Note that the broadcastStatus parameter is also set to all to ensure that all matching broadcasts are included in the response.
GET https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet%2CcontentDetails%2Cstatus&broadcastStatus=active&broadcastType=all&key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
The start time can be found in the part=liveStreamingDetails, which will contain scheduledStartTime in ISO format, and activeLiveChatId.

FedEx 556 - No valid services available. when there should be

Hi I'm trying to use the wsdl api to get shipping cost calculated for my website.
I'm using opencart and this module (http://www.opencart.com/index.php?route=extension/extension/info&extension_id=2055&filter_search=fedex&sort=e.date_modified&order=DESC).
On checkout I'm getting this error:
WARNING::556::There are no valid services available.
But I tried the same from and to address on the calculator on the fedex website and it gives me two services: International Priority and International Economy
This is the debug data I have:
Array
(
[WebAuthenticationDetail] => Array
(
[UserCredential] => Array
(
[Key] => REDACTED
[Password] => REDACTED
)
)
[ClientDetail] => Array
(
[AccountNumber] => REDACTED
[MeterNumber] => REDACTED
)
[TransactionDetail] => Array
(
[CustomerTransactionId] => *** Rate Request v9 using PHP ***
)
[Version] => Array
(
[ServiceId] => crs
[Major] => 9
[Intermediate] => 0
[Minor] => 0
)
[ReturnTransitAndCommit] => 1
[RequestedShipment] => Array
(
[DropoffType] => REQUEST_COURIER
[ShipTimestamp] => 2011-09-28T09:02:01+00:00
[PackagingType] => YOUR_PACKAGING
[TotalInsuredValue] => Array
(
[Amount] => 2000
[Currency] => EUR
)
[Shipper] => Array
(
[Address] => Array
(
[StreetLines] => Array
(
[0] =>
[1] =>
)
[City] => Ronchis
[StateOrProvinceCode] =>
[PostalCode] => 33050
[CountryCode] => IT
[Residential] => 1
)
)
[Recipient] => Array
(
[Address] => Array
(
[StreetLines] => Array
(
[0] =>
[1] =>
)
[City] => villach
[StateOrProvinceCode] =>
[PostalCode] => 9500
[CountryCode] => AT
[Residential] => 1
)
)
[ShippingChargesPayment] => Array
(
[PaymentType] => SENDER
[Payor] => Array
(
[AccountNumber] => 263150082
[CountryCode] => IT
)
)
[RateRequestTypes] => LIST
[PackageCount] => 1
[PackageDetailSpecified] => 1
[PackageDetail] => INDIVIDUAL_PACKAGES
[RequestedPackageLineItems] => Array
(
[0] => Array
(
[Weight] => Array
(
[Value] => 34
[Units] => KG
)
[Dimensions] => Array
(
[Length] => 48
[Width] => 53
[Height] => 122
[Units] => CM
)
)
)
)
)
----------
-- NUSOAP -- Array
(
[HighestSeverity] => WARNING
[Notifications] => Array
(
[Severity] => WARNING
[Source] => crs
[Code] => 556
[Message] => There are no valid services available.
[LocalizedMessage] => There are no valid services available.
)
[TransactionDetail] => Array
(
[CustomerTransactionId] => *** Rate Request v9 using PHP ***
)
[Version] => Array
(
[ServiceId] => crs
[Major] => 9
[Intermediate] => 0
[Minor] => 0
)
)
What should I do?
I just ran into this error, and it turned out that the issue was an invalid postal code. Double check that you are specifying the "Shipper" information correctly.
Also, if that doesn't work give the FedEx customer support phone number a try. We would not have figured this issue out without their help.
I was also having this issue .. but with Joomla, Virtuemart. Because the FedEx server is the same so may be my solution could help somebody else too..
Here are the main things what I fixed to fix this issue.
Product's Weight should be less than the limit if you've set any as Maximum Weight.
If you are using any packaging has more weight than FedEx's provided box i.e. 25KG BOX or 10KG box, then always use "Your Own packaging"
it's true, do keep an eye on ZIP===States (i was testing and put wrong state with different zip) And this ZIP should be added in "Shop's Address" because this is considered as FROM and the destination address as well.
Do note if products have added weights. LWH (Length, Width, Height).
Mine issue resolved after weeks of trouble! I wish somebody else could also resolve this issue if facing.
I was facing following error
"10 kg packaging box is **only** Available at FedEx World Service CenterĀ® locations!"
which was a big help to resolve the limitation i've set.
This issue happen when one of the bellow cases.
Country given is not associated with FedEx account.
Origin address is not real, Especially the post code.
The given packagingType is available in your country.
You need to provide a ServiceType. One of these:
EUROPE_FIRST_INTERNATIONAL_PRIORITY
FEDEX_1_DAY_FREIGHT
FEDEX_2_DAY
FEDEX_2_DAY_AM
FEDEX_2_DAY_FREIGHT
FEDEX_3_DAY_FREIGHT
FEDEX_EXPRESS_SAVER
FEDEX_FIRST_FREIGHT
FEDEX_FREIGHT_ECONOMY
FEDEX_FREIGHT_PRIORITY
FEDEX_GROUND
FIRST_OVERNIGHT
GROUND_HOME_DELIVERY
INTERNATIONAL_ECONOMY
INTERNATIONAL_ECONOMY_FREIGHT
INTERNATIONAL_FIRST
INTERNATIONAL_PRIORITY
INTERNATIONAL_PRIORITY_FREIGHT
PRIORITY_OVERNIGHT
SMART_POST
STANDARD_OVERNIGHT
Use it in the same level as the DropoffType
Make sure that you have the Zip Code set to required.
You can do that in System -> Localization -> Countries.
It is not required by default in opencart, and the fedex shipping system will not work without it.
This issue can also be caused by requesting insurance in a country that doesn't support it, such as Canada.
I also ran into this problem and the solution was trimming extra spaces from the end of the address, city & postal code. After that, all was well again.
I don't know why FedEx's API all of a sudden stopped accepting the extra spaces, but who knows...
In my case, this was caused by trying to ship internationally from the US to Italy, and having specified a SignatureOptionDetail of NO_SIGNATURE_REQUIRED. Changing this to SERVICE_DEFAULT fixed it.

Resources