Page MenuHomePhabricator

Adyen: try to capture an old-style recurring with rest API
Closed, ResolvedPublic

Description

The front-end code will want to call the same approvePayment method used by recurring. Currently approvePayment is written against the SOAP endpoint. Can we rewrite it to use the REST endpoint and still use it for the existing recurring payments?

Event Timeline

Change 702491 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/SmashPig@master] Adyen Checkout: rewrite capture as REST call

https://gerrit.wikimedia.org/r/702491

Ejegg moved this task from Backlog to Review on the Fundraising Sprint Mandatory corn dogs board.

Code is written and tested for the case of capturing new payments, just needs testing against old recurrings.

The tokens created with the new integration are different 8316252611013178 instead of our 1234.5.

From a quick look in the documentation I didn't see anything about not being able to charge old style on the api or anything about converting them though.

Change 702491 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Adyen Checkout: rewrite capture as REST call

https://gerrit.wikimedia.org/r/702491

Change 704627 had a related patch set uploaded (by Cstone; author: Cstone):

[wikimedia/fundraising/SmashPig@master] Add getSavedPaymentDetails

https://gerrit.wikimedia.org/r/704627

There is a paymentMethods call that will return saved details https://docs.adyen.com/online-payments/tokenization/managing-tokens#list-saved-details

I tried it on an older test recurring 1572253496.1 and did get info back:

{
    "brand": "visa",
    "expiryMonth": "03",
    "expiryYear": "2030",
    "holderName": "Jimmy Wales",
    "id": "8415889883960659",
    "lastFour": "0007",
    "name": "VISA",
    "supportedShopperInteractions": [
        "ContAuth"
    ],
    "type": "scheme"
}

I tried to charge that token (the id is the token) and it did go through. I need to test with a couple more older tokens but this looks like a way to move the older recurrings over.