PayPal response missing tax - paypal

I'm working on an NVP API integration and the entire payment process is working properly. The response I get from PayPal upon completion doesn't provide all the proper information.
Here is the code I am sending PayPal
&PAYMENTREQUEST_0_AMT=44.48
&PAYMENTREQUEST_0_ITEMAMT=40
&PAYMENTREQUEST_0_TAXAMT=4.48
&PAYMENTREQUEST_0_SHPPINGAMT=0
&PAYMENTREQUEST_0_INVNUM=5193f0cca7e70
&PAYMENTREQUEST_0_CURRENCYCODE=USD
&PAYMENTREQUEST_0_DESC=Test payment desc
&L_PAYMENTREQUEST_0_AMT0=40
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_NAME0=Test item
&L_PAYMENTREQUEST_0_NUMBER0=5191cd62462fb
&L_PAYMENTREQUEST_0_DESC0=Test item desc
&L_PAYMENTREQUEST_0_SHPPINGAMT0=0.00
&L_PAYMENTREQUEST_0_TAXAMT0=4.48
&RETURNURL=[REMOVED]
&CANCELURL=[REMOVED]
&BRANDNAME=Some Con 2014
&CUSTOMERSERVICENUMBER=000-000-0000
The order goes through and proper payment is processed, however the information given back is missing the tax information.
[TOKEN] => EC-1KS56755YX305151R
[SUCCESSPAGEREDIRECTREQUESTED] => false
[TIMESTAMP] => 2013-05-15T20:48:42Z
[CORRELATIONID] => 553a6a47ec1
[ACK] => Success
[VERSION] => 98
[BUILD] => 5956203
[INSURANCEOPTIONSELECTED] => false
[SHIPPINGOPTIONISDEFAULT] => false
[PAYMENTINFO_0_TRANSACTIONID] => 1XV29769HY7702037
[PAYMENTINFO_0_TRANSACTIONTYPE] => expresscheckout
[PAYMENTINFO_0_PAYMENTTYPE] => instant
[PAYMENTINFO_0_ORDERTIME] => 2013-05-15T20:48:41Z
[PAYMENTINFO_0_AMT] => 44.48
[PAYMENTINFO_0_FEEAMT] => 1.59
[PAYMENTINFO_0_TAXAMT] => 0.00
[PAYMENTINFO_0_CURRENCYCODE] => USD
[PAYMENTINFO_0_PAYMENTSTATUS] => Completed
[PAYMENTINFO_0_PENDINGREASON] => None
[PAYMENTINFO_0_REASONCODE] => None
[PAYMENTINFO_0_PROTECTIONELIGIBILITY] => Eligible
[PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE] => ItemNotReceivedEligible,UnauthorizedPaymentEligible
[PAYMENTINFO_0_SECUREMERCHANTACCOUNTID] => 3JTQYBPNDRWES
[PAYMENTINFO_0_ERRORCODE] => 0
[PAYMENTINFO_0_ACK] => Success
Why is PAYMENTINFO_0_TAXAMT coming back 0 when it is 4.48?
I'm also having an issue where the email that is sent upon purchase from PayPal is not listing the items purchased and only a general total amount. Notice description is not the item description but the overall order description.
-----------------------------------
Purchase Details
-----------------------------------
Description: Test payment desc
Unit price: $44.48 USD
Qty: 1
Amount: $44.48 USD
Subtotal: $44.48 USD

The tax is not being displayed because it is not getting passed over in your DoExpressCheckoutPayment API call. I checked the logs, and I only show that you passed it over in the SetExpressCheckout API call, but not the DoExpressCheckoutPayment API call. You would need to pass it over in the Do EC call if you are wanting it returned. This is also what is happening with your description. It is not getting passed over in the Do EC call.

Related

PayFlow PayPal recurring Payment EXPDATE Validation

