Skip to content

Configure Adyen instance object

Igor Zhutaiev edited this page Apr 28, 2018 · 4 revisions

This code shows how to configure basic Adyen instance

import "github.com/zhutik/adyen-api-go"

instance := adyen.New(
    adyen.Testing,            // supports adyen.Testing or adyen.Production
    "ADYEN_USERNAME",         // API account username
    "ADYEN_PASSWORD",         // API account password
)

By default, library uses EUR as a default currency, to change that use WithCurrency method when initializing adyen object

instance := adyen.New(
    adyen.Testing,            // supports adyen.Testing or adyen.Production
    "ADYEN_USERNAME",         // API account username
    "ADYEN_PASSWORD",         // API account password
    WithCurrency("CHF"),
)
// OR

instance.Currency = "CHF"


// to get currency for currrent instance
instance.Currency

MerchantAccount could be also stored for further usage

instance.MerchantAccount = "TEST_MERCHANT_ACCOUNT"

// and retrieved afterward
instance.MerchantAccount
Clone this wiki locally