paypal ipn payment_status processed vs completed - paypal

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.

Related

Recurring payment payflow error response "Invalid tender"

I am trying to create recurring profile and I get his log output with error
[METHOD] => CreateRecurringPaymentsProfile
[SUBSCRIBERNAME] => testuser
[PROFILESTARTDATE] => 2014-05-14T16:01:36-04:00
[DESC] => Monthly Payment for Package:Package 4
[MAXFAILEDPAYMENTS] => 1
[AUTOBILLOUTAMT] => NoAutoBill
[TRIALBILLINGPERIOD] => Month
[TRIALBILLINGFREQUENCY] => 1
[TRIALTOTALBILLINGCYCLES] => 1
[TRIALAMT] => 129.00
[BILLINGPERIOD] => Month
[BILLINGFREQUENCY] => 12
[TOTALBILLINGCYCLES] => 0
[AMT] => 129.00
[CURRENCYCODE] => USD
[CREDITCARDTYPE] => MasterCard
[ACCT] => 5473878247587096
[EXPDATE] => 012015
[CVV2] => 962
[STARTDATE] =>
[ISSUENUMBER] =>
[FIRSTNAME] => John
[LASTNAME] => Doe
[STREET] => 1324 Adams Street
[CITY] => Omaha
[STATE] => AL
[COUNTRYCODE] => US
[ZIP] => 68138
[PHONENUM] => 1402935200
[L_PAYMENTREQUEST_0_L_ITEMCATEGORY0] => Digital
[L_PAYMENTREQUEST_0_L_NAME0] => Package 4
[L_PAYMENTREQUEST_0_L_DESC0] => test package
[L_PAYMENTREQUEST_0_L_AMT0] => 129.00
[L_PAYMENTREQUEST_0_L_NUMBER0] => 4
[L_PAYMENTREQUEST_0_L_QTY0] => 3500
RESULT=2&PNREF=A7X06BD15AD4&RESPMSG=Invalid tender.
The description suggests that merchant account does not support said credit card.But in my manager.paypal.com account I see visa/master and other credit cards are supported. I tried with visa/master , for both I get same error. May be I missing something, please help out.
I have paypal payments advanced subscription.
Sounds like maybe you're signed up for Payments Pro, but not for Recurring Payments, which is an add-on feature.
According to the PayPal PayFlow API documentation, receiving a result with the status "2" means:
Invalid tender type. Your merchant bank account does not support the
following credit card type that was submitted.
Source: https://developer.paypal.com/docs/classic/payflow/integration-guide/#result-values-and-respmsg-text

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 response missing tax

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.

PAYPAL IPN custom field missing

I'm facing troubles implementing paypal recurring payment with the API process and the sandbox.
I succeed to create the subscription button and redirect the user to the paypal express checkout page.
But the custom field is missing in some IPN generated by paypal and I really need this field.
Here are the requests I send while generating the subscription button:
METHOD=SetExpressCheckout
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&PAYMENTREQUEST_0_AMT=5.00
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&RETURNURL=http%3A%2F%2Fwww.myWebSite.com?ok
&CANCELURL=http%3A%2F%2Fwww.myWebSite.com?ko
&L_BILLINGTYPE0=RecurringPayments
&L_BILLINGAGREEMENTDESCRIPTION0=test+paypal
&REQCONFIRMSHIPPING=0
&NOSHIPPING=1
&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
&L_PAYMENTREQUEST_0_NAME0=test+paypal
&L_PAYMENTREQUEST_0_AMT0=5.00
&L_PAYMENTREQUEST_0_QTY0=1
&PAYMENTREQUEST_0_CUSTOM=custom_var1%3Dvalue1%7Ccustom_var2%3Dvalue2
After the user has confirmed the transaction, he is coming back to my website and I have to verify the informations and to create the recurring profil.
Here are the requests I do :
METHOD=GetExpressCheckoutDetails
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&TOKEN=theToken
METHOD=CreateRecurringPaymentsProfile
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&TOKEN=theToken
&AMT=5.00
&CURRENCYCODE=EUR
&PROFILESTARTDATE=2013-02-04T15%3A16%3A24%2B01%3A00
&BILLINGPERIOD=Day
&BILLINGFREQUENCY=1
&DESC=test+paypal
METHOD=DoExpressCheckoutPayment
&VERSION=94.0
&PWD=123456
&USER=myEmail#biz.com
&SIGNATURE=mySignature
&TOKEN=theToken
&PAYERID=JZUVX4TAHRHRU
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_AMT=5.00
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&PAYMENTREQUEST_0_NOTIFYURL=http%3A%2F%2Fwww.myWebSite.com?notify
&PAYMENTREQUEST_0_CUSTOM=custom_var1%3Dvalue1%7Ccustom_var2%3Dvalue2
After doing this I receive these IPN :
Array
(
[transaction_subject] => test paypal
[payment_date] => 06:01:52 Feb 04, 2013 PST
[txn_type] => express_checkout
[last_name] => numerik
[residence_country] => FR
[item_name] =>
[payment_gross] =>
[mc_currency] => EUR
[payment_type] => instant
[protection_eligibility] => Ineligible
[verify_sign] => myVerifySign
[payer_status] => verified
[test_ipn] => 1
[tax] => 0.00
[payer_email] => myEmail#per.com
[txn_id] => 6XC11065S3796804E
[quantity] => 1
[receiver_email] => myEmail#biz.com
[first_name] => buyer
[payer_id] => myPayerId
[receiver_id] => myReceiverId
[item_number] =>
[handling_amount] => 0.00
[payment_status] => Completed
[payment_fee] =>
[mc_fee] => 0.42
[shipping] => 0.00
[mc_gross] => 5.00
[custom] => custom_var1=value1|custom_var2=value2
[charset] => windows-1252
[notify_version] => 3.7
[ipn_track_id] => ab76ea3421261
)
Array
(
[payment_cycle] => Daily
[txn_type] => recurring_payment_profile_created
[last_name] => numerik
[next_payment_date] => 02:00:00 Feb 04, 2013 PST
[residence_country] => FR
[initial_payment_amount] => 0.00
[currency_code] => EUR
[time_created] => 06:01:47 Feb 04, 2013 PST
[verify_sign] => myVerifySign
[period_type] => Regular
[payer_status] => verified
[test_ipn] => 1
[tax] => 0.00
[payer_email] => myEmail#per.com
[first_name] => buyer
[receiver_email] => myEmail#biz.com
[payer_id] => myPayerId
[product_type] => 1
[shipping] => 0.00
[amount_per_cycle] => 5.00
[profile_status] => Active
[charset] => windows-1252
[notify_version] => 3.7
[amount] => 5.00
[outstanding_balance] => 0.00
[recurring_payment_id] => myRecurringPaymentId
[product_name] => test paypal
[ipn_track_id] => a8adfdf8b61d3
)
As you can see in the 1st IPN the field custom is available but not in the second one.
Does anyone know what I'm missing for retrieving the custom field in the 2nd IPN ?
Your DoExpressCheckoutPayment request includes the custom parameter which is why you're getting it back for that transaction. Your CreateRecurringPaymentsProfile request does not have a custom parameter included, so it would not come back.
That said, it doesn't look like the custom parameter is available to CRPP so you'll need to save your data locally and include your local record ID in the PROFILEREFERENCE paramter of your CRPP request. This way it will come back in IPN as rp_invoice_id like Matt Cole suggested, and you can pull your custom data back out of your database using that record ID accordingly.
Your best bet is to add PROFILEREFERENCE to your CreateRecurringPaymentsProfile call. It will come back in the IPN as rp_invoice_id.

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