Skip to content

adyen-examples/adyen-vue-online-payments

Adyen Vue Online Payment integration demos

Vue Build E2E (Playwright)

Checkout sample application using Adyen Drop-in v6 (see folder /_archive/v5 to access the previous version using Adyen Drop-in v5).

Details

This repository showcases a PCI-compliant integration of the Sessions Flow, the default integration that we recommend for merchants. Explore this simplified e-commerce demo to discover the code, libraries and configuration you need to enable various payment options in your checkout experience. It is implemented in Typescript (5.0) using Nuxt v3 and Vue 3+.

Card checkout demo

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

Requirements

Node.js >=18.0.0 <=20.0.0

Quick Start with GitHub Codespaces

This repository is configured to work with GitHub Codespaces. Click the badge below to launch a Codespace with all dependencies pre-installed.

Open in GitHub Codespaces

For detailed setup instructions, see the GitHub Codespaces Instructions.

Local Installation

  1. Clone this repo:
git clone https://github.com/adyen-examples/adyen-vue-online-payments.git
  1. Navigate to the root directory and install dependencies:
npm install
  1. Set the following environment variables in your terminal. You can also create a ./.env file and add them there.
export ADYEN_API_KEY="your_adyen_api_key"
export ADYEN_CLIENT_KEY="your_adyen_client_key"
export ADYEN_MERCHANT_ACCOUNT="your_adyen_merchant_account"
export ADYEN_HMAC_KEY="your_adyen_hmac_key"
  1. Configure allowed origins (CORS)
  • It is required to specify the domain or URL of the web applications that will make requests to Adyen. In the Customer Area, add http://localhost:3000 in the list of Allowed Origins associated with the Client Key.
  1. Start the server:
npm run dev
  1. Visit http://localhost:3000/ and select an integration type.

To try out integrations with test card numbers and payment method details, see Test card numbers.

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).

Contributing

We commit all our new features directly into our GitHub repository. Feel free to request or suggest new features or code changes yourself as well!

Find out more in our Contributing guidelines.

License

MIT license. For more information, see the LICENSE file in the root directory.

About

Accept payments on your Vue.js/Express-based website with cards, wallets, and key local payment methods

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors