in \Drupal\commerce_amazon_lpa\AmazonPay::authorize we need to fix this todo item.

// @todo Find out how long an authorization is valid, set its expiration.

Authorizations are good for 30 days. https://pay.amazon.com/us/developer/documentation/lpwa/201953790

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Issue summary: View changes
mglaman’s picture

mglaman’s picture

Priority: Normal » Major
czigor’s picture

Status: Active » Needs review
StatusFileSize
new716 bytes
czigor’s picture

StatusFileSize
new697 bytes
new495 bytes

Fix condition.

mglaman’s picture

According to the docs,

An authorization is only valid for a particular time period, which is specified in the response of the operation

The AuthorizationDetails in the response has ExpirationTimestamp which defines when it expires. To be honest, we didn't respect this in the 1.x branch. But it is probably best to do it right this time around, and then we can open a follow up for the 1.x branch.

https://pay.amazon.com/us/developer/documentation/apireference/201752010...
https://pay.amazon.com/us/developer/documentation/apireference/201752450

czigor’s picture

Fixed the patch to use the ExpirationTimestamp instead.

mglaman’s picture

Works perfectly, thanks!

  • mglaman committed b101b58 on 8.x-2.x authored by czigor
    Issue #2910913 by czigor: Set expiration time on authorizations
    
mglaman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.