Accept ANCV payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.
Requirements
Requirement | Description |
---|---|
Integration type | Make sure that you have built an API-only integration. |
Setup steps | Before you begin, add ANCV in your test Customer Area. |
Build your payment form for ANCV
Include ANCV as an available payment method in your payment form.
Use the /paymentMethods request to show available payment methods to the shopper. Specify these parameters:
countryCode
: FRamount.currency
: EUR
The response contains paymentMethod.type
: ancv.
We provide a logo for ANCV which you can use on your payment form. For more information, refer to Downloading logos.
Make a payment
When a shopper chooses to pay with ANCV, you need to collect the shopper's ANCV ID and wait for the payment outcome on your website.
In your /payments request, specify:
paymentMethod.type
: ancvpaymentMethod.beneficiaryId
: string - This is the ANCV ID of the shopper collected during the checkout (either email address or 11-digit value).
{ "amount": { "currency": "EUR", "value": 3000 }, "reference": "YOUR_MERCHANT_REFERENCE", "paymentMethod": { "type": "ancv", "beneficiaryId": "SHOPPER_ID" }, "shopperInteraction": "Ecommerce", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "order": { "pspReference": "MLSPNCQ8HXSKGK82", "orderData": "823fh892f8f18f4...148f13f9f3f" } }
The response contains:
resultCode
: Pending - the shopper still needs to complete the payment in the ANCV apporder.orderData
- ignore this value and take the order.orderData from the /payments/details responseaction.paymentData
- payload required as an input for /payments/details request in order to learn about the payment status
{ "pspReference": "JF89C8JSHVTFWR82", "resultCode": "Pending", "order": { "amount": { "currency": "EUR", "value": 3000 }, "expiresAt": "2023-09-15T13:35:33Z", "orderData": "111aa111a1a11a1...123a11a1a1a", "pspReference": "MLSPNCQ8HXSKGK82" }, "action": { "paymentData": "Ab02b...", "paymentMethodType": "ancv", "type": "await" } }
Show the waiting screen
- Show a waiting screen to the shopper, telling them you are waiting for them to complete the payment.
- Once the shopper completes the payment, present the payment result.
Get outcome
To see the payment result, send a request to /payments/details that includes the paymentData
provided in the /payments response.
curl https://checkout-test.adyen.com/checkout/v70/payments/details \ -H 'x-API-key: YOUR_X-API-KEY' \ -H 'content-type: application/json' \ -d '{ "details": { "paymentData": "Ab02b..." } }
The response for when the amount authorised is less than the amount requested:
{ "additionalData": { "authorisedAmountCurrency": "EUR", "authorisedAmountValue": "2400" }, "pspReference": "Q7R7LVQPS8NKGK82", "resultCode": "PartiallyAuthorised", "order": { "amount": { "currency": "EUR", "value": 2500 }, "expiresAt": "2023-09-15T13:35:33Z", "orderData": "111aa111a1a11a1...123a11a1a1a", "pspReference": "MLSPNCQ8HXSKGK82" "reference": "YOUR_ORDER_REFERENCE", "remainingAmount": { "currency": "EUR", "value": 100 } }, "merchantReference": "merchantReference" }
The response for when the amount authorised is equal to amount requested:
{ "pspReference": "RQWVG8TD4MBX8N82", "resultCode": "Authorised", "order": { "amount": { "currency": "EUR", "value": 2500 }, "expiresAt": "2023-09-15T13:35:33Z", "orderData": "111aa111a1a11a1...123a11a1a1a", "pspReference": "MLSPNCQ8HXSKGK82", "reference": "YOUR_PAYMENT_REFERENCE", "remainingAmount": { "currency": "EUR", "value": 0 } }, "merchantReference": "merchantReference", "paymentMethod": { "type": "ancv" } }
You will receive an AUTHORISATION webhook after the shopper completes the payment in their ANCV app:
{ "live": "false", "notificationItems": [ { "NotificationRequestItem": { "amount": { "value": 3000, "currency": "EUR" }, "reason": "null", "success": "true", "eventCode": "AUTHORISATION", "eventDate": "2023-09-14T15:35:58+02:00", "pspReference": "JF89C8JSHVTFWR82", "paymentMethod": "ancv", "additionalData": { "hmacSignature": "NugWLawWaf/0FsVy17G/IaEfOhaz4GShU+hnD6tfQs0=", "merchantOrderReference": "YOUR_ORDER_REFERENCE" }, "merchantReference": "YOUR_MERCHANT_REFERENCE", "merchantAccountCode": "YOUR_MERCHANT_ACCOUNT" } } ] }
With partial authorisation is it possible that if the amount authorized by the shopper is less than the amount requested by the merchant, the Customer Area only shows the requested amount. However, the correct authorized amount is shown in the /payments/details response and in the AUTHORISATION webhook, in additionalData.authorisedAmountValue
.
{ "live": "false", "notificationItems": [ { "NotificationRequestItem": { "amount": { "value": 3000, "currency": "EUR" }, "reason": "null", "success": "true", "eventCode": "AUTHORISATION", "eventDate": "2023-09-14T15:35:58+02:00", "pspReference": "JF89C8JSHVTFWR82", "paymentMethod": "ancv", "additionalData": { "hmacSignature": "NugWLawWaf/0FsVy17G/IaEfOhaz4GShU+hnD6tfQs0=", "merchantOrderReference": "YOUR_ORDER_REFERENCE" "authorisedAmountValue": "2500", "authorisedAmountCurrency": "EUR" }, "merchantReference": "YOUR_MERCHANT_REFERENCE", "merchantAccountCode": "YOUR_MERCHANT_ACCOUNT" } } ] }
Test and go live
- Test your integration end-to-end with the ANCV test app. Instructions on how to download, install and onboard ANCV users, as well as the required test credentials, are shared by ANCV directly with the merchant.
- Make sure to test ANCV payments with partial payments.
- Add ANCV in your live Customer Area and provide the Merchant ID (shopID in ANCV vocabulary), as received from ANCV.