Hi I have been trying to validate CC no., CVV no., EXPDATE of the users credit card for recurring billing in PayFlow. The main objective is to let the user have access to subscription products only if the credit card is valid.
I have been advised to check the card prior to creating the profile you could run a credit card verification ($0 authorization)
So I did it and I got [RESPMSG] => Verified
Here's my request and response messages:
Request
Array
(
[TRXTYPE] => A
[TENDER] => C
[PARTNER] => PayPal
[USER] => XXXXX
[PWD] => XXXXX
[AMT] => 0
[ACCT] => 5105105105105100
[EXPDATE] => 1218
[INVNUM] => PONUM1
[VERBOSITY] => HIGH
[BILLTOZIP] => 95031
)
Response
Array
(
[RESULT] => 0
[PNREF] => A11A8C1A41C0
[RESPMSG] => Verified
[AUTHCODE] => 992PNI
[AVSADDR] => X
[AVSZIP] => X
[HOSTCODE] => A
[PROCAVS] => U
[TRANSTIME] => 2015-11-22 23:30:52
[AMT] => 0.00
[ACCT] => 5100
[EXPDATE] => 1218
[CARDTYPE] => 1
[IAVS] => X
[PREFPSMSG] => No Rules Triggered
[POSTFPSMSG] => No Rules Triggered
)
Now my question is I haven't provided CVV2 and also Any future date as EXPDATE gets verified. Can you please explain how things are working here? Also how can I verify CC, CVV and EXPDATE ?
This is simply creating the profile without any initial payment. As such, it's not going to validate the card at all. Of course, the first payment attempted on the profile would fail.
If you want to check the card prior to creating the profile you could run a credit card verification ($0 authorization).
So run the card verification first, and then only if that is successful you would follow up with a call to create the profile.
Keep in mind that if you're working in the sandbox any credit card expiration and security code will be accepted as long as it's not expired. This is done in the sandbox to make testing quick and easy.
If you would like to force errors in the API response so you can test those cases, take a look at the PayFlow documentation on testing.
Yes in the Test mode any future date for EXPDATE will be fine as Andrew mentioned . If you are looking for CVV value to be returned as "N" in the test mode then you can adjust the CVV values according to the docs below .
https://developer.paypal.com/webapps/developer/docs/classic/payflow/integration-guide/#testing-card-security-code
NVP Request:
VENDOR=XXX&PARTNER=Paypal&USER=XXXX&PWD=XXXX&TRXTYPE[1]=A&TENDER[1]=C&VERBOSITY=HIGH&ACCT[16]=5105105105105100&EXPDATE[4]=1020&AMT=0.00&**CVV2[3]=400**&COMMENT1[23]=Global Test Transaction&FIRSTNAME[4]=John&LASTNAME[5]=Smith&STREET=49354 Main&CITY[7]=SanJose&STATE[2]=CA&ZIP[5]=94303&COUNTRY[2]=US
NVP Response:
RESULT=0
PNREF=A71C8A7EA028
RESPMSG=Verified
AUTHCODE=010101
AVSADDR=N
AVSZIP=N
CVV2MATCH=N
HOSTCODE=A
RESPTEXT=100
PROCAVS=I8
PROCCVV2=N
TRANSTIME=2015-11-23 20:05:55
FIRSTNAME=John
LASTNAME=Smith
AMT=0.00
ACCT=5100
EXPDATE=1020
CARDTYPE=1
IAVS=N
PREFPSMSG=No Rules Triggered
POSTFPSMSG=No Rules Triggered

Cannot get invoice in respose of CreateRecurringPaymentsProfile in paypal

