amzn / amazon-pay-sdk-ruby

Amazon Pay Ruby SDK
https://pay.amazon.com/developer
Apache License 2.0
59 stars 34 forks source link

SCA automatic payments #21

Open PerkmannM opened 5 years ago

PerkmannM commented 5 years ago

The upcoming PSD2 forces SCA for all our future payments. Based on the docs (https://developer.amazon.com/docs/eu/amazon-pay-automatic/sca-upgrade-merchant-initiated-transactions.html#change-the-process-to-set-up-a-new-billing-agreement),
it states:

If setBillingAgreementDetails returns a constraint, handle them as described in Step 2: Set purchase details and define the purchase of the Amazon Pay and Login with Amazon integration guide. Otherwise, proceed and call the confirmBillingAgreement operation. The confirmBillingAgreement operation requires the following input parameters... and in the example there is a call to client.confirm_order_reference (which is not mentioned in the integration steps for AUTOMATIC PAYMENTS):

require 'pay_with_amazon'

merchant_id = 'YOUR_MERCHANT_ID'
access_key = 'YOUR_ACCESS_KEY'
secret_key = 'YOUR_SECRET_KEY'

client = PayWithAmazon::Client.new(
    merchant_id,
    access_key,
    secret_key,
    sandbox: true,
    currency_code: :eur,
    region: :de
)

client.confirm_order_reference(
    amazon_order_reference_id,
    success_url: 'https://www.test.com/OrderConfirmed',
    failure_url: 'https://www.test.com/OrderFailed'
)

Is client.confirm_order_reference used for automatic payments too? If yes then is amazon_order_reference_id the same as BillingAgreement Id? If not what are the correct steps to be SCA compliant for automatic payments with merchant initiated transactions?

bjguillot commented 5 years ago

We are working on the necessary changes to the Ruby SDK now. We will publish it once we complete testing. There will be new attributes added in the confirm_billing_agreement and set_billing_agreement_details calls.

andreasunterhuber commented 5 years ago

@bjguillot ok, nice! Time is running out ;) SCA will be introduced on September 14. Waiting hard for the update 👍

bjguillot commented 5 years ago

Version 2.5.0 deployed with the SCA changes for automatic payments (billing agreements): https://github.com/amzn/amazon-pay-sdk-ruby/releases/tag/2.5.0