xenditfasthttp

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

fasthttp-xendit

Golang fasthttp xendit

Reference

Feature

  • Virtual Accounts
    • CreataVA
  • Outlet
    • UpdateFixedPaymentCode
    • CreateFixedPaymentCode
  • Disbursement
    • GetDisbursementsByExternalID
    • GetDisbursementByID
    • GetAvailableDisbursementBanks
    • CreateDisbursement

Constribute

  • feel free to constribute, :)

Documentation

Index

Constants

View Source
const (
	// VAMandiri is ..
	VAMandiri = "MANDIRI"
	// VABNI is ..
	VABNI = "BNI"
	// VAPermata is ..
	VAPermata = "PERMATA"
	// VABCA is ..
	VABCA = "BCA"

	// VABRI is ...
	VABRI = "BRI"

	// VABNISyariah is ....
	VABNISyariah = "BNI_SYARIAH"

	// OutletIndomaret ...
	OutletIndomaret = "INDOMARET"

	// OutletAlfamart ...
	OutletAlfamart = "ALFAMART"
)

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(usr, pwd string) string

BasicAuth is ..

Types

type AvailableDisbursementBanksResponse added in v1.0.2

type AvailableDisbursementBanksResponse struct {
	Name            string `json:"name"`
	Code            string `json:"code"`
	CanDisburse     bool   `json:"can_disburse"`
	CanNameValidate bool   `json:"can_name_validate"`
}

AvailableDisbursementBanksResponse is ...

type BatchDisbursement added in v1.0.4

type BatchDisbursement struct {
	Amount            int      `json:"amount,required"`
	BankCode          string   `json:"bank_code,required"`
	BankAccountName   string   `json:"bank_account_name,required"`
	BankAccountNumber string   `json:"bank_account_number,required"`
	Description       string   `json:"description,required"`
	ExternalID        string   `json:"external_id"`
	EmailTo           []string `json:"email_to,omitempty"`
	EmailCC           []string `json:"email_cc,omitempty"`
	EmailBCC          []string `json:"email_bcc,omitempty"`
}

BatchDisbursement is used to create batch disb

type BatchDisbursementRequest added in v1.0.4

type BatchDisbursementRequest struct {
	Reference     string              `json:"reference,required"`
	Disbursements []BatchDisbursement `json:"disbursements,required"`
}

BatchDisbursementRequest is used to create dibursement at the same time.

type Client

type Client struct {
	Host      string
	SecretKey string
	LogLevel  int
	Logger    *log.Logger
}

Client is ...

func NewClient

func NewClient() Client

NewClient is ...

func (*Client) Call

func (c *Client) Call(method, path string, header map[string]string, body io.Reader, v interface{}) error

Call is ...

func (*Client) ExecuteRequest

func (c *Client) ExecuteRequest(req *fasthttp.Request, v interface{}) error

ExecuteRequest is ...

func (*Client) NewRequest

func (c *Client) NewRequest(method, fullPath string, headers map[string]string, body io.Reader) (*fasthttp.Request, error)

NewRequest test is ...

type CoreXendit

type CoreXendit struct {
	Client Client
}

CoreXendit is ...

func (*CoreXendit) Call

func (gw *CoreXendit) Call(method, path string, header map[string]string, body io.Reader, v interface{}) error

Call is ...

func (*CoreXendit) CreataVA

func (gw *CoreXendit) CreataVA(req CreateVARequest) (res CreateVAResponse, err error)

CreataVA is used to create virtual account

func (*CoreXendit) CreateBatchDisbursement added in v1.0.4

func (gw *CoreXendit) CreateBatchDisbursement(req BatchDisbursementRequest) (res CreateBatchDisbursementResponse, err error)

CreateBatchDisbursement is used to create batch disbursement

func (*CoreXendit) CreateDisbursement added in v1.0.2

func (gw *CoreXendit) CreateDisbursement(req DisbursementRequest) (res DisbursementResponse, err error)

CreateDisbursement is used to create disbursement

func (*CoreXendit) CreateFixedPaymentCode added in v1.0.2

func (gw *CoreXendit) CreateFixedPaymentCode(req CreateFixedPaymentCodeRequest) (res FixedPaymentCodeResponse, err error)

CreateFixedPaymentCode is used to create payment to outlet e.g: Alfamart, Indomaret ...

func (*CoreXendit) GetAvailableBatchDisbursementBanks added in v1.0.4

