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.
Related
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
)
I'm trying to replace a part of my url before before delivering the file.
I call
localhost:8080/files/page_home.d41d8.js
and would like to modify the call to
/files/page_home.js
After that the file shall be delivered directly by lighttpd and not be forwareded to the fastcgi backend.
I tried the following:
server.modules += ( "mod_fastcgi", "mod_rewrite" )
url.rewrite = ("^/files/(([a-zA-Z0-9_]+))\.(([a-zA-Z0-9]))\.js$" => "/files/$1.js")
$HTTP["url"] !~ "^/files/" {
fastcgi.server = (
"/" => ((
"bin-path" => "/srv/www/cppapp/dist/Debug/GNU-Linux/cppapp.exe",
"bin-environment" => (
"LD_LIBRARY_PATH" => ""
),
"socket" => "/tmp/cppapp-fastcgi-socket",
# # only 1 process !
"max-procs" => 1,
"check-local" => "disable",
# "broken-scriptfilename" => "enable"
"fix-root-scriptname" => "enable",
))
)
}
When I'm looking into the log, the part ".d41d8." is not replaced.
Does anyone of you have a tip for replacing that part?
Thank you very much,
Alex
If someone is searching for answer in future: The problem was the regular expression "^/files/(([a-zA-Z0-9_]+)).(([a-zA-Z0-9])).js$". The second part was only matching one char / number. The correct version is "^/files/(([a-zA-Z0-9_]+)).(([a-zA-Z0-9]+)).js$"
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.
I have a problem uploading a video on my youtube account using the google api php client 0.6.4
The upload seems ok but the video status is stuck on "processing"
Array
(
[status] => Array
(
[uploadStatus] => uploaded
[privacyStatus] => public
[license] => youtube
[embeddable] => 1
[publicStatsViewable] => 1
)
[processingDetails] => Array
(
[processingStatus] => processing
[fileDetailsAvailability] => inProgress
[processingIssuesAvailability] => inProgress
[tagSuggestionsAvailability] => inProgress
[editorSuggestionsAvailability] => inProgress
[thumbnailsAvailability] => inProgress
)
)
Has someone an advice on this ?
Thanks !
** UPDATE **
The processingDetails has change lately, but the status is still stuck on "processing"
Array
(
[status] => Array
(
[uploadStatus] => uploaded
[privacyStatus] => public
[license] => youtube
[embeddable] => 1
[publicStatsViewable] => 1
)
[fileDetails] => Array
(
[fileType] => video
[container] => mov
)
[processingDetails] => Array
(
[processingStatus] => processing
[fileDetailsAvailability] => available
[processingIssuesAvailability] => available
[tagSuggestionsAvailability] => inProgress
[editorSuggestionsAvailability] => inProgress
[thumbnailsAvailability] => inProgress
)
[suggestions] => Array
(
[processingHints] => Array
(
[0] => nonStreamableMov
)
)
)
If the API upload succeeded then things sound like they're working as intended from the API perspective. What I'd recommend doing is trying to upload the same raw video file via the browser at http://www.youtube.com/upload and see if that video is successfully processed or also gets stuck.
If it also gets stuck, then the problem is your video.
If it gets processed, then there might have been some one-off problem that affected your upload via the API, and I'd suggest retrying. If the problem is consistent with API uploads (and try with different files, too) then it sounds like a bug with the client library.
Dear Google Engineers,
I keep trying to insert a customer and receive the following response:
[error] => Array
(
[errors] => Array
(
[0] => Array
(
[domain] => global
[reason] => duplicate
[message] => Resource already exists
)
)
[code] => 409
[message] => Resource already exists
)
I then go about attempting to retrieve the customer resource that supposedly exists via a GET request to https://www.googleapis.com/apps/reseller/v1/customers/{customerId} which fails to find the resource:
[error] => Array
(
[errors] => Array
(
[0] => Array
(
[domain] => global
[reason] => notFound
[message] => Not Found
)
)
[code] => 404
[message] => Not Found
)
Either I've uncovered a bug or the error response from POST https://www.googleapis.com/apps/reseller/v1/customers/ isn't nearly detailed enough for me to diagnose.
I've tried variations of the required fields with random values (addressLine1, alternateEmail, phoneNumber). I've also logged in to the Reseller CPanel and no matching customer exists for the domain.
If Google engineers care to try and diagnose internally, the customerId in question is ruby-stagingpop.co. You can email me to find out my Reseller account if necessary. Info in my profile.