Skip to content

Latest commit

 

History

History

paybylink-example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Adyen Pay By Link Integration Demo

Run demo in one-click

Open in Gitpod
 First time with Gitpod?

Description

This repository includes an example of Pay By Link with Adyen. Within this demo app, you can create links by specifying the amount. The shopper can then choose to accept the links and complete the payment.

Pay by Link Demo

This demo leverages Adyen's API Library for Node.js (GitHub | Docs).

Note: We've included a blog post that explains Pay By Link in detail.

Requirements

1. Installation

git clone https://github.com/adyen-examples/adyen-node-online-payments.git

2. Set the environment variables

Create a ./.env file with the environment variables.

export ADYEN_API_KEY=yourAdyenApiKey
export ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount
export ADYEN_CLIENT_KEY=yourAdyenClientKey
export ADYEN_HMAC_KEY=yourHmacKey

3. Run the application

cd paybylink-example
    
npm install
npm run dev

Visit http://localhost:8080/ to create a Payment Link.

Webhooks

Webhooks deliver asynchronous notifications about the payment status and other events that are important to receive and process. You can find more information about webhooks in this blog post.

Webhook setup

In the Customer Area under the Developers → Webhooks section, create a new Standard webhook.

A good practice is to set up basic authentication, copy the generated HMAC Key and set it as an environment variable. The application will use this to verify the HMAC signatures.

Make sure the webhook is enabled, so it can receive notifications.

Expose an endpoint

This demo provides a simple webhook implementation exposed at /api/webhooks/notifications that shows you how to receive, validate and consume the webhook payload.

Test your webhook

The following webhooks events should be enabled:

  • AUTHORISATION

To make sure that the Adyen platform can reach your application, we have written a Webhooks Testing Guide that explores several options on how you can easily achieve this (e.g. running on localhost or cloud).