Paypal-checkout-components: Add the ability to set the immediate payment expiration time

Created on 19 Mar 2017  路  8Comments  路  Source: paypal/paypal-checkout-components

I'm using the Express Checkout flow with the advanced server integration.

So I reserve items in real time once user has clicked the "Checkout" button and wait for the success\fail response. User can just close the browser tab and it will look like a long payment process (there is no way for the JS code to call the onCancel handler).

So it looks like I don't know if user has closed the browser or just fell asleep. Problem that I can't wait too long (more than ~5 mins) and I want to cancel the payment after this time. And it seems that I can't cancel the Payment myself. So user can come back and pay after N minutes (N > 5) for the item which has been un-reserved and is already out of stock.

This answer says:

user has three hours to approve of the PayPal payment

  1. Answer about 3 hours is a bit old so do we have any fresh DOCS about the immediate payment lifetime? Is it still 3 hours for the REST Express Checkout flow?
  2. 3 hours is too long period for me. Is there a way to setup the expiration time or timeout for the payment during creation?
  3. Is there a way to cancel the Payment? Payments API has no reference about it.

Original: http://stackoverflow.com/questions/42614394/paypal-immediate-payment-intent-sale-expiration-time

Most helpful comment

Those payments expire after some time. No money is moved until you call execute, so long as you prevent execute calls for old transactions, you should be ok.

All 8 comments

You can do a GET on the PAY-XXXX id.

https://developer.paypal.com/docs/api/payments/#payment_get

The response comes with a create_time field. You should be able to check the delta from create_time -> now, and if it's > 5 minutes, don't accept the PAY-XXXX id / cancel the transaction in your database.

Does that work for your use case?

Those payments expire after some time. No money is moved until you call execute, so long as you prevent execute calls for old transactions, you should be ok.

As I remember - I receive the create_time during payment creation. And I can manage all the internal stuff myself (orders, reservations, etc). And I can even do nothing on the onAuthorize handler and don't execute the payment (_with some notification to the client_). One question - what will be with the payments which have been created and authorized but haven't been executed?

Did that answer your question?

Thank you! Sorry for the comment deleting. It was a work account) Do you want me to delete the issue? Or leave it for other guys?

It's ok, please leave the issue so other people can see the solution. I'll just close it if your question is answered. Thanks!

Do you want to answer on SO and I will mark your questions as answer?

Sure.

Was this page helpful?
0 / 5 - 0 ratings