arjayads
arjayads

Reputation: 571

Amazon Pay - Simultaneous one-time and recurring purchases

We are planning to integrate Amazon Pay to our website that offers subscription & a one-off charge upon signup.

According to Amazon Pay docs, it is possible with extra stuffs must be implemented.

Our problem is we have trouble finding a concrete example combining recurring & one-off charge in the single workflow. We use PHP.

Thanks

Upvotes: 1

Views: 113

Answers (1)

Daniel Lemke
Daniel Lemke

Reputation: 2459

There is a code sample on the developer documentation for recurring payments, that you can adapt for the additional one-off charge.

Essentially, what you do is: if the buyer wants to buy a subscription along with an one-off item, you create a Billing Agreement like described in the code sample linked above. After it has been created (using the ConfirmBillingAgreement API call), you can authorize and capture the desired amount (e.g. the amount for the first month of the subscription + the price of the one-off item).

If the buyer decides during the checkout to drop the subscription, use the CreateOrderReferenceForId API call to create an Order Reference Object out of the Billing Agreement. From here on, it's essentially a regular one-time payment scenario, so you can follow the remaining integration steps described here.

Upvotes: 1

Related Questions