payments

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Data    string `json:"data"`
	Message string `json:"message"`
}

type PaymentInfo

type PaymentInfo struct {
	Destination             string   `json:"destination"`                       //Receiver of the asset
	Memo                    string   `json:"memo,omitempty"`                    //Any description for the transaction. max of 28bytes
	AssetIssuer             string   `json:"assetIssuer"`                       //issuer of the asset you are sending
	AssetCode               string   `json:"assetCode"`                         //asset code of the asset you are sending
	Amount                  string   `json:"amount"`                            //the amount in 7dp. cannot be "0"
	Transaction             string   `json:"transaction,omitempty"`             //this is returned by the API service after ConfirmPaymentDetails has been invoked
	TransactionSignature    string   `json:"transactionSignature,omitempty"`    //used to send signature of the transaction back to the server on the second call
	TransactionID           string   `json:"transactionId,omitempty"`           //used to return transactionID for a successful transaction
	NetworkPassPhrase       string   `json:"networkPassPhrase,omitempty"`       //used to return network passphrase of the network connected to
	DestinationFirstName    string   `json:"destinationFirstName,omitempty"`    //used to return destination first name
	DestinationLastName     string   `json:"destinationLastName,omitempty"`     //used to return destination last name
	DestinationThumbnail    string   `json:"destinationThumbnail,omitempty"`    //used to return destination thumbnail
	ChannelAccount          string   `json:"channelAccount,omitempty"`          //used to send channel account that will be used for this transaction if any
	ChannelAccountSignature string   `json:"channelAccountSignature,omitempty"` //used to preserve the signature from the channel accounts
	Messages                []string `json:"messages,omitempty"`                //used to return any warnings or extra messages important to the user
}

PaymentInfo holds payment information

func PaymentInstance

func PaymentInstance() (p *PaymentInfo)

PaymentInstance returns a new payment struct

func (*PaymentInfo) ConfirmPaymentDetail

func (p *PaymentInfo) ConfirmPaymentDetail(baseUrl, ownerUsername, secretKey, ownerPublicKey, channelAccountSecret string) (err error)

ConfirmPaymentDetail calls bantupayAPI service to generate transactions and confirm payment details. This is the first method to be invoked during payment. the result is returned for UI display of payment details

func (*PaymentInfo) ExpressPay

func (p *PaymentInfo) ExpressPay(baseUrl, ownerUsername, secretKey, ownerPublicKey, channelAccountSecret string) (err error)

ExpressPay used by bots and bulk payment systems. this makes payments bypassing any form of confirmation. It chains together ConfirmPaymentDetails and MakePayment methods

func (*PaymentInfo) MakePayment

func (p *PaymentInfo) MakePayment(baseUrl, ownerUsername, secretKey, ownerPublicKey, channelAccountSecret string) (err error)

MakePayment makes payment after transaction has been generated using ConfirmPaymentDetails method

Jump to

Keyboard shortcuts

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