简体   繁体   中英

payment_status in Paypal

I am using Website Payments Standard integration and in PDT I am confused about showing message to customer on return page if transaction fails due to something, but I cant get messages directly as a response from Paypal , rather I get codes. I was thinking to create a function that will take code as a Parameter and return Error Message. I went here and read about payment_status variable. I got confused when I saw same variable can can set to 1 value off 11 at one place and off 3 at another. What exactly it will return in my scenario? 1 off 3 or 1 off 11?

Edit See that variable under Mass Pay Variables and Payment Information Variables in this link .

The payment_status would be various things depending on the txn_type. That's why they are separated in categories like that. If you get a txn_type of masspay, then the payment_status would only be 1 of those 3. The majority of the txn_type's will have a payment_status that falls in the list of 11 you mentioned. If you're using a standard button you'll typically follow the information under the Payment Information Variables section.

On another note, make sure you're not using PDT to handle any post-payment processing like updating your database, sending email notifications, etc. Even with Auto-Return enabled there is no guarantee the user will make it back to your return URL, and if they don't, that code will never run.

Instead, you should use IPN to handle such processing, which is very similar to PDT except that it happens separate from the checkout flow altogether. As soon as any transaction takes place on your account PayPal's server will POST data about that transaction to your IPN listener URL. The data will be the same as what you're looking at with PDT, but IPN will always be triggered regardless of whether or not the user makes it back to your site.

IPN will also allow you to correctly handle things like pending payments from e-checks, fraud filters, etc. that would need to clear before you deliver the product. You'll get an IPN when the pending payment takes place, and another IPN when that payment is updated to completed, failed, or whatever.

IPN also allows you to automate tasks based on refunds, disputes, etc. It's a very powerful tool, and again, it's definitely recommended over PDT.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM