adyen

package module
v0.0.0-...-3c69e25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2014 License: MIT Imports: 4 Imported by: 0

README

Build Status Build Status GoDoc

adyen

Redirect URL generation to setup a payment session for Adyen HPP

Documentation

Overview

Package adyen provides redirect URL generation to setup a payment session for Adyen HPP

For specification see:

https://support.adyen.com/index.php?/Knowledgebase/Article/View/1301/101/integration-manual-v178

Example
key := "Kah942*$7sdp0)"
v := url.Values{}

// set parameters
v.Set("merchantAccount", "TestMerchant")
v.Set("skinCode", "4aD37dJA")

v.Set("merchantReference", "Internet Order 12345")
v.Set("paymentAmount", "10000")
v.Set("currencyCode", "GBP")

v.Set("shipBeforeDate", "2007-10-20")
v.Set("sessionValidity", "2007-10-11T11:00:00Z")

v.Set("orderData", "H4sIAAAAAAAAALMpsOPlCkssyswvLVZIz89PKVZIzEtRKE4tKstMTi3W4+Wy0S+wAwDOGUCXJgAAAA==")
v.Set("shopperLocale", "en_GB")

// generate signing string
signStr := SignStr(v)

// generate signature string
signature := Signature(key, signStr)

// set signature parameter
v.Set("merchantSig", signature)
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignStr

func SignStr(v url.Values) string

SignStr generates the signing string with the required parameters in the specified order. It leaves unspecified parameters blank.

func Signature

func Signature(key string, signStr string) string

Signature generates the HMAC signature from the signing string using SHA-1. It returns the base64 encoded signature to be set as "merchantSig".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL