API Reference

Payment (CP) - Adyen: S1F2/AMS1

Card-Present payments done using Adyen terminal/reader hardware.

Overview

This document will outline how to collect card-present payments from using Adyen as the processor and using the Adyen S1F2 or the AMS1 terminals.

Adyen Hardware

The customer will first need to add the Adyen hardware and connect it to their account. This can be done in the payment portal, but it might also be convenient to integrate it into your own software. One reason for this is you will need the ID of the hardware for each call, so at a minimum, you need to get a list of hardware from the API if the customer uses the portal to add the hardware https://quilt-payment-api.readme.io/reference/getreaders-1.

Basic Example

The steps below show a basic example.

Get Payment Intent

You will need to create a payment intent either server side or client-side by calling the Payment CREATE API endpoint. https://quilt-payment-api.readme.io/reference/createpaymentintent-1

// POST /v2/payment/intent
{
    "external_account_id": "account_123456",
    "amount": 12.99,
    "payment_method_types": "card_present",
    "capture_method": "automatic",
    "external_payment_id": "transaction_123456"
}

This will return a result that has a payment_id and you'll need this id to authorize the payment.

Collect Payment (synchronous)

The following API call will contact the terminal and collect payment. Please note that this is a blocking call and will not return until the customer has added payment or cancelled the payment and there is a timeout of 120 seconds. We are working on an asynchronous solution. If you need that solution, you could get this solution working for now and then switch to the async solution when ready.

To request a payment for a specific terminal, call the following endpoint https://quilt-payment-api.readme.io/reference/authpayment-1. Please note that in this case terminal_id is required.

// POST /v2/payment/auth
{
    "external_account_id": "account_123456",
    "payment_id": "pi_12345",
    "external_payment_id", "your_id_for_the_transaction",  
    "terminal_id": "S1F2-1234567890",
}

If this call completes successfully, then the payment is authorized. If the capture_method on the payment intent was "automatic" then this payment will be automatically captured. If it was "manual", then the payment will need to be captured either through the portal or through the capture API.