func (gw *CoreXendit) GetAvailableBatchDisbursementBanks() (res []GetAvailableDisbursementBanksResponse, err error)

GetAvailableBatchDisbursementBanks is used to get available banks.

func (*CoreXendit) GetAvailableDisbursementBanks added in v1.0.2

func (gw *CoreXendit) GetAvailableDisbursementBanks() (res []AvailableDisbursementBanksResponse, err error)

GetAvailableDisbursementBanks is used to get available disbusrsement banks

func (*CoreXendit) GetDisbursementByID added in v1.0.2

func (gw *CoreXendit) GetDisbursementByID(disursementID string) (res DisbursementResponse, err error)

GetDisbursementByID is used to get disbusement by ID

func (*CoreXendit) GetDisbursementsByExternalID added in v1.0.2

func (gw *CoreXendit) GetDisbursementsByExternalID(exID string) (res []DisbursementResponse, err error)

GetDisbursementsByExternalID is used to get Disbursement by external ID

func (*CoreXendit) GetVirtualAccountAvailableBanks added in v1.0.2

func (gw *CoreXendit) GetVirtualAccountAvailableBanks() (res VirtualAccountBanksResponse, err error)

GetVirtualAccountAvailableBanks is used to get virtual account available banks

func (*CoreXendit) GetVirtualAccountRequest added in v1.0.2

func (gw *CoreXendit) GetVirtualAccountRequest(id string) (res CreateVAResponse, err error)

GetVirtualAccountRequest is used to get virtual account request.

func (*CoreXendit) SimulateFixedPayment added in v1.0.5

func (gw *CoreXendit) SimulateFixedPayment(req SimulateRequest) (res SimulateResponse, err error)

SimulateFixedPayment is used to simulate payment to outlet.

func (*CoreXendit) UpdateFixedPaymentCode added in v1.0.2

func (gw *CoreXendit) UpdateFixedPaymentCode(paymentCode string, req UpdateFixedPaymentCodeRequest) (res FixedPaymentCodeResponse, err error)

UpdateFixedPaymentCode i sused to update payment

func (*CoreXendit) UpdateVirtualAccount added in v1.0.2

func (gw *CoreXendit) UpdateVirtualAccount(req UpdateVirtualAccountsRequest, id string) (res CreateVAResponse, err error)

UpdateVirtualAccount is used to update virtual account

type CreateBatchDisbursementResponse added in v1.0.4

type CreateBatchDisbursementResponse struct {
	ID                  string `json:"id"`
	Created             string `json:"created"`
	Reference           string `json:"reference"`
	TotalUploadedAmount int    `json:"total_uploaded_amount"`
	TotalUploadedCount  int    `json:"total_uploaded_count"`
	Status              string `json:"status"`
}

CreateBatchDisbursementResponse is used to ...

type CreateFixedPaymentCodeRequest added in v1.0.2

type CreateFixedPaymentCodeRequest struct {
	ExternalID       string `json:"external_id,required"`
	RetailOutletName string `json:"retail_outlet_name,required"`
	Name             string `json:"name,required"`
	ExpectedAmount   int    `json:"expected_amount,required"`
	PaymentCode      string `json:"payment_code,omitempty"`
	ExpirationDate   string `json:"expiration_date,omitempty"`
	IsSingleUse      bool   `json:"is_single_use,omitempty"`
}

CreateFixedPaymentCodeRequest is used to ..

type CreateVARequest

type CreateVARequest struct {
	ExternalID           string `json:"external_id,required"`
	BankCode             string `json:"bank_code,required"`
	Name                 string `json:"name,required"`
	VirtualAccountNumber string `json:"virtual_account_number,omitempty"`
	SuggestedAmount      int    `json:"suggested_amount,omitempty"`
	IsClosed             bool   `json:"is_closed,omitempty"`
	ExpectedAmount       int    `json:"expected_amount,omitempty"`
	ExpirationDate       string `json:"expiration_date,omitempty"`
	IsSingleUse          bool   `json:"is_single_use,omitempty"`
	Description          string `json:"description,omitempty"`
}

CreateVARequest is ...

type CreateVAResponse

type CreateVAResponse struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Currency        string `json:"currency"`
	OwnerID         string `json:"owner_id"`
	ExternalID      string `json:"external_id"`
	BankCode        string `json:"bank_code"`
	MerchantCode    string `json:"merchant_code"`
	AccountNumber   string `json:"account_number"`
	ExpirationDate  string `json:"expiration_date"`
	IsClosed        bool   `json:"is_closed"`
	IsSingleUse     bool   `json:"is_single_use"`
	Status          string `json:"status"`
	SuggestedAmount int    `json:"suggested_amount,omitempty"`
	ExpectedAmount  int    `json:"expected_amount,omitempty"`
	Description     string `json:"description,omitempty"`
}

CreateVAResponse is used to...

type DisbursementRequest added in v1.0.2

type DisbursementRequest struct {
	IdempotencyKey    string   `json:"idempotency_key,omitempty"`
	ExternalID        string   `json:"external_id,required"`
	BankCode          string   `json:"bank_code,required"`
	AccountHolderName string   `json:"account_holder_name,required"`
	AccountNumber     string   `json:"account_number,required"`
	Description       string   `json:"description,required"`
	Amount            int      `json:"amount,required"`
	EmailTo           []string `json:"email_to,omitempty"`
	EmailCC           []string `json:"email_cc,omitempty"`
	EmailBCC          []string `json:"email_bcc,omitempty"`
}

DisbursementRequest is a Disbursement

type DisbursementResponse added in v1.0.2

type DisbursementResponse struct {
	ID                      string   `json:"id"`
	UserID                  string   `json:"user_id"`
	ExternalID              string   `json:"external_id"`
	Amount                  int      `json:"amount"`
	BankCode                string   `json:"bank_code"`
	AccountHolderName       string   `json:"account_holder_name"`
	DisbursementDescription string   `json:"disbursement_description"`
	Status                  string   `json:"status"`
	IdempotencyKey          string   `json:"idempotency_key,omitempty"`
	EmailTo                 []string `json:"email_to,omitempty"`
	EmailCC                 []string `json:"email_cc,omitempty"`
	EmailBCC                []string `json:"email_bcc,omitempty"`
}

DisbursementResponse is ...

type FixedPaymentCodeResponse added in v1.0.2

type FixedPaymentCodeResponse struct {
	ID               string `json:"id"`
	OwnerID          string `json:"owner_id"`
	ExternalID       string `json:"external_id"`
	RetailOutletName string `json:"retail_outlet_name"`
	Prefix           string `json:"prefix"`
	Name             string `json:"name"`
	PaymentCode      string `json:"payment_code,omitempty"`
	Type             string `json:"type,omitempty"`
	ExpectedAmount   int    `json:"expected_amount,omitempty"`
	IsSingleUse      bool   `json:"is_single_use,omitempty"`
	ExpirationDate   string `json:"expiration_date,omitempty"`
}

FixedPaymentCodeResponse is used to ....

type GetAvailableDisbursementBanksResponse added in v1.0.4

type GetAvailableDisbursementBanksResponse struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

GetAvailableDisbursementBanksResponse is used to ...

type ResponseError

type ResponseError struct {
	ErrorCode string `json:"error_code"`
	Message   string `json:"message"`
}

ResponseError is used to..

type SimulateRequest added in v1.0.5

type SimulateRequest struct {
	ExternalID       string `json:"external_id"`
	RetailOutletName string `json:"retail_outlet_name"`
	PaymentCode      string `json:"payment_code"`
	TransferAmount   int    `json:"transfer_amount"`
}

SimulateRequest ...

type SimulateResponse added in v1.0.5

type SimulateResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

SimulateResponse struct ..

type UpdateFixedPaymentCodeRequest added in v1.0.2

type UpdateFixedPaymentCodeRequest struct {
	Name           string `json:"name,omitempty"`
	ExpectedAmount int    `json:"expected_amount,omitempty"`
	ExpirationDate string `json:"expiration_date,omitempty"`
}

UpdateFixedPaymentCodeRequest is used to update ...

type UpdateVirtualAccountsRequest added in v1.0.2

type UpdateVirtualAccountsRequest struct {
	SuggestedAmount int    `json:"suggested_amount,omitempty"`
	ExpectedAmount  int    `json:"expected_amount,omitempty"`
	ExpirationDate  string `json:"expiration_date,omitempty"`
	IsSingleUse     bool   `json:"is_single_use,omitempty"`
	Description     string `json:"description,omitempty"`
}

UpdateVirtualAccountsRequest is used to update virtual account

type VirtualAccountBanksResponse added in v1.0.2

type VirtualAccountBanksResponse struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

VirtualAccountBanksResponse is used to create response ..

Jump to

Keyboard shortcuts

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