payment

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Api     request.Api
	FazzURL string
}

func (*Client) CreateEwallet

func (c *Client) CreateEwallet(ctx context.Context, payload fazz.PaymentCreateEwalletPayload) (*PaymentCreate, *fazz.Error)

CreateEwallet return response from Create a Payment for E-Wallet type.

Docs: https://docs.fazz.com/v4-ID/reference/create-payment

func (*Client) CreateQRIS

func (c *Client) CreateQRIS(ctx context.Context, payload fazz.PaymentCreateQRISPayload) (*PaymentCreate, *fazz.Error)

CreateQRIS return response from Create a Payment for QRIS type.

Docs: https://docs.fazz.com/v4-ID/reference/create-payment

func (*Client) CreateRetailOutlet

func (c *Client) CreateRetailOutlet(ctx context.Context, payload fazz.PaymentCreateRetailPayload) (*PaymentCreate, *fazz.Error)

CreateRetailOutlet return response from Create a Payment for Retail Outlet type.

Docs: https://docs.fazz.com/v4-ID/reference/create-payment

func (*Client) CreateVA

func (c *Client) CreateVA(ctx context.Context, payload fazz.PaymentCreateVAPayload) (*PaymentCreate, *fazz.Error)

CreateVA return response from Create a Payment for Virtual Account type.

Docs: https://docs.fazz.com/v4-ID/reference/create-payment

func (*Client) Payment

func (c *Client) Payment(ctx context.Context, paymentId string) (*Payment, *fazz.Error)

Payment return response from Get a Payment API.

Docs: https://docs.fazz.com/v4-ID/reference/get-a-payment

func (*Client) Payments

func (c *Client) Payments(ctx context.Context, params fazz.FazzParams) ([]Payment, *fazz.Error)

Payment return response from Get a List of Payments API.

Docs: https://docs.fazz.com/v4-ID/reference/get-payments

func (*Client) Update

func (c *Client) Update(ctx context.Context, paymentId string, payload fazz.PaymentUpdatePayload) (*PaymentUpdate, *fazz.Error)

Update return response from Update a Payment API.

Docs: https://docs.fazz.com/v4-ID/reference/update-payment

type Instructions

type Instructions struct {
	ImageUrl         string `json:"imageUrl"`         // QRIS
	DisplayName      string `json:"displayName"`      // QRIS, VA, Retail Outlet
	BankShortCode    string `json:"bankShortCode"`    // VA
	AccountNo        string `json:"accountNo"`        // VA
	RetailOutletName string `json:"retailOutletName"` // Retail Outlet
	PaymentCode      string `json:"paymentCode"`      // Retail Outlet
}

Instructions is part of PaymentMethod

type Payment

type Payment struct {
	ID        string            `json:"id"`
	Type      string            `json:"type"`
	Attribute PaymentAttributes `json:"attributes"`
}

Payment represent response from List of Payments & Get a Payment API.

type PaymentAttributes

type PaymentAttributes struct {
	Status        string        `json:"status"`
	Amount        string        `json:"amount"`
	CreatedAt     string        `json:"createdAt"`
	Description   string        `json:"description"`
	ExpiredAt     string        `json:"expiredAt"`
	ReferenceId   string        `json:"referenceId"`
	Fees          string        `json:"fees"`
	PaymentMethod PaymentMethod `json:"paymentMethod"`
}

PAymentAttributes is part of Payment

type PaymentCreate

type PaymentCreate struct {
	ID         string            `json:"id"`
	Type       string            `json:"type"`
	Attributes PaymentAttributes `json:"attributes"`
}

PaymentCreate represent response from Create a Payment API. Attribute instructions for type QRIS, VA and Retail Outlet is wrapped in one struct and also Settlement from E-Wallet.

type PaymentMethod

type PaymentMethod struct {
	ID           string       `json:"id"`
	Type         string       `json:"type"`
	ReferenceId  string       `json:"referenceId"`
	Instructions Instructions `json:"instructions"` // Wrap QRIS, VA and Retail Outlet in one instructions
	Settlement   Settement    `json:"settlement"`   // Wrap EWallet in one Settlement
}

PaymentMethod is part of PaymentAttributes

type PaymentUpdate

type PaymentUpdate struct {
	Type       string                  `json:"type"`
	Attributes PaymentUpdateAttributes `json:"attributes"`
}

PaymentUpdate represent response from Update a Payment API.

type PaymentUpdateAttributes

type PaymentUpdateAttributes struct {
	TargetId   string `json:"targetId"`
	TargetType string `json:"targetType"`
	Action     string `json:"action"`
}

PaymentUpdateAttributes is part of PaymentUpdate

type Settement

type Settement struct {
	HttpUrl            string `json:"httpUrl"`            // E-Wallet
	AfterSettlementUrl string `json:"afterSettlementUrl"` // E-Wallet
	MobileUrl          string `json:"mobileUrl"`          // E-Wallet
}

Settlement is part of Payment Method

Jump to

Keyboard shortcuts

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