Store payment details

A recurring contract is created along with a payment request, similar to a regular payment request, except the below fields to be provided in the payment session HPP form or in the API request. If the payment is successful, the details are stored, and the recurringDetailReference is created. Set the recurringProcessingModel to Subscription for payments that recur on a fixed schedule, and Card On File for payments that do not occur on a fixed schedule.

For more information on available fields, refer to PaymentRequest.

Always provide a unique shopperReference parameter for every shopper. Note that you can store maximum 50 card details associated with the same shopperReference value.

Request

The following code examples show the creation of recurring contracts together with a payment request using /authorise endpoint in JSON, SOAP, and cURL.

{
   "amount":{
      "value":2000,
      "currency":"EUR"
   },
   "card":{
      "number":"4111111111111111",
      "expiryMonth":"8",
      "expiryYear":"2018",
      "cvc":"737",
      "holderName":"John Smith"
   },
   "reference":"Your Reference Here",
   "merchantAccount":"TestMerchant",
   "shopperEmail":"s.hopper@test.com",
   "shopperIP":"61.294.12.12",
   "shopperReference":"Simon Hopper",
   "recurring":{
      "contract":"RECURRING,ONECLICK"
   }
}
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
  <soap:Body>
    <ns1:authorise xmlns:ns1="http://payment.services.adyen.com">
      <ns1:paymentRequest>
        <amount xmlns="http://payment.services.adyen.com">
          <value xmlns="http://common.services.adyen.com">2000</value>
          <currency xmlns="http://common.services.adyen.com">EUR</currency>
        </amount>
        <card xmlns="http://payment.services.adyen.com">
          <cvc>737</cvc>
          <expiryMonth>08</expiryMonth>
          <expiryYear>2018</expiryYear>
          <holderName>Adyen Test</holderName>
          <number>4111111111111111</number>
        </card>
        <merchantAccount xmlns="http://payment.services.adyen.com" >SupportAdyenTest</merchantAccount>
        <reference xmlns="http://payment.services.adyen.com">Your Reference Here</reference>
        <shopperEmail xmlns="http://payment.services.adyen.com">s.hopper@test.com</shopperEmail>
        <shopperIP xmlns="http://payment.services.adyen.com">61.294.12.12</shopperIP>
        <shopperReference xmlns="http://payment.services.adyen.com">Simon Hopper</shopperReference>
        <recurring>
          <contract>RECURRING,ONECLICK</contract>
        </recurring>
      </ns1:paymentRequest>
    </ns1:authorise>
  </soap:Body>
</soap:Envelope>
curl https://pal-test.adyen.com/pal/servlet/Payment/v30/authorise \
 -d amount.value=2000 \
 -d amount.currency=EUR \
 -d card.number=4111111111111111 \
 -d card.expiryMonth=08 \
 -d card.expiryYear=2018 \
 -d card.cvc=737 \
 -d card.holderName=John+Smith \
 -d reference=Your+Reference+Here \
 -d merchantAccount=TestMerchant \
 -d shopperEmail=s.hopper%40test.com \
 -d shopperIP=61.294.12.12 \
 -d shopperReference=Simon+Hopper \
 -d recurring.contract=RECURRING,ONECLICK

When you are ready to process a subsequent payment, set the value of the selectedRecurringDetailReference to either:

  • The recurringDetailReference returned from the list of all stored recurring details based on the shopperReference provided during the recurring contract.

  • The word "LATEST", which uses a recent recurring detail.

On AUTHORISATION you receive a notification with success=”true”.