0

I posted a question previously about integrating FedEx shipping with a shopping cart, and it was suggested that I try Shippo.

I use the following code to get the rates:

$rates = Shippo_Shipment::get_shipping_rates(array('id'=>     $shipment["object_id"]));
$json = json_decode($rates, true);
//var_dump($json);
foreach ($json["results"] as $key)
{
    echo $key["amount"] . " - " . $key["servicelevel_name"] ."<br>";
}

This returns the rates fine, but the problem is that when I refresh the page to reload the rates, it doesn't return the same results.

The rates will stay the same, but sometimes it returns only 3 results, and sometimes it returns up to 7 different results.

I need to make sure it is consistently returning the same results. The following shows what will be returned after refreshing:

10.32 - Ground<br>
20.13 - 2 Day A.M.<br>
57.04 - Express Saver<br>
54.75 - First Overnight<br>
26.64 - Standard Overnight<br>

17.86 - 2 Day<br>
10.32 - Ground<br>
54.75 - First Overnight<br>
28.62 - Priority Overnight<br>
26.64 - Standard Overnight<br>

54.75 - First Overnight<br>
28.62 - Priority Overnight<br>
20.13 - 2 Day A.M.<br>
17.86 - 2 Day<br>
16.94 - Express Saver<br>
10.32 - Ground<br>

54.75 - First Overnight<br>
28.72 - Priority Overnight<br>
10.32 - Ground<br>
Marcos Dimitrio
  • 6,651
  • 5
  • 38
  • 62
Darth Mikey D
  • 107
  • 2
  • 14

1 Answers1

3

I work for Shippo and your post was forwarded to me by my colleague.

The FedEx test server is not reliable, so rates returned will vary. Please try using your FedEx production credentials.

We've also contacted you via email. It's faster for us to communicate via our support channel. If you have any questions or comments, please feel free to reach out to us.

Thank you!

Yazan
  • 39
  • 1
  • Thanks for the response. Sorry I didn't get right back to you. That was the issue. Switched to production and the results were consistent. Thanks again. – Darth Mikey D May 24 '15 at 15:07
  • 1
    Email support is great, but it's also good to have a knowledge base built up for other users with similar questions. – toddg Oct 13 '15 at 23:23