Payment-method icon

Ratepay Component

Add Ratepay to an existing Components integration.

Our Ratepay Component renders Ratepay in your payment form, and collects the required payment information from the shopper.

When making a Ratepay payment, you also need to:

  1. Collect shopper details, and specify these in your payment request.
  2. Provide information about the purchased items by specifying lineItems in your payment request.
  3. Using Ratepay's device fingerprinting,calculate the shopper's device fingerprint, and specify it in your payment request. Ratepay uses the fingerprint for risk evaluation.
  4. Capture the payment after the goods have been sent. This triggers the invoice to be sent to the shopper by the merchant.

Requirements

Requirement Description
Integration type Make sure that you have an existing Web Components integration.
Setup steps Before you begin, add Ratepay in your test Customer Area.

Import resources for v6

If you are using Web Components v6, import the Component that you need for Ratepay:

import { AdyenCheckout, RatePay } from '@adyen/adyen-web'

Show Ratepay in your payment form

To present the Ratepay Component in your payment form:

  1. From your server, make a POST /paymentMethods request and specify one of the following combinations of countryCode and amount.currency:

    Country/region countryCode amount.currency
    Austria AT EUR
    Germany DE EUR
    The Netherlands
    v3.22.1 or later
    NL EUR
    Switzerland CH CHF

    The response contains supported payment method types:

    Payment Method paymentMethod.type
    Ratepay Open invoice ratepay
    Ratepay Direct debit
    v5.13.0 or later
    ratepay_directdebit
  2. Pass the full response from the /paymentMethods call as the paymentMethodsResponse object when creating an instance of the AdyenCheckout.

  3. Add the Ratepay Component:

    a. Create a DOM element for Ratepay, placing it where you want the form to be rendered:

    <div id="ratepay-container"></div>

    b. Create an instance of the Ratepay Component, and mount it. You can also include optional configuration for the visibility of the following shopper input fields:

    • personalDetails: Shopper name, date of birth, phone number, and email address.
    • billingAddress: The address where to send the invoice.
    • deliveryAddress: The address where the goods should be delivered.

    If you remove the above-mentioned fields from the configuration, you will need to collect this information and then provide it in your /payments request. For information on the required fields, refer to Make a payment.

    Here's an example of creating an instance of the Ratepay Component with various configuration options.

    const ratepay = checkout.create("ratepay", { // For Ratepay Direct Debit, use "ratepay_directdebit".
      countryCode: "NL", // the country code from the
                        // `/paymentMethods` request
      visibility: { // Optional configuration
          personalDetails: "hidden", // These fields will not appear on the payment form.
          billingAddress: "readOnly", // These fields will appear on the payment form,
                                      //but the shopper cannot edit them.
          deliveryAddress: "editable" //These fields will appear on the payment form,
                                      // and the shopper can edit them.
                                      //This is the default behavior.
      }
    }).mount('#ratepay-container');;
    

Calculate the device fingerprint

Before making a payment you need to implement Ratepay's device fingerprinting. Send the calculated device fingerprint when making a /payments request.

Make a payment

When the shopper selects to pay, the Component calls the onSubmit event, which contains a state.data. If state.isValid is true, collect the state.data and pass this to your server.

From your server, make a /payments request, including the following parameters:

The following example shows how to make a payment request for EUR 10.

The /payments response contains:

  • (Only for Open Invoice payments) additionalData.openinvoicedata.descriptor: The purpose of the payment which you should print on the invoice. The shopper provides it when making a bank transfer, so Ratepay can match the payment to the transaction.
  • resultCode: Use this to present the payment result to your shopper.
  • pspReference: Our unique reference for the payment.
  • merchantReference: Your reference from the /payments request.

Present the payment result

Use the  resultCode that you received in the /payments response to present the payment result to your shopper.

The resultCode values you can receive for Ratepay are:

resultCode Description Action to take
Authorised The payment was successfully authorised. Inform the shopper that the payment was successful. You can also add a message, for example: Thank you for your order. Your purchase order number is XYZ.
After the goods have been sent, you also need to capture the payment.
Cancelled The shopper cancelled the payment. Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.
Refused The payment was refused by Ratepay. Ask the shopper to try the payment again using a different payment method.

Capture the payment

This section only applies to Ratepay Open invoice.

After the goods have been sent, you also need to capture the payment. All Ratepay Open invoice payments must be manually captured, even if you have enabled automatic capture for other payment methods. Capturing the payment is what triggers the invoice to be sent to the shopper.

Partial captures

To partially capture a Ratepay Open invoice payment, specify in your /capture request:

  • modificationAmount: The amount that the shopper should pay. 
  • additionalData.openinvoicedata: Price and product information for the items that the shopper should pay for.

Although the field names are different, the information in additionalData.openinvoicedata is the same as what you provided in lineItems when making a /payments request:

openinvoicedata lineItems Description
itemAmount amountExcludingTax The price for one item, without the tax, in minor units.
itemVatAmount taxAmount The tax amount for one item, in minor units.
itemVatPercentage taxPercentage The tax percentage, in minor units.

The following example shows how to make a partial capture request if the shopper only kept one pair of socks from the two included in the original payment request.

Any unclaimed amount that is left after partially capturing a payment should be manually cancelled.

To set up multiple partial captures, contact our Support Team. Multiple partial captures will create a new invoice for each capture.

Refunds and cancellations

If a Ratepay payment has not yet been captured, you can cancel it. If the Ratepay payment has already been captured and you want to return the funds to the shopper, you need to refund it.

Partial refunds

To partially refund a Ratepay payment, specify in your /payments/{paymentPspReference}/refunds request:

  • modificationAmount: The amount to be refunded to the shopper.
  • additionalData.acquirerReference: The acquirerReference of the capture. This is needed if there are multiple partial captures available for the payment. When refunding in your Customer Area, you can add the acquirerReference manually as well.
  • (Only for Open invoice payments)additionalData.openinvoicedata: Price and product information about the returned items.

Although the field names are different, the information in additionalData.openinvoicedata is the same as what you provided in lineItems when making a /payments request:

openinvoicedata lineItems Description
itemAmount amountExcludingTax The price for one item, without the tax, in minor units.
itemVatAmount taxAmount The tax amount for one item, in minor units.
itemVatPercentage taxPercentage The tax percentage, in minor units.

The following example shows how to make a partial refund request if the shopper returned the shoes included in the original payment request.

Test and go live

Before you can accept live Ratepay payments, you need to submit a request for Ratepay in your live Customer Area, and provide us your Ratepay live credentials.

Ratepay provides detailed error codes as well as test data and recommendations on how to test some of the most common scenarios.

You can check the status of the test payments in your Customer Area > Transactions > Payments.

See also