sofortpay

package module
v0.0.0-...-65bcb37 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: MIT Imports: 12 Imported by: 0

README

Sofort Pay GoLang client

Sofort Pay api GoLang wrapper.

License Build Status codecov

Source(s)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey string

func (APIKey) Valid

func (rcv APIKey) Valid() error

check is api key string valid

type Client

type Client interface {
	InitializePayment(ctx context.Context, p *InitializePayment) (*Transaction, error)
	GetPayment(ctx context.Context, uuid uuid.UUID) (*Transaction, error)
	DeletePayment(ctx context.Context, uuid uuid.UUID) error
}

Please note that sofortpay is a Payment Initiation Service, which means that your client can initiate a payment with their bank account via this payment method.

https://manage.sofort-pay.com/merchant/documentation/payments/api/payment

func NewSofortPayClient

func NewSofortPayClient(httpClient *http.Client, apiKey APIKey) (Client, error)

SofortPay HTTP Client constructor (public)

type InitializePayment

type InitializePayment struct {
	// contains filtered or unexported fields
}

func NewInitializePayment

func NewInitializePayment(currencyID string, amount float64, referenceTransactionID string) *InitializePayment

func (*InitializePayment) AddMeta

func (rcv *InitializePayment) AddMeta(key string, value interface{}) *InitializePayment

An object of data which will be passed back to your application

func (*InitializePayment) SetAbortURL

func (rcv *InitializePayment) SetAbortURL(abortURL *url.URL) *InitializePayment

Set return URL if a transaction was aborted

func (*InitializePayment) SetLanguage

func (rcv *InitializePayment) SetLanguage(language string) *InitializePayment

Set the language our payment form initially will be shown to the user

func (*InitializePayment) SetSuccessURL

func (rcv *InitializePayment) SetSuccessURL(successURL *url.URL) *InitializePayment

Set return URL if a transaction was successful

func (*InitializePayment) SetWebhookURL

func (rcv *InitializePayment) SetWebhookURL(webhookURL *url.URL) *InitializePayment

Set URL to notify an endpoint about transaction events. Please use only HTTPS for production mode.

func (*InitializePayment) Valid

func (rcv *InitializePayment) Valid() error

type Recipient

type Recipient struct {
	// contains filtered or unexported fields
}

Recipient

func (*Recipient) BIC

func (rcv *Recipient) BIC() string

Business Identifier Code (BIC) of the account (ISO 9362)

func (*Recipient) BankName

func (rcv *Recipient) BankName() string

Name of the accounts bank

func (*Recipient) City

func (rcv *Recipient) City() string

City name

func (*Recipient) CountryID

func (rcv *Recipient) CountryID() string

2 letter country code of the account (ISO 3166-1 alpha-2 )

func (*Recipient) Holder

func (rcv *Recipient) Holder() string

Name of the account holder

func (*Recipient) IBAN

func (rcv *Recipient) IBAN() string

International Bank Account Number (IBAN) of the account (ISO 13616-1 )

func (*Recipient) Street

func (rcv *Recipient) Street() string

Street name

func (*Recipient) Zip

func (rcv *Recipient) Zip() string

Zone Improvement Plan used in postal addresses

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Object holding information about a sender account

func (*Sender) BIC

func (rcv *Sender) BIC() string

Business Identifier Code (BIC) of the account

func (*Sender) BankName

func (rcv *Sender) BankName() string

Name of the accounts bank

func (*Sender) CountryID

func (rcv *Sender) CountryID() string

2 letter country code of the account

func (*Sender) Holder

func (rcv *Sender) Holder() string

Name of the account holder

func (*Sender) IBAN

func (rcv *Sender) IBAN() string

International Bank Account Number (IBAN) of the account

type SignatureVerifier

type SignatureVerifier interface {
	Verify(xPayloadSignature string, webHookPayload []byte) error
}

To ensure the authenticity and integrity of the payload of a webhook, we sign the payload with a shared secret. The signature is transmitted in a header with our request and is named X-Payload-Signature. The header has the following structure: X-Payload-Signature: v1=<v1_signature_hash>;

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

func (*Transaction) AbortURL

func (rcv *Transaction) AbortURL() *url.URL

Return URL if a transaction was aborted

func (*Transaction) Amount

func (rcv *Transaction) Amount() float64

The amount of your payment

func (*Transaction) CurrencyID

func (rcv *Transaction) CurrencyID() string

The currency of your payment (ISO 4217)

func (*Transaction) IsTestMode

func (rcv *Transaction) IsTestMode() bool

Is test mode

func (*Transaction) Language

func (rcv *Transaction) Language() string

The language our payment form initially will be shown to the user (ISO 639-1)

func (*Transaction) Metadata

func (rcv *Transaction) Metadata() map[string]interface{}

An object of data which will be passed back to your application

func (*Transaction) PayFormCode

func (rcv *Transaction) PayFormCode() string

Code to specify which customized Payform template should be used.

func (*Transaction) Purpose

func (rcv *Transaction) Purpose() string

The purpose (aka subject) of your payment

func (*Transaction) Recipient

func (rcv *Transaction) Recipient() *Recipient

Recipient

func (*Transaction) Sender

func (rcv *Transaction) Sender() *Sender

Object holding information about a sender account

func (*Transaction) Status

func (rcv *Transaction) Status() string

Transaction status

func (*Transaction) SuccessURL

func (rcv *Transaction) SuccessURL() *url.URL

Return URL if a transaction was successful

func (*Transaction) UUID

func (rcv *Transaction) UUID() *uuid.UUID

Transaction ID

func (*Transaction) WebhookURL

func (rcv *Transaction) WebhookURL() *url.URL

URL to notify an endpoint about transaction events. Please use only HTTPS for production mode.

Jump to

Keyboard shortcuts

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