/viva-wallet-go

An SDK for Viva Wallet written in Go

Primary LanguageGoMIT LicenseMIT

Viva Wallet Go SDK

viva-wallet is an SDK for connecting to the payment provider Viva Wallet.

Supported Endpoints

Usage

There are 2 types of clients, one using basic authentication mechanism and another using OAuth. This is due to the implementation of the API itself, meaning that different API calls are using different type of authenication, hence this is unavoidable.

Installation

Under your project directory run the following:

go get -u github.com/techpals-eu/viva-wallet

Payments

Create order payment

oauthClient := vivawallet.NewOAuth(clientID, clientSecret, true)
token, err := oauthClient.Authenticate()

req := vivawallet.CheckoutOrder{
		Amount: 1000,
}
op, err2 := oauthClient.CreateOrderPayment(req)

Transactions

Get a transaction

oauthClient := vivawallet.NewOAuth(clientID, clientSecret, true)
token, err := oauthClient.Authenticate()

trx, err2 := oauthClient.GetTransaction("some-transaction-id")

Create card token

oauthClient := vivawallet.NewOAuth(clientID, clientSecret, true)
token, err := oauthClient.Authenticate()

createCardToken := CreateCardToken{
		TransactionID: "some-trx-id",
}
cardToken, err2 := CreateCardToken(cardToken)

For more examples check out: main.go


👩‍💻 Built by TechPals 👨‍💻