Shipping Problem with Amazon Payments

I have a strange problem with Amazon Payments that was brought to my attention by a customer. Wondering if any one else has experienced the same problem.

I have two table driven shipping methods: Standard for packages 13 ounces or less and Priority, for all package weights. I only use Priority for packages over 13 ounces.



I had a customer choose priority for their order, which was under 13 ounces. They had a choice of standard or Priority. When they received the CS-CART invoice, it listed Standard ($3.00) instead of Priority and I confirmed this. They sent me their Amazon receipt and it has Priority ($4.95) for the shipping method and the total was correct for the shipping method that they chose. The CS-Cart total was $1.95 less. If the customer did not call me, I would have sent it using the incorrect shipping method, standard.



So far, what I found out looking at previous orders is that if the weight of the package is over 13 ounces so that the customer only has one choice, then the shipping is just priority and there is no discrepancy between Amazon and CS-Cart invoice. If the person is offered a choice of Priority and Standard and choose standard, again no discrepancy. However, if the customer has a choice of Priority or Standard, and chooses Priority, I get the situation described above.



What I see on the main order page of Amazon Central, where all orders are listed, in the shipping column is ONLY Standard listed.

When I look at specific order details I find the following: In the situation noted above, the shipping method is: Standard(Priority)-where the customer had a choice, if the customer only had a choice of Priority in the cart, then the amazon order has: Priority, if the customer had a choice of Standard or Priority and chose standard, then Amazon lists Standard as the method. There is no method called Standard (Priority).



I do expect a call back from Amazon support today, but was wondering if anyone else noticed this and how was it fixed.

Thanks,

Bob



CS-CART 2.1.3

Hello Bob,



Thank you for your message. It seems that the problem occurs because of a well-known issue in the version of your CS-Cart installation. Please try replacing the following part of the code:



$shipping_data = array(
'ShippingMethod' => array(
'ShippingMethodId' => $shipping['name'] . ' ' . $shipping['delivery_time'],
'ServiceLevel' => 'Standard',


with this one:



// Try to determine the service level
$service_level = 'Standard';

if (preg_match('/(?:1|one).{0,1}day/i', $shipping['name'])) {
$service_level = 'OneDay';

} elseif (preg_match('/(?:2|two).{0,1}day/i', $shipping['name'])) {
$service_level = 'TwoDay';

} elseif (preg_match('/(?:express|expedited)/i', $shipping['name'])) {
$service_level = 'Expedited';
}

$shipping_data = array(
'ShippingMethod' => array(
'ShippingMethodId' => $shipping['name'] . ' ' . $shipping['delivery_time'],
'ServiceLevel' => $service_level,


in the “amazon_callback.php” file located in the “payments/amazon” directory of your CS-Cart installation.





Pavel Zyukin

CS-Cart Support team

[quote name='CS-Cart Support team' timestamp='1315829051' post='121498']

Hello Bob,



Thank you for your message. It seems that the problem occurs because of a well-known issue in the version of your CS-Cart installation. Please try replacing the following part of the code:



$shipping_data = array(
'ShippingMethod' => array(
'ShippingMethodId' => $shipping['name'] . ' ' . $shipping['delivery_time'],
'ServiceLevel' => 'Standard',


with this one:



// Try to determine the service level
$service_level = 'Standard';

if (preg_match('/(?:1|one).{0,1}day/i', $shipping['name'])) {
$service_level = 'OneDay';

} elseif (preg_match('/(?:2|two).{0,1}day/i', $shipping['name'])) {
$service_level = 'TwoDay';

} elseif (preg_match('/(?:express|expedited)/i', $shipping['name'])) {
$service_level = 'Expedited';
}

$shipping_data = array(
'ShippingMethod' => array(
'ShippingMethodId' => $shipping['name'] . ' ' . $shipping['delivery_time'],
'ServiceLevel' => $service_level,


in the “amazon_callback.php” file located in the “payments/amazon” directory of your CS-Cart installation.





Pavel Zyukin

CS-Cart Support team

[/quote]



Thanks Pavel,

Will try your fix soon.

Which version of cs-cart fixes this problem? I plan on upgrading after your next release. Would I have to change the name of my shipping method for the Amazon Payment method to correspond to one of their methods?

I did submit a ticket from within my account. You can add this to the ticket and I can close it after I test it.

Thanks,

Bob

Hello Bob,



Thank you for the reply.



This problem is fixed in CS-Cart version 2.2.1, so you should not apply the provided code changes after upgrading your store to this version. As regards names of shipping methods, you can use any names you wish as long as there is checking for a shipping service name (not a shipping method name) in the “amazon_callback.php” file.



Our technical support engineer will reply to your ticket posted in our Help Desk at the first opportunity.





Pavel Zyukin

CS-Cart Support team