My intention is to create a Recurring Profile and pass a company_id as custom parameter to be stored IPN database, where I can create a relation between payment and for which company it was done.
I have read that while creating Recurring Payment Profile to get some custom value in IPN database, you should pass it in PROFILEREFERENCE parameter and then retrieve it from rp_invoice_id in response.
I cannot get the desired output
My request:
$inputData = array(
'METHOD' => 'CreateRecurringPaymentsProfile',
'TOKEN' => $_GET['token'], //get from GetExpressCheckout
'PAYERID' => $billerInfo['PAYERID'], //from GetExpressCheckout response
'PROFILESTARTDATE' => date("Y-m-d h:i:s", strtotime("+5 seconds")), //2012-05-11T00:00:00Z #Billing date start, in UTC/GMT format
'DESC' => 'LeaveBuddy: subscription amount is $' . $bill .' for the provided service ($12 per user per year).', //#Profile description - same as billing agreement description
'BILLINGPERIOD' => 'Year', #Period of time between billings
'BILLINGFREQUENCY' => 1,#Frequency of charges
'AMT' => 10, //Todo: dynamically calculate the amt #The amount the buyer will pay in a payment period
'CURRENCYCODE' => 'USD',#The currency, e.g. US dollars
'COUNTRYCODE' => 'US',#The country code, e.g. US
'MAXFAILEDPAYMENTS' => '0',#Maximum failed payments before suspension of the profile
'PROFILEREFERENCE' => 'companyid=1', //my custom value
);
The response that I am getting is:
{"InstantPaymentNotification":{"id":"553db30b-ea1c-4f68-8b5d-4fe5cbdd56cb","notify_version":"3.8","verify_sign":"A--8MSCLabuvN8L.-MHjxC9uypBtAQZom1C7.mbS1Jv-J898ZO0eeOr9","test_ipn":"1","address_city":null,"address_country":null,"address_country_code":null,"address_name":null,"address_state":null,"address_status":null,"address_street":null,"address_zip":null,"first_name":"code","last_name":"booster","payer_business_name":null,"payer_email":"codebooster#gmail.com","payer_id":"XXXXXXXX","payer_status":"verified","contact_phone":null,"residence_country":"US","business":null,"item_name":null,"item_number":null,"quantity":null,"receiver_email":"boom#gmail.com","receiver_id":null,"custom":null,"invoice":null,"memo":null,"option_name1":null,"option_name2":null,"option_selection1":null,"option_selection2":null,"tax":"0.00","auth_id":null,"auth_exp":null,"auth_amount":null,"auth_status":null,"num_cart_items":null,"parent_txn_id":null,"payment_date":null,"payment_status":null,"payment_type":null,"pending_reason":null,"reason_code":null,"remaining_settle":null,"shipping_method":null,"shipping":"0.00","transaction_entity":null,"txn_id":"316859739","txn_type":"recurring_payment","exchange_rate":null,"mc_currency":null,"mc_fee":null,"mc_gross":10,"mc_handling":null,"mc_shipping":null,"payment_fee":null,"payment_gross":null,"settle_amount":null,"settle_currency":null,"auction_buyer_id":null,"auction_closing_date":null,"auction_multi_item":null,"for_auction":null,"subscr_date":null,"subscr_effective":null,"period1":null,"period2":null,"period3":null,"amount1":null,"amount2":null,"amount3":null,"mc_amount1":null,"mc_amount2":null,"mc_amount3":null,"recurring":null,"reattempt":null,"retry_at":null,"recur_times":null,"username":null,"password":null,"subscr_id":null,"case_id":null,"case_type":null,"case_creation_date":null,"created":"2015-04-27 03:54:51","modified":"2015-04-27 03:54:51"},"PaypalItem":[]}
So i cannot find any [rp_invoice_id] parameter here, and my invoice is also appearing null. Can any one tell me what I am missing?

PayPal Express Checkout Shipping Address should not be editable

I have already spent a lot of hours to find an answer for my problem but unfortunately i can't find a soloution.
I implement PayPal (Express Checkout) in our Shop-System. In our shop, the customer enters his shipping address. I don't want the customer to get the option to change his shipping address in PayPal. I only want the shipping address to be displayed which was entered before.
For example, here is an express checkout implementation like I want it:
Shipping Address only displayed:
How can i make this possible?
I use the PayPalSDK for ASP.NET
In your SetExpressCheckout request you can add the ADDROVERRIDE parameter and set its value to 1. Then make sure to include the shipping address parameters in your SEC request as well.
What this will do is simply display the address you pass over to PayPal without the ability for the user to change it.
The value 1 indiciates that the PayPal pages should display the
shipping address set by you in the SetExpressCheckout request, not the
shipping address on file with PayPal. This does not allow the
customer to edit the address here. Must be 1 or 0
Here's a sample of an SEC request I just sent to the PayPal sandbox:
[REQUESTDATA] => Array
(
[USER] => *****
[PWD] => *****
[VERSION] => 97.0
[BUTTONSOURCE] => AngellEYE_PHPClass
[SIGNATURE] => *****
[METHOD] => SetExpressCheckout
[MAXAMT] => 200.00
[RETURNURL] => http://paypal.angelleye.com/standard/samples/DoExpressCheckoutPayment.php
[CANCELURL] => http://paypal.angelleye.com/paypal/class/cancel.php
[REQCONFIRMSHIPPING] => 0
[NOSHIPPING] => 1
[ALLOWNOTE] => 1
[ADDROVERRIDE] => 1
[BRANDNAME] => Angell EYE
[CUSTOMERSERVICENUMBER] => 555-555-5555
[BUYEREMAILOPTIONENABLE] => 1
[SURVEYENABLE] => 1
[BUYERREGISTRATIONDATE] => 2012-07-14T00:00:00Z
[PAYMENTREQUEST_0_AMT] => 100.00
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_ITEMAMT] => 80.00
[PAYMENTREQUEST_0_SHIPPINGAMT] => 15.00
[PAYMENTREQUEST_0_TAXAMT] => 5.00
[PAYMENTREQUEST_0_DESC] => This is a test order.
[PAYMENTREQUEST_0_SHIPTONAME] => Tester Testerson
[PAYMENTREQUEST_0_SHIPTOSTREET] => 123 Test Ave.
[PAYMENTREQUEST_0_SHIPTOCITY] => Kansas City
[PAYMENTREQUEST_0_SHIPTOSTATE] => MO
[PAYMENTREQUEST_0_SHIPTOZIP] => 64111
[PAYMENTREQUEST_0_SHIPTOCOUNTRY] => US
[PAYMENTREQUEST_0_SHIPTOPHONENUM] => 816-555-5555
[PAYMENTREQUEST_0_NOTETEXT] => This is a test note before ever having left the web site.
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[L_PAYMENTREQUEST_0_NAME0] => Widget 123
[L_PAYMENTREQUEST_0_DESC0] => Widget 123
[L_PAYMENTREQUEST_0_AMT0] => 40.00
[L_PAYMENTREQUEST_0_NUMBER0] => 123
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_ITEMURL0] => http://www.angelleye.com/products/123.php
[L_PAYMENTREQUEST_0_NAME1] => Widget 456
[L_PAYMENTREQUEST_0_DESC1] => Widget 456
[L_PAYMENTREQUEST_0_AMT1] => 40.00
[L_PAYMENTREQUEST_0_NUMBER1] => 456
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_ITEMURL1] => http://www.angelleye.com/products/456.php
[L_PAYMENTREQUEST_0_ITEMCATEGORY1] => Digital
)
And here's what I see when I log in to PayPal as the buyer after this SEC call...

paypal ipn payment_status processed vs completed

I am new to paypal integration and doing ipn integration right now.
I am a little confused regarding payment_status processed and completed values according to their site.
Completed: The payment has been completed, and the funds have been
added successfully to your account balance.
Processed: A payment has been accepted.
Dont really get this?
here are my questions
if it sends an ipn with payment status processed, will it send
another ipn with payment status completed?
when does it send a processed ipn and when does it send a completed
ipn?
for which status should you consider a item(s) paid for? completed or processed?
thanks in advance
I'm pretty sure the only time you'd see processed is if you send a payment to an account that doesn't exist yet, or if you send to an account where they have their settings configured to have them accept any payments they receive.
In such a case, when the payment takes place it will have a "status_n" of "unclaimed" and the payment_status would be processed. Note that the n would be the number of the payment in cases where you had more than 1. For example, with MassPay. In fact, here's a sample I was able to find in my IPN logs...
txn_type = masspay
payment_gross_1 = 1500.00
payment_date = 09:52:38 Dec 23, 2012 PST
last_name = Angell
mc_fee_1 = 1.00
masspay_txn_id_1 = 9N3213015V198645H
receiver_email_1 = info#acexlogics.com
residence_country = US
verify_sign = AueDyRcHXo48zG3juE2C-Z801Wi9AhrDKrUI2Dxtkt8T9UVV4DHECvEC
payer_status = verified
test_ipn = 1
payer_email = sandbo_1215254764_biz#angelleye.com
first_name = Drew
payment_fee_1 = 1.00
payer_id = ATSCG2QMC9KAU
payer_business_name = Drew Angell's Test Store
payment_status = Processed
status_1 = Unclaimed
mc_gross_1 = 1500.00
charset = windows-1252
notify_version = 3.7
mc_currency_1 = USD
unique_id_1 = 3
ipn_track_id = a8817fe5573f3
This particular IPN was from a MassPay request that included only a single receiver. It came back as "processed" and "unclaimed" because the receiver_email didn't have an existing PayPal account yet.
Here's a separate IPN for a MassPay request that included 3 receivers and all had accounts, so they all came back as completed.
[payer_id] => ATSCG2QMC9KAU
[payment_date] => 21:37:28 Jan 01, 2013 PST
[payment_gross_1] => 10.00
[payment_gross_2] => 10.00
[payment_gross_3] => 10.00
[payment_status] => Processed
[receiver_email_1] => andrew_1342623385_per#angelleye.com
[receiver_email_2] => usb_1329725429_biz#angelleye.com
[charset] => windows-1252
[receiver_email_3] => andrew_1277258815_per#angelleye.com
[mc_currency_1] => USD
[masspay_txn_id_1] => 53E82259BP7975932
[mc_currency_2] => USD
[masspay_txn_id_2] => 4AS03088H50506411
[mc_currency_3] => USD
[masspay_txn_id_3] => 6A492363UM676994C
[first_name] => Drew
[unique_id_1] =>
[notify_version] => 3.7
[unique_id_2] =>
[unique_id_3] =>
[payer_status] => verified
[verify_sign] => A2Kn5CkYqzBOhX.t-MhTsUEnQbXNAs-mp6LyPmPY1bKAQnyPlKUqiOZN
[payer_email] => sandbo_1215254764_biz#angelleye.com
[payer_business_name] => Drew Angell's Test Store
[last_name] => Angell
[status_1] => Completed
[status_2] => Completed
[status_3] => Completed
[txn_type] => masspay
[mc_gross_1] => 10.00
[mc_gross_2] => 10.00
[mc_gross_3] => 10.00
[payment_fee_1] => 0.20
[residence_country] => US
[test_ipn] => 1
[payment_fee_2] => 0.20
[payment_fee_3] => 0.20
[mc_fee_1] => 0.20
[mc_fee_2] => 0.20
[mc_fee_3] => 0.20
[ipn_track_id] => e1938454f1e98
I don't have time to setup a scenario where the account doesn't exist and is then created and accepted, but I'm fairly certain you would indeed get another IPN showing it was completed.
Long story short, I would make sure to look for "completed" as oppose to "processed" when handling post-payment processing.

paypal IPN get buyer transaction ID

I need the buyer transaction ID that correspond to the transaction PayPal notifies me by IPN.
I'm using
$_POST['txn_id']
but this stores the transaction ID for the seller, not the transaction ID of the buyer. At the same time the buyer hasn't access to the transaction ID of the seller.
I understand that PayPal assign two different transactions ID, but the seller needs to stores the buyer transaction ID in order to be able to communicate with the user about an specific transaction.
Anyone know how I can receive (or search for) the buyer transaction ID when PayPal send a notification to my IPN script?
I only receive the follow data:
Array
(
[mc_gross] => 7.00
[protection_eligibility] => Ineligible
[payer_id] => F6912JHUIIHA
[tax] => 0.00
[payment_date] => 10:14:55 Sep 11, 2011 PDT
[payment_status] => Completed
[charset] => windows-1252
[first_name] => Name
[mc_fee] => 2.08
[notify_version] => 3.2
[custom] =>
[payer_status] => verified
[business] => myemail#gmail.com
[quantity] => 1
[verify_sign] => 123232jh4i32u4u3h5n435i43u5455645
[payer_email] => payermail#gmail.com
[txn_id] => 123u4324324yuy4574
[payment_type] => instant
[btn_id] => 35428120
[last_name] => lastname
[receiver_email] => receiver#gmail.com
[payment_fee] => 2.08
[shipping_discount] => 0.00
[insurance_amount] => 0.00
[receiver_id] => OIUWDWUERWEU
[txn_type] => web_accept
[item_name] => Product name
[discount] => 0.00
[mc_currency] => USD
[item_number] => PRODNum
[residence_country] => SE
[handling_amount] => 0.00
[shipping_method] => Default
[transaction_subject] => Product to sell
[payment_gross] => 7.00
[shipping] => 0.00
[ipn_track_id] => ydedi23484rl4itm54oi
)
From the looks of the list of variables paypal sends back, there is no buyer transaction id.
Another option:
Usually when you send your order information to paypal, you can include an invoice/order number, the buyer, if needed, is able to search his history by your invoice number (the same way they would search by transaction id) if you include it when you send the info to paypal.
You can use the GetTransactionDetails API and pass in the buyer's transaction ID.
A sample API call would be:
METHOD=GetTransactionDetails&
TRANSACTIONID=buyers transaction ID&
See also: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails