If this is your first visit, check our documentation. To post, register or login.

Express Checkout payment module

Locked

Started by philip937 on 25 Nov 2012, 10:31 PM · Views: 4,176

Results 21 to 29 of 29
This thread is locked. New replies are disabled.
5 Dec 2012, 7:55 PM
#21
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Post #21 by philip937

I just tried placing the same order to see if it would work with the code change and it has made no difference :O(

any suggestions what I can do?

here is the debug code of the retry:
| mc_currency = GBP
| submitted_currency = GBP
| order_currency = GBP
| mc_gross = 36.37
| converted_amount = 36.36
| order_amount = 36.3632

Dec 05 2012 19:51 -- IPN NOTICE :: Failed because of currency mismatch.

Phil Rogers
A problem shared is a problem solved.

6 Dec 2012, 4:16 AM
#22
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #22 by drbyte

It's been a long time since I worked on v1.3.9h code, especially dealing with fixing bugs in it. I can't remember which bug was fixed in what version especially that far back. To help, I would have to basically start over from scratch again. To do that I need the following information:
What exact steps do I need to follow to set up a brand new store to exactly replicate this very same scenario, so I can do testing to find a workaround for you? Assume my store is a brand new fresh install, configured exactly as it is out-of-the-box as USA, using USD, using tax-not-included pricing, no tax rates, etc, and no plugins/addons of any sort, and no products.
Assume that all I know about your site so far is that your prices are in £ and you're using v1.3.9h, and sometimes using PayPal Standard, and sometimes PayPal Express.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Dec 2012, 8:09 AM
#23
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Post #23 by philip937

I have a 10% sale on across all products. The total price is not rounding the total the same way papal is so I just need to know what to change to either round the figures correctly in the cart or round the figures before they are sent to PayPal so that PayPal doesn't do it's own rounding?

Phil Rogers
A problem shared is a problem solved.

6 Dec 2012, 8:32 AM
#24
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Post #24 by philip937

Maybe an easier way to do it is where it is obviously comparing the order amount with the PayPal amount to change it so that instead of having to match exactly change it so it matches within a tolerance say by 0.20 either way. If I were to do this what bit of code would I have to check?

Phil Rogers
A problem shared is a problem solved.

6 Dec 2012, 12:17 PM
#25
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Post #25 by philip937

DrByte:

It's been a long time since I worked on v1.3.9h code, especially dealing with fixing bugs in it. I can't remember which bug was fixed in what version especially that far back. To help, I would have to basically start over from scratch again. To do that I need the following information:
What exact steps do I need to follow to set up a brand new store to exactly replicate this very same scenario, so I can do testing to find a workaround for you? Assume my store is a brand new fresh install, configured exactly as it is out-of-the-box as USA, using USD, using tax-not-included pricing, no tax rates, etc, and no plugins/addons of any sort, and no products.
Assume that all I know about your site so far is that your prices are in £ and you're using v1.3.9h, and sometimes using PayPal Standard, and sometimes PayPal Express.

heres the scenario, values and discounts should be irrelevant which ever currecy used:

10% sale applied on all items in store v1.3.9h

Item 1
base price 14.73
with sale: 13.26

Item 2
base price 14.62
with sale: 13.16

Delivery
9.95

Below an extract of the values I have taken from the source code on the confirmation page prior to clicking the confirm order button.

<input type="hidden" name="currency_code" value="GBP" /> <input type="hidden" name="amount" value="36.36" /> <input type="hidden" name="tax_cart" value="0.00" /> <input type="hidden" name="item_number_1" value="30006" /> <input type="hidden" name="item_name_1" value="Item 1" /> <input type="hidden" name="amount_1" value="13.26" /> <input type="hidden" name="quantity_1" value="1" /> <input type="hidden" name="item_number_2" value="9318" /> <input type="hidden" name="item_name_2" value="Item 2" /> <input type="hidden" name="amount_2" value="13.16" /> <input type="hidden" name="quantity_2" value="1" /> <input type="hidden" name="num_cart_items" value="2" /> <input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="shipping_1" value="9.95" />

The shopping cart total shows 36.36

The total value sent to paypal as above is 36.36

However if you add up the individual lines sent to paypal they total 36.37.

So do I need to some how get the value that gets sent to PayPal and logged to the database to be 36.37? If so how can I do this?

Phil Rogers
A problem shared is a problem solved.

8 Dec 2012, 8:15 PM
#26
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #26 by drbyte

What you've posted is code generated when using PayPal Payments Standard, not Express Checkout.

With Express Checkout, it does a further sanity check of adding up each of the line items being submitted, and checking that value against the amount of the purchase. If they don't match, it skips sending the line-item details in order to prevent this sort of error ... which probably also explains the symptoms you were mentioning in your first post.

So, how do you want it to work? Should we charge customers more just because PayPal can't do aggregate math by applying a percentage discount in a sale situation?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Dec 2012, 9:50 AM
#27
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Post #27 by philip937

I get what your saying, an makes sense but payment standards for what ever reason is the only one that will do the detailed line items at the PayPal page for what ever reason.

What steps can I take to try and understand why express is not giving me the detailed lines?

Basically if there is an error and an order doesn't create id much rather it happen and know what the customer ordered. At present if an error occurs all I would have is a receipt with a total amount.

On the other hand back to payments, should the cart total not be the total of the rounded values anyway. If it was then it would all be sent through to PayPal correctly?

Phil Rogers
A problem shared is a problem solved.

9 Dec 2012, 7:50 PM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #28 by drbyte

Let me clarify:

  1. Express Checkout -- if the line-item amounts don't add up exactly (because of sales/rounding differences), then the amount is still sent to PayPal for payment without the line-item details showing TO PAYPAL, but THE DETAILS ARE STILL ON THE INVOICE IN YOUR STORE and the customer's emailed receipt.

  2. Standard - if the amounts don't add up, then it will never complete the order in your store, because it can't validate the payment. Thus NEITHER YOU NOR YOUR CUSTOMER WILL SEE THE DETAILS because your store will NOT be able to complete its side of the transaction.

Thus, it's always better to use Express Checkout, because the transaction will complete, and the order will have all the data (line-item details) in it, even if the PayPal receipt doesn't contain all the line-item details for whatever reason.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Dec 2012, 9:45 PM
#29
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Post #29 by philip937

Not strictly true, order isn't completed but because I send line items to PayPal when they complete payment I see what they ordered on the PayPal receipt..

Phil Rogers
A problem shared is a problem solved.