Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  1. if it sends an ipn with payment status processed, will it send another ipn with payment status completed?
  2. when does it send a processed ipn and when does it send a completed ipn?
  3. for which status should you consider a item(s) paid for? completed or processed?

thanks in advance

like image 759
Ahmed-Anas Avatar asked Jan 01 '13 07:01

Ahmed-Anas


1 Answers

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 = [email protected]
residence_country = US
verify_sign = AueDyRcHXo48zG3juE2C-Z801Wi9AhrDKrUI2Dxtkt8T9UVV4DHECvEC
payer_status = verified
test_ipn = 1
payer_email = [email protected]
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] => [email protected]
[receiver_email_2] => [email protected]
[charset] => windows-1252
[receiver_email_3] => [email protected]
[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] => [email protected]
[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.

like image 103
Drew Angell Avatar answered Nov 11 '22 15:11

Drew Angell