I am working on a website to sell PDF's online, where user can get the download link by email after paying through paypal.
What could be the possible paypal payment status values for the above scenario?
I can only think of Complete
& InComplete
. Does using Processing
make sense here?
The payment status represents the last action that was submitted on a payment.
Stripe sends the payment_intent. succeeded event when payment is successful and the payment_intent. payment_failed event when payment isn't successful. When payment is unsuccessful, you can find more details by inspecting the PaymentIntent's last_payment_error property.
If the order status is “Pending”, your order has been received by the seller, but your payment has not yet been processed. For most purchases, the seller will complete the payment within a few days of receiving the order.
Before developing, you should make yourself familiar with PayPal IPN and PDT concept. Read the documentation of IPN and PDT Variables. Here is the payment status possibilities from that document page:
payment_status
The status of the payment:
Canceled_Reversal: A reversal has been canceled. For example, you won a dispute with the customer, and the funds for the transaction that was reversed have been returned to you. Completed: The payment has been completed, and the funds have been added successfully to your account balance. Created: A German ELV payment is made using Express Checkout. Denied: You denied the payment. This happens only if the payment was previously pending because of possible reasons described for the pending_reason variable or the Fraud_Management_Filters_x variable. Expired: This authorization has expired and cannot be captured. Failed: The payment has failed. This happens only if the payment was made from your customer’s bank account. Pending: The payment is pending. See pending_reason for more information. Refunded: You refunded the payment. Reversed: A payment was reversed due to a chargeback or other type of reversal. The funds have been removed from your account balance and returned to the buyer. The reason for the reversal is specified in the ReasonCode element. Processed: A payment has been accepted. Voided: This authorization has been voided.
The most common status that I usually get is Completed
and Pending
. Common cause of Pending
is the usage of different currency between buyer and seller, e.g: You sell in USD, buyer pay with GBP, PayPal will mark the transaction as Pending and it will be cleared after a few day. One of my client want me to handle Pending
same as Completed
, since he just sell digital goods (PDF file) and possess no risk if the payment is delayed, unlike merchant with physical goods.
You can get complete PayPal documentation in this page.
It should be noted that the payment_status
variable used to just be st
. Paypal has apparently changed the st
variable to payment_status
.
https://developer.paypal.com/docs/api/payments/v1/
state enum The state of the payment, authorization, or order transaction. Value is:
created. The transaction was successfully created.
approved. The customer approved the transaction. The state changes from created to approved on generation of the sale_id for sale transactions, authorization_id for authorization transactions, or order_id for order transactions.
failed. The transaction request failed.
Read only.
Possible values: created, approved, failed.
enter image description here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With