Having a paypal calculating VAT issue? - paypal

I am developing a simple shopping cart with paypal checkout, but i am stuck with the VAT processing part on paypal's side.
Paypal seems to add up total +VAT+ shipping. But when i substract the VAT from the $grandtotal variable in my shopping cart i get the error message:
The totals of the cart item amounts do not match order amounts.
I am using Paypal's SetExpressCheckout.
My questions:
1/ for parameter PAYMENTREQUEST_0_AMT should i use the total with or without the VAT
2/ should i use parameter PAYMENTREQUEST_0_TAXAMT? if so how do i prevent paypal from adding it up
regards

Please see the following extracts from the PayPal site :
PAYMENTREQUEST_n_AMT - (Required) Total cost of the transaction to the
buyer. If shipping cost and tax charges are known, include them in
this value. If not, this value should be the current sub-total of the
order. If the transaction includes one or more one-time purchases,
this field must be equal to the sum of the purchases. Set this field
to 0 if the transaction does not include a one-time purchase such as
when you set up a billing agreement for a recurring payment that is
not immediately charged. When the field is set to 0, purchase-specific
fields are ignored.
PAYMENTREQUEST_n_ITEMAMT - Sum of cost of all items in this order. For digital goods, this field is required. You can specify up to 10
payments, where n is a digit between 0 and 9, inclusive; except for
digital goods, which supports single payments only.
PAYMENTREQUEST_n_TAXAMT - (Optional) Sum of tax for all items in this order. You can specify up to 10 payments, where n is a digit
between 0 and 9, inclusive; except for digital goods, which supports
single payments only.

AMT = item amt + tax amt + shipping amt + handle amt - discount.
So if your item amt already includes tax, then don't use tax amt, otherwise, make sure item amt doesn't include tax and put tax in tax amt.

Related

I'm using Express Checkout in Paypal and trying to pass discount of cart total

I have passed the following request (full discount on an item, but required to pay shipping):
$nvstr = "
&L_PAYMENTREQUEST_0_NAME0=IOB+Joining+Package+Fee
&L_PAYMENTREQUEST_0_QTY0=3
&L_PAYMENTREQUEST_0_AMT0=.1
&L_PAYMENTREQUEST_0_NAME1=Discount
&L_PAYMENTREQUEST_0_QTY1=1
&L_PAYMENTREQUEST_0_AMT1=-.1
&PAYMENTREQUEST_0_ITEMAMT=0.2
&PAYMENTREQUEST_0_TAXAMT=0
&PAYMENTREQUEST_0_SHIPDISCAMT=0
&MAXAMT=0
&PAYMENTREQUEST_0_SHIPPINGAMT=0.3
&PAYMENTREQUEST_0_HANDLINGAMT=0
&PAYMENTREQUEST_0_AMT=0.5
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&CUSTOM=.1
&SOLUTIONTYPE=Sole";
after payment I see that the discount price is multiplied by quantity.
That's intended. Express checkout supports Discount by Passing negative amount in the line item. It works as other line items and it will be multiplied by quantity.
You could change your quantity to adjust with your discount amount.

Mapping payments in IIF to QBXML

For having deprecated IIF, you'd think Intuit would make it easier to map the calls but I've found myself in something of a corner.
I have a fairly old script mapping our stuff to IIF.
!TRNS TRNSTYPE DATE ACCNT NAME AMOUNT DOCNUM MEMO CLEAR REP PAYMETH ADDR1 ADDR2 ADDR3 ADDR4
!SPL TRNSTYPE DATE ACCNT NAME AMOUNT DOCNUM MEMO CLEAR QNTY PRICE INVITEM PAYMETH EXTRA
!ENDTRNS
TRNS PAYMENT 1/21/2010 Paypal Account Dear Customer 1230.9 PAYPAL - Invoice123 N PAYPAL Dear Customer 123 Dear Dr
SPL PAYMENT 1/21/2010 Accounts Receivable Dear Customer -1230.9 Invoice123 PAYPAL - Invoice123 N PAYPAL
ENDTRNS
TRNS CHECK 1/21/2010 Paypal Account Paypal Account -29.84 Transaction Fees - Invoice123 N
SPL CHECK 1/21/2010 Fees:Paypal Fees Dear Customer 29.84 Transaction Fees - Invoice123 N
ENDTRNS
Now, I have a script that handles the customer and finding the right record in QB but I'm trying to find the right call to put all these records in. It looks like the first two can fit into ReceivePaymentAddRq but it's less clear on the second set.
Then I have another set that starts with BILL
TRNS BILL 5/15/2014 Accounts Payable Our Vendor -344.81 450608 N 6/14/2014 Net 30
SPL BILL 5/15/2014 Cost of Goods Sold:Purchases Dear Customer 344.81 450608 Invoice123 N
ENDTRNS
I think both fall under BillAdd but that COGS line could also fall under ChargeAdd
The transaction type PAYMENT would indeed be a ReceivePaymentAddRq. The CHECK type would be a CheckAddRq as you are not effecting an Accounts Receivable account. The transaction type of BILL would be a BillAddRq, as you are wanting to effect Accounts Payable. The ChargeAddRq is used for a customer charge, which is not the same as a CreditCardChargeAddRq.
It helps to have used QuickBooks manually a bit to understand the types of transactions that are used, but here's a quick little reference (these include the AddRq, QueryRq and ModRq where applicable). Note that this is not 100% as there are situations where you might use a different transaction type, but it's a good starting point:
Effect Accounts Receivable:
Invoice
ReceivePayment
Charge
CreditMemo
Effect Accounts Payable:
Bill
ItemReceipt
VendorCredit
BillPaymentCheck
BillPaymentCreditCard
Effect Bank Account:
Check
Deposit
Effect Credit Card Account:
CreditCardCharge
CreditCardCredit

Recurring payments: how to specify an initial payment TAX value different than the subsequent cycles?

If I do a request with the INITAMT equal to the recurring payment amount, it works.
But if I try to bill a different INITAMT (and so different TAX), I get this error:
Tax calculation mismatch. The tax amount for the regular non-trial billing period is different than the sum of the tax for each item in the cart.
My actual request:
I have an initial payment of 4.84€ including 0.84€ of VAT tax.
The next month the amount to bill should be 25.09€ (including 6.09€ VAT).
The request I send is basically this:
Method: CreateRecurringPaymentsProfile
"CURRENCYCODE":"EUR",
"INITAMT":4.84,
"TAXAMT":0.84,
"DESC":"Subscription",
"BILLINGPERIOD":"Month",
"BILLINGFREQUENCY":1,
"AMT":29,
"L_PAYMENTREQUEST_0_ITEMCATEGORY0":"Digital",
"L_PAYMENTREQUEST_0_NAME0":"Subscription",
"L_PAYMENTREQUEST_0_AMT0":29,
"L_PAYMENTREQUEST_0_TAXAMT0":6.09,
"L_PAYMENTREQUEST_0_QTY0":1
"PROFILEREFERENCE":"51a1f8f4732baf580a000031",
"PAYMENTREQUEST_0_INVNUM":"51a1f8f4732baf580a000031",
"INVNUM":"51a1f8f4732baf580a000031",
"PROFILESTARTDATE":"2013-06-26T11:59:12+0000",
And the response:
"TIMESTAMP":"2013-05-27T10:55:46Z",
"CORRELATIONID":"969d07e2cef8a",
"ACK":"Failure",
"VERSION":"74",
"BUILD":"5908853",
"L_ERRORCODE0":"10004",
"L_SHORTMESSAGE0":"Tax calculation mismatch.",
"L_LONGMESSAGE0":"Tax calculation mismatch. The tax amount for the regular non-trial billing period is different than the sum of the tax for each item in the cart.",
"L_SEVERITYCODE0":"Error"
I'd like to do this with the INITAMT value, so that the user can see the two purchases as correlated in the Paypal private area (ie: a subscription with an inital payment).
Otherwise I'll have to do a separate DoExpressCheckout for the initial payment.
What's happening is that you cannot (I believe) set a tax amount for the Initial Amount.
The TAXAMT is for the recurring payment, not the Initial Amount.
Your statement is saying "Billing 29€ with a tax of 0.84€".
However your item list says the tax should be 6.09€
Change your TAXAMT to 6.09€ and it should be fine.

PayPal Charge Tax on shipping (not just items)

I am using the PayPal url approach which works well but when I try charge tax it only seems to apply the tax to the total value of all of the goods, whereas I would like to charge Tax on the Total goods + Shipping, ie
Goods $100.00,
Shipping $20.00,
SubTotal $120.00,
Tax (10%) $12.00,
Grand Total $132.00
This is what I have
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart&business=xxxxxxxxxxxxxx_biz#gmail.com&button_subtype=services&upload=1&no_note=1&currency_code=USD&rm=1&item_name_1=Product1&amount_1=200.00&quantity_1=2&item_name_2=Product2&amount_2=200.00&quantity_2=22&shipping_2=6&tax_1=10&tax_2=10&return=http://staging.xxxx.com/store/success.aspx&cancel_return=http://staging.xxxx.com/store/failed.aspx
I made a change to the tax variable to apply a rate rather than an amount. At this time PayPal doesn't charge tax including shipping as services are typically not taxable.
If this is a requirement I'd recommend calculating the total tax amount on your site before sending the Post to PayPal. The value can be entered in the tax_1 field. I've shown an example of this in the second post.
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart
&business=xxxxxxxxxxxxxx_biz#gmail.com
&button_subtype=services
&upload=1
&no_note=1
&currency_code=USD
&rm=1
&item_name_1=Product1
&amount_1=200.00
&quantity_1=2
&item_name_2=Product2
&amount_2=200.00
&quantity_2=2
&shipping_2=6
&tax_rate_1=10
&tax_rate_2=10
&return=http://staging.xxxx.com/store/success.aspx
&cancel_return=http://staging.xxxx.com/store/failed.aspx
Here's an example with you calculating the amount. Notice you're only sending one tax amount rather than a tax amount for each item. PayPal doesn't show itemized tax amounts to the customer so there is no impact on the customer's end.
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart
&business=xxxxxxxxxxxxxx_biz#gmail.com
&button_subtype=services
&upload=1
&no_note=1
&currency_code=USD
&rm=1
&item_name_1=Product1
&amount_1=200.00
&quantity_1=2
&item_name_2=Product2
&amount_2=200.00
&quantity_2=2
&shipping_2=6
&tax_1=10
&return=http://staging.xxxx.com/store/success.aspx
&cancel_return=http://staging.xxxx.com/store/failed.aspx

Pass variable cart total to PayPal for Subscription (using Enhanced Recurring Payments w. Website Payments Standard)

Summary: Trying to pass along a variable Monthly Subscription cost to PayPal based on user-selected options on a form I created. Working within Website Payments Standard with Enhanced Recurring Payment option, is this possible?
Details:
User visits "shop" page, which is a form with 4 line items, each line item consisting of 2-7 options, each option with an associated price.
For example, line item 1 is "size of business" with the options being:
a) 1-3 employees - $10
b) 4+ employees - $12.50
User goes through the list and chooses 1 option for each line item and some javascript calculates the total due on the fly.
Is it possible to pass this total to PayPal, not as a one-time cost, rather as the base cost for a monthly subscription?
Yes. Just change the value you're passing for a3, rather than amount.
Is there a problem you're running into?