Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PayPal Pro items subtotal being 0 issue. #352

Closed
levansy2020 opened this issue Nov 7, 2015 · 2 comments
Closed

PayPal Pro items subtotal being 0 issue. #352

levansy2020 opened this issue Nov 7, 2015 · 2 comments
Assignees
Milestone

Comments

@levansy2020
Copy link
Contributor

Have a transaction that is failing, where the customer applied a discount code for a discount amount that is greater than the item subtotal resulting in the items subtotal being 0 and the shipping amount is greater than 0. Historically, this scenario fails with PayPal. In the past, I have worked around this problem by deducting $0.01 from the shipping amount and increasing the item amount by $0.01 prior to sending the transaction to PayPal. Are you familiar with this scenario and does the plugin attempt to handle the scenario? Log Entry Below:
11-02-2015 @ 15:02:41 - Processing order #8360
11-02-2015 @ 15:02:41 - Do payment request Array
(
[DPFields] => Array
(
[paymentaction] => Sale
[ipaddress] => 12.12.250.66
[returnfmfdetails] =>
)
[CCDetails] => Array
(
[creditcardtype] => Visa
[acct] => ****
[expdate] => 042017
[cvv2] => ****
[startdate] =>
[issuenumber] =>
)
[PayerInfo] => Array
(
[email] => ****
[firstname] => ***
[lastname] => ***
)
[BillingAddress] => Array
(
[street] => ***
[street2] => ***
[city] => ***
[state] => MA
[countrycode] => US
[zip] => 02116
[phonenum] => ***
)
[ShippingAddress] => Array
(
[shiptoname] => ***
[shiptostreet] => ***
[shiptostreet2] => ***
[shiptocity] => ***
[shiptostate] => MA
[shiptozip] => 02116
[shiptocountry] => US
[shiptophonenum] =>
)
[PaymentDetails] => Array
(
[amt] => 10.41
[currencycode] => USD
[insuranceamt] =>
[shipdiscamt] => 0.00
[handlingamt] => 0.00
[desc] =>
[custom] =>
[invnum] => 8360
[notifyurl] =>
[recurring] =>
[taxamt] => 0
[shippingamt] => 10.41
[itemamt] => 0
)
[OrderItems] => Array
(
)
[Secure3D] => Array
(
)
)
11-02-2015 @ 15:02:41 - Request: Array
(
[USER] => *****
[PWD] => *****
[VERSION] => 112.0
[BUTTONSOURCE] => AngellEYE_SP_WooCommerce
[SIGNATURE] => *****
[METHOD] => DoDirectPayment
[PAYMENTACTION] => Sale
[IPADDRESS] => 12.12.250.66
[CREDITCARDTYPE] => Visa
[ACCT] => *****
[EXPDATE] => *****
[CVV2] => *****
[EMAIL] => ***
[FIRSTNAME] => ***
[LASTNAME] => ***
[STREET] => ***
[STREET2] => ***
[CITY] => ***
[STATE] => MA
[COUNTRYCODE] => US
[ZIP] => 02116
[PHONENUM] => ***
[AMT] => 10.41
[SHIPDISCAMT] => 0.00
[HANDLINGAMT] => 0.00
[INVNUM] => 8360
[SHIPPINGAMT] => 10.41
[SHIPTONAME] => ***
[SHIPTOSTREET] => ***
[SHIPTOSTREET2] => ***
[SHIPTOCITY] => ***
[SHIPTOSTATE] => MA
[SHIPTOZIP] => 02116
[SHIPTOCOUNTRY] => US
)
11-02-2015 @ 15:02:41 - Response: Array
(
[TIMESTAMP] => 2015-11-02T20:03:32Z
[CORRELATIONID] => 9055973119f22
[ACK] => Failure
[VERSION] => 112.0
[BUILD] => 18308778
[L_ERRORCODE0] => 10413
[L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE0] => The totals of the cart item amounts do not match order amounts.
[L_SEVERITYCODE0] => Error
[AMT] => 10.41
[CURRENCYCODE] => USD
)
11-02-2015 @ 15:02:41 - Error Array
(
[0] => Array
(
[L_ERRORCODE] => 10413
[L_SHORTMESSAGE] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE] => The totals of the cart item amounts do not match order amounts.
[L_SEVERITYCODE] => Error
)
)

@levansy2020 levansy2020 added this to the 1.2 milestone Nov 7, 2015
@levansy2020 levansy2020 self-assigned this Nov 7, 2015
@levansy2020
Copy link
Contributor Author

We could set the actual shipping amount to 0.00 and then add the shipping as an additional line item on the order. The shipping line item could be called "Shipping" or "S&H" or whatever we want to call it. I'll probably start by just adding it as "Shipping" and then maybe in a later update we could add filters so you can customize it to say whatever you want.

@angelleye
Copy link
Collaborator

I think we need to add more logic to this. Right now we're just checking...

if ($PaymentData['itemamt'] == 0) {

}

There could be other things that cause the ITEMAMT to be 0, though, and this would kick in and could confuse us.

We only want to make this shipping amount adjustment when the ITEMAMT = 0 and the SHIPPINGAMT > 0. So this simple adjustment may be enough...

if ($PaymentData['itemamt'] == 0 && $PaymentData['shippingamt'] > 0) {

}

Need to confirm with testing, of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants