3

I'm setting up Paypal on a site at the moment as an alternative payment method for customers. In general, it's working fine; I can put an order through and it goes through to Paypal's site, shows the correct information, and all is fine. When a user applies a discount to the order, things still work fine, no worries at all.

When a user applies a discount for the full order value (ie. order is for £20, they have a discount code for £20 off) I'm getting the error "Item total is invalid." back from Paypal. The cost being sent across is £0, and the shipping being sent across is £5.

First off, is there anything wrong with the fields I'm sending across, and if so, what's wrong? :) If you need any more info, feel free to ask.

Sample express checkout fields:

Array
(
    [METHOD] => SetExpressCheckout
    [RETURNURL] => /snip/
    [CANCELURL] => /snip/
    [NOTIFYURL] =>
    [AMT] => 5.00
    [DESC] =>
    [CURRENCYCODE] => GBP
    [MAXAMT] =>
    [USERACTION] => commit
    [INVNUM] =>
    [ADDROVERRIDE] => 0
    [SHIPTONAME] =>
    [SHIPTOSTREET] =>
    [SHIPTOSTREET2] =>
    [SHIPTOCITY] =>
    [SHIPTOSTATE] =>
    [SHIPTOZIP] =>
    [SHIPTOCOUNTRYCODE] =>
    [LOCALECODE] => GB
    [PAGESTYLE] =>
    [HDRIMG] =>
    [BUTTONSOURCE] => /snip/
    [L_SHIPPINGOPTIONISDEFAULT0] => true
    [L_SHIPPINGOPTIONNAME0] => Royal Mail Tracked Next Day Ref:/snip (int)/
    [L_SHIPPINGOPTIONLABEL0] =>
    [L_SHIPPINGOPTIONAMOUNT0] => 5.00
    [L_SHIPPINGOPTIONISDEFAULT1] => false
    [L_SHIPPINGOPTIONNAME1] => Interlink Express Next Day Delivery (Ord Ref:/snip (int)/
    [L_SHIPPINGOPTIONLABEL1] =>
    [L_SHIPPINGOPTIONAMOUNT1] => 7.00
    [L_SHIPPINGOPTIONISDEFAULT2] => false
    [L_SHIPPINGOPTIONNAME2] => Collect In Store Ref:/snip (int)/
    [L_SHIPPINGOPTIONLABEL2] =>
    [L_SHIPPINGOPTIONAMOUNT2] => 0.00
    [L_NAME0] => /snip/
    [L_NUMBER0] => /snip (item id)/
    [L_DESC0] =>
    [L_AMT0] => 8.33
    [L_TAXAMT0] => 1.67
    [L_QTY0] => 1
    [L_NAME1] => /snip/
    [L_NUMBER1] => /snip (item id)/
    [L_DESC1] =>
    [L_AMT1] => 8.33
    [L_TAXAMT1] => 1.67
    [L_QTY1] => 1
    [L_AMT2] => -16.66
    [L_TAXAMT2] => -3.34
    [L_NAME2] => /snip/
    [L_DESC2] => /snip/
    [L_QTY2] => 1
    [ALLOWNOTE] => 1
    [BUYEREMAILOPTINENABLE] => 1
    [CALLBACK] => /snip/
    [CALLBACKURL] => /snip/
    [CALLBACKTIMEOUT] => 6
    [REQCONFIRMSHIPPING] => 0
    [SHIPPINGAMT] => 5.00
    [ITEMAMT] => 0.00
    [TAXAMT] => 0.00
)
starball
  • 20,030
  • 7
  • 43
  • 238
Joe
  • 15,669
  • 4
  • 48
  • 83

1 Answers1

4

You can't send an empty or zero amount to PayPal. $0.01 is the lowest you can go.

You can try and work around this by taking a cent from the shipping and adding it to the total or swap the shipping and item charges if the item charge is zero.

random
  • 9,774
  • 10
  • 66
  • 83
Robert
  • 19,326
  • 3
  • 58
  • 59
  • Hm, that is a little annoying heh. Is there a known workaround, or do you just have to take a penny off the shipping and add it to an item? – Joe Sep 16 '11 at 08:08
  • That, or move the shipping charge to the item charge if the item charge is 0. That's the only workaround I know of unfortunately. – Robert Sep 16 '11 at 11:20
  • You could just add the shipping cost as an "item" being sold, and put nvp "NOSHIPPING=1" when you make your paypal call – David Pugh Jul 20 '13 at 17:25
  • I wouldn't recommend setting NOSHIPPING=1 if you actually are shipping something. You won't be covered by selling protection that way. – Drew Angell Oct 08 '15 at 06:16