Giter VIP home page Giter VIP logo

adyen-vue-online-payments's Introduction

Adyen online payment integration demos

Run this integration in seconds using Gitpod

NOTE: To allow the Adyen Drop-In and Components to load, you have to add https://*.gitpod.io as allowed origin for your chosen set of API Credentials

Open in Gitpod
 First time with Gitpod?

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.

Card checkout demo

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

Requirements

Node.js 18+

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

Usage

  1. Create a ./.env file with the required info

Remember to include http://localhost:8080 in the list of Allowed Origins

PORT="8080"
ADYEN_API_KEY="your_API_key_here"
ADYEN_MERCHANT_ACCOUNT="your_merchant_account_here"
ADYEN_CLIENT_KEY="your_client_key_here"
ADYEN_HMAC_KEY="your_hmac_key_here"
  1. Start the server:
npm run dev
  1. Visit http://localhost:8080/ (./pages/index.vue) to 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).

adyen-vue-online-payments's People

Contributors

acampos1916 avatar deepu105 avatar dependabot[bot] avatar gcatanese avatar hbkwong avatar jillingk avatar jlengrand avatar kwok-he-chu avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

adyen-vue-online-payments's Issues

Set redirectUrl using hostname

The redirectUrl is hardcoded (http://localhost:8080) therefore it doesn't work when the app is deployed on Gitpod (or other cloud providers). Refactor to use the hostname header.

Add workflow

Create Github Actions workflow to make sure the application build works after every push to the main branch

CORS issue

I have followed usage instruction to setup the projects, however I met this CORS issue.

Failed to load resource: the server responded with a status of 404 (Not Found)
card:1 Access to fetch at 'https://checkoutshopper-test.adyen.com/checkoutshopper/v1/analytics/log?token=test_TTJ2JBTCMBGRJI4XSNU63Z3OUQHOZ5DQ' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
checkoutshopper-test.adyen.com/checkoutshopper/v1/analytics/log?token=test_TTJ2JBTCMBGRJI4XSNU63Z3OUQHOZ5DQ:1 Failed to load resource: net::ERR_FAILED
contentscript.js:58 <body>​…​</body>​

Project is launched on Google Chrome, I have tried to installed CORS plugin to overwrite the request but it wasn't working.
Below attached is the screenshot.
Screenshot 2020-12-09 at 6 25 27 PM

What can I do in order to run this example project?

Upgrade to Adyen Web 5.16.0

Current version uses Adyen Web 5.2.2 which has a known issue with Paypal.

Upgrade sample application to use Adyen Web 5.16.0 (latest available to date), update Node @adyen/api-library version too

Note: Github workflow e2e must be updated to use latest Adyen Testing suite Docker image

Configure HTTP port

Sample app runs on 8080. It would be good to refactor this and allow to customise the port (still leaving 8080 as default)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

asdf
.tool-versions
  • node 16.14.0
dockerfile
Dockerfile
  • node 16-alpine
github-actions
.github/workflows/build.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/e2e.yml
  • actions/checkout v3
npm
package.json
  • @adyen/adyen-web ^5.30.1
  • @adyen/api-library ^12.1.0
  • @nuxtjs/dotenv ^1.4.1
  • cross-env ^7.0.3
  • dotenv ^16.0.3
  • express ^4.18.2
  • nuxt ^2.15.8
  • uuid ^9.0.0
  • nodemon ^2.0.20
  • node >=15.0.0 || <=17.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Upgrade to Web Drop-in v5.0.0

Hi!

I am currently integrating the web drop-in 5.0.0 in a Vue.js project. Is it possible to upgrade this project so that it uses the v5.0.0 also? It would greatly help me with the integration :-)

Minor units examlpe

I'm trying to convert an amount (10EUR) into a minor units amount (1000) is there a function or class in adyen-web library that does that or should I implement it from the table provided here ? and if so the table only provide 140 currency out of 179 currency in ISO 4217

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.