Pay Pal Mass Pay IPN - Payment(batch) Status and single payment Status - paypal

We are sending payouts to our users with the MassPay API.
Our system works in a way that each MassPay batch includes only a single payment.
Our problem is that its not entirely clear how the MassPay IPN statuses work.
The PayPal docs say that there are 3 types of IPNs - Failed, Processed and Completed.
What I don't understand is which status combinations of payment_status and status1 are possible:
Can an IPN return (payment_status = DENIED and status1 = Completed)?
Will an IPN with status1 = FAILED or BLOCKED always have a payment_status = DENIED and vice versa?
Will a (payment_status = PROCESSED and status1 = COMPLETED) always come before an IPN with (payment_status = COMPLETED and status1 = COMPLETED)? If yes, is it enough to only check for (payment_status = COMPLETED and status1 = COMPLETED) to mark the payout as 'success' on our system?
Will an IPN withstatus1 = REVERSED or RETURNED always have payment_status = COMPLETED?
Will an IPN with status1 = PENDING always have a payment_status = PROCESSED?
To be more specific, it would help to know which of the payment_status and status1 combinations are even possible and whats the meaning of each possible status pair?
please see attached table1
Here is the table in text:
payment_status status1 Is Combination Possible? Meaning
Processed Blocked ?
Processed Pending ?
Processed Unclaimed YES
Processed Reversed ?
Processed Completed YES Will this always have COMPLETED+COMPLETED afterwards?
Processed Failed ?
Processed Returned ?
Denied Blocked ?
Denied Pending ?
Denied Unclaimed ?
Denied Reversed ?
Denied Completed ?
Denied Failed ?
Denied Returned ?
Completed Blocked ?
Completed Pending ?
Completed Unclaimed ?
Completed Reversed ?
Completed Completed YES Will this always be after Processed+Completed IPN?
Completed Failed ?
Completed Returned YES

Related

Refund a Transaction REST does not accept last 4 cc number

According to the API Doc 1:
When issuing a credit card refund, the request must include either a full card number and expiration date, or the original transaction ID (transId) and last 4 digits of the card number.
I assume the original transaction ID should be provided as 'refTransId'
But even with the refTransId provided, the API still returns this messsage.
"errors": [
{
"errorCode": "6",
"errorText": "The credit card number is invalid."
}
]
When provided with full CC number and expiration date, the refund is processed successfully. Any idea why?

Having a paypal calculating VAT issue?

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.

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 parallel and express checkout

I'm using the new version of paypal Checkout Express API to impliment the parallel payment,
When i send the request I got an error:
The totals of the cart item amounts do not match order amounts.
This is the request and response from api debug:
INFO: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes"><soapenv:Header><urn:RequesterCredentials><ebl:Credentials><ebl:Username>sdk-three_api1.sdk.com</ebl:Username><ebl:Password>QFZCWN5HZM8VBG7Q</ebl:Password><ebl:Signature>A-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU</ebl:Signature></ebl:Credentials></urn:RequesterCredentials></soapenv:Header><soapenv:Body><urn:SetExpressCheckoutReq><urn:SetExpressCheckoutRequest><ebl:Version>92.0</ebl:Version><ebl:SetExpressCheckoutRequestDetails><ebl:ReturnURL>http://localhost:8080/EC/GetExpressCheckout?currencyCodeType=null</ebl:ReturnURL><ebl:CancelURL>http://localhost:8080/index.html</ebl:CancelURL><ebl:NoShipping>0</ebl:NoShipping><ebl:PaymentDetails><ebl:OrderTotal currencyID="USD">10.00</ebl:OrderTotal><ebl:ItemTotal currencyID="USD">10.0</ebl:ItemTotal><ebl:PaymentDetailsItem><ebl:Quantity>1</ebl:Quantity><ebl:Amount currencyID="USD">10.0</ebl:Amount></ebl:PaymentDetailsItem><ebl:PaymentDetailsItem><ebl:Quantity>1</ebl:Quantity><ebl:Amount currencyID="USD">10.0</ebl:Amount></ebl:PaymentDetailsItem><ebl:SellerDetails><ebl:PayPalAccountID>tarik._1341024461_biz#gmail.com</ebl:PayPalAccountID></ebl:SellerDetails><ebl:PaymentAction>Sale</ebl:PaymentAction><ebl:PaymentRequestID>1</ebl:PaymentRequestID></ebl:PaymentDetails><ebl:PaymentDetails><ebl:OrderTotal currencyID="USD">10.00</ebl:OrderTotal><ebl:ItemTotal currencyID="USD">10.0</ebl:ItemTotal><ebl:PaymentDetailsItem><ebl:Quantity>1</ebl:Quantity><ebl:Amount currencyID="USD">10.0</ebl:Amount></ebl:PaymentDetailsItem><ebl:PaymentDetailsItem><ebl:Quantity>1</ebl:Quantity><ebl:Amount currencyID="USD">10.0</ebl:Amount></ebl:PaymentDetailsItem><ebl:SellerDetails><ebl:PayPalAccountID> tarik._1341024461_biz#gmail.com</ebl:PayPalAccountID></ebl:SellerDetails><ebl:PaymentAction>Sale</ebl:PaymentAction><ebl:PaymentRequestID>2</ebl:PaymentRequestID></ebl:PaymentDetails></ebl:SetExpressCheckoutRequestDetails></urn:SetExpressCheckoutRequest></urn:SetExpressCheckoutReq></soapenv:Body></soapenv:Envelope>
9 août 2012 01:01:34 com.paypal.core.LoggingManager log
INFO: 2012-08-08T23:01:33ZFailure222642713a617Transaction refused because of an invalid argument. See additional error messages for details.The totals of the cart item amounts do not match order amounts.10413Error92.03386080
The problem is what it says:
The totals of the cart item amounts do not match order amounts.#
Make sure you are sending the same amount of items from the cart to match the order amount.

PayPal (ExpressCheckoutAPI) Shipping Tax

Okay, so I've searched, and asked on the PayPal forum but no one will respond. My problem is as follows. When specifiying the Shipping Cost in the PaymentDetails sent to paypal, PayPal will not accept the Tax on this in the Tax and Order totals.
For example:
Item Cost = £1
Item Tax = £0.20
Shipping Cost = £1
Shipping Tax = £0.20
I would send these values:
PaymentDetailsType paymentDetails = new PaymentDetailsType()
{
ItemTotal = ItemCost
ShippingTotal = ShippingCost,
TaxTotal = ItemTax + ShippingTax,
OrderTotal = ItemCost + ShippingCost + ItemTax + ShippingTax,
};
However, PayPal will say the item totals dont match.. This is because it will not accept ShippingTax to be added?
Has anyone got a work around for this? I need to show customers what portion of their shipping is cost, and what the total vat is on the paypal page? Not sending the shipping tax in TaxTotal and OrderTotal gets round the error, but then the tax is not shown or charged!
Getting desperate on this issue... please lend a hand if you use PayPal express checkout.
In the end, PayPal responded and said they do not support this scenario of charging tax on shipping. Very poor for an international payment provider.
I have changed my code to now put through an item of Web Order with the total, and the vat on this.
I will be changing PayPal out for something else better as soon as possible.