Git Product home page Git Product logo

adyen-api-go-example's Introduction

Adyen API for Go Example Playground

Description

Playground for https://github.com/zhutik/adyen-api-go library. Contains examples for different usages of library methods and setups

Install

go get github.com/zhutik/adyen-api-go

Alt text

Supported API Calls

  • Authorize
  • Authorize encrypted (default)
  • Save Recurring Payment
  • Recurring List (saved payment methods)
  • Capture
  • Cancel
  • Refund
  • Directory Lookup call
  • Hosted Payment Pages redirect (HPP)

Next

  • Refund or Cancel
  • Notifications

Configuration

Expose your settings for Adyen API configuration.

main.go script will use those variables to communicate with API

$ export ADYEN_CLIENT_TOKEN="YOUR_ADYEN_CLIENT_TOKEN"
$ export ADYEN_USERNAME="YOUR_ADYEN_API_USERNAME"
$ export ADYEN_PASSWORD="YOUR_API_PASSWORD"
$ export ADYEN_ACCOUNT="YOUR_MERCHANT_ACCOUNT"

Or, modify .default.env.template

cp .default.env.template .default.env

# modify/change .default.env and put your credentials

source .default.env

Settings explanation:

  • ADYEN_CLIENT_TOKEN - Library token in Adyen, used to load external JS file from Adyen to validate Credit Card information
  • ADYEN_USERNAME - Adyen API username, usually starts with ws@
  • ADYEN_PASSWORD - Adyen API password for username
  • ADYEN_ACCOUNT - Selected Merchant Account

Hosted Payment Pages

Alt text

update your configuration and make sure you specify additional parameters

# API settings for Adyen Hosted Payment pages
$ export ADYEN_HMAC="YOUR_HMAC_KEY"
$ export ADYEN_SKINCODE="YOUR_SKINCODE_ID"
$ export ADYEN_SHOPPER_LOCALE="YOUR_SHOPPER_LOCALE"

Run with Docker-compose

Note: Expose your configuration first (as shown above)

$ docker-compose up

# or 

$ docker-compose up -d

# or

$ docker run -p 8080:8080 -e ADYEN_USERNAME=${ADYEN_USERNAME} -e ADYEN_PASSWORD=${ADYEN_PASSWORD} -e ADYEN_CLIENT_TOKEN=${ADYEN_CLIENT_TOKEN} -e ADYEN_ACCOUNT=${ADYEN_ACCOUNT} -e ADYEN_HMAC=${ADYEN_HMAC} -e ADYEN_SKINCODE=${ADYEN_SKINCODE} -e ADYEN_SHOPPER_LOCALE=${ADYEN_SHOPPER_LOCALE} zhutik/adyen-api-go-example go run main.go

Open http://localhost:8080 in your browser

Run example without Docker

# Install dependencies
$ go get -d -v ./...
$ go install -v ./...

$ go run main.go

Perform payments

Open http://localhost:8080 in your browser Put credit card information.

Test credit cards could be found https://docs.adyen.com/support/integration#testcardnumbers

Contribute

Please check initial library repository https://github.com/zhutik/adyen-api-go

adyen-api-go-example's People

Contributors

zhutik avatar

Stargazers

 avatar  avatar  avatar

Forkers

colonel-sanders

adyen-api-go-example's Issues

Dockerize application

Dockerize application:

  • Dockerfile exists
  • 8080 port exposed
  • Env variables (Adyen settings) passed to container

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.