Documentation
¶
Index ¶
- Constants
- type DisbursementCreatePayload
- type DisbursementMethod
- type DisbursementUpdatePayload
- type Error
- type Errors
- type FazzParams
- type FazzPayload
- type Payment
- type PaymentCreateEwalletPayload
- type PaymentCreateQRISPayload
- type PaymentCreateRetailPayload
- type PaymentCreateVAPayload
- type PaymentEwalletOptions
- type PaymentLinkCreatePayload
- type PaymentLinkOptions
- type PaymentLinkUpdatePayload
- type PaymentMethodCreateQRISPayload
- type PaymentMethodCreateVAPayload
- type PaymentMethodOptions
- type PaymentMethodSimulatePayload
- type PaymentQRISOptions
- type PaymentRetailOptions
- type PaymentUpdatePayload
- type PaymentVAOptions
- type ValidateBankAccountPayload
Constants ¶
const ( ErrorCodeSDK = "SDK_ERROR" // Generic Errors // ErrorCode000 is used for error Unknown error ErrorCode000 = "000" // ErrorCode001 is used for error Internal server error ErrorCode001 = "001" // ErrorCode002 is used for error Access denied ErrorCode002 = "002" // ErrorCode003 is used for error Feature not supported ErrorCode003 = "003" // ErrorCode004 is used for error Record not found ErrorCode004 = "004" // ErrorCode005 is used for error Invalid parameters ErrorCode005 = "005" // ErrorCode010 is used for error Service Temporarily Unavailable ErrorCode010 = "010" // Transaction Specific Errors // ErrorCodeTXN0001 is used for error Account has insufficient funds ErrorCodeTXN0001 = "TXN0001" // ErrorCodeTXN0002 is used for error Invalid transaction amount ErrorCodeTXN0002 = "TXN0002" // ErrorCodeTXN0003 is used for error Transaction exceeds account transaction limit ErrorCodeTXN0003 = "TXN0003" // ErrorCodeTXN0004 is used for error Transaction exceeds account balance limit ErrorCodeTXN0004 = "TXN0004" // ErrorCodeTXN0005 is used for error Failed to create virtual account number ErrorCodeTXN0005 = "TXN0005" // ErrorCodeTXN0006 is used for error suffixNo params is not supported for this bank ErrorCodeTXN0006 = "TXN0006" // ErrorCodeTXN0007 is used for error suffixNo params exceed maximum number limit ErrorCodeTXN0007 = "TXN0007" )
const ( SandboxURL = "https://sandbox-id.xfers.com/api" ProductionURL = "https://id.xfers.com/api" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisbursementCreatePayload ¶
type DisbursementCreatePayload struct {
Amount uint32 `json:"amount"` // Required
ReferenceID string `json:"referenceId"` // Required
Description string `json:"description"`
DisbursementMethod DisbursementMethod `json:"disbursementMethod"` // Required
}
DisbursementCreatePayload is payload for create disbursement API
type DisbursementMethod ¶
type DisbursementMethod struct {
Type string `json:"type"` // Required
BankShortCode string `json:"bankShortCode"` // Required
BankAccountNo string `json:"bankAccountNo"` // Required
BankAccountHolderName string `json:"bankAccountHolderName"`
}
DisbursementMethod is part of payload create disbursement
type DisbursementUpdatePayload ¶
type DisbursementUpdatePayload struct {
Action string `json:"action"`
}
DisbursementUpdatePayload is payload for update disbursement API
type Error ¶
type Error struct {
HttpStatusCode int // Response from http status code
Errors []Errors `json:"errors"`
}
Error is combined from standard error Fazz with response HTTP Status Code
func ErrFromAPI ¶
ErrFromAPI is used when get an error from response API
func ErrFromSDK ¶
ErrFromSDK is used when get an error from the SDK
type Errors ¶
type Errors struct {
Code string `json:"code"`
Title string `json:"title"`
Detail string `json:"detail"`
}
Errors is standard list response error from Fazz
type FazzParams ¶
type FazzParams struct {
PageNumber uint32 `url:"page[number],omitempty"`
PageSize uint32 `url:"page[size],omitempty"`
Sort string `url:"sort,omitempty"`
CreatedAfter string `url:"filter[createdAfter],omitempty"` // Time.iso8601
CreatedBefore string `url:"filter[createdBefore],omitempty"` // Time.iso8601
Status string `url:"filter[status],omitempty"`
ReferenceID string `url:"filter[referenceId],omitempty"`
}
FazzParams represent default pagination, sorting & filtering from Fazz
type FazzPayload ¶
type FazzPayload struct {
Data struct {
Attributes any `json:"attributes"`
} `json:"data"`
}
FazzPayload represent default format body params from Fazz
type Payment ¶
type Payment struct {
PaymentMethodType string `json:"paymentMethodType"` // Required
Amount uint32 `json:"amount"` // Required
ReferenceId string `json:"referenceId"` // Required
ExpiredAt string `json:"expiredAt,omitempty"`
Description string `json:"description,omitempty"`
}
Payment is general payload for create a payment like retail outlet, va, qris and e-wallet.
type PaymentCreateEwalletPayload ¶
type PaymentCreateEwalletPayload struct {
Payment
PaymentMethodOptions PaymentEwalletOptions `json:"paymentMethodOptions"`
}
PaymentCreateEwalletPayload represent for request payload Create a Payment (E-Wallet)
type PaymentCreateQRISPayload ¶
type PaymentCreateQRISPayload struct {
Payment
PaymentMethodOptions PaymentQRISOptions `json:"paymentMethodOptions"`
}
PaymentCreateQRISPayload represent for request payload Create a Payment (QRIS)
type PaymentCreateRetailPayload ¶
type PaymentCreateRetailPayload struct {
Payment
PaymentMethodOptions PaymentRetailOptions `json:"paymentMethodOptions"`
}
PaymentCreateRetailPayload represent for request payload Create a Payment (Retail Outlet)
type PaymentCreateVAPayload ¶
type PaymentCreateVAPayload struct {
Payment
PaymentMethodOptions PaymentVAOptions `json:"paymentMethodOptions"`
}
PaymentCreateVAPayload represent for request payload Create a Payment (Virtual Account)
type PaymentEwalletOptions ¶
type PaymentEwalletOptions struct {
ProviderCode string `json:"providerCode"`
AfterSettlementReturnlUrl string `json:"afterSettlementReturnUrl"`
}
PaymentEwalletOptions is part of PaymentCreateEwalletPayload
type PaymentLinkCreatePayload ¶
type PaymentLinkCreatePayload struct {
Amount uint32 `json:"amount"` // Required
ReferenceId string `json:"referenceId"` // Required
CustomerName string `json:"customerName"` // Required
CustomerEmail string `json:"customerEmail"` // Required
CustomerPhoneNumber string `json:"customerPhoneNumber"` // Required
Description string `json:"description"` // Required
ExpiredAt string `json:"expiredAt,omitempty"` // ISO601
PaymentMethodOptions PaymentLinkOptions `json:"paymentMethodOptions"`
}
PaymentLinkCreatePayload represent request payload for Create a Payment Link API.
type PaymentLinkOptions ¶
type PaymentLinkOptions struct {
DisplayName string `json:"displayName,omitempty"`
}
PaymentLinkOptions is part of PaymentLinkCreatePayload
type PaymentLinkUpdatePayload ¶
type PaymentLinkUpdatePayload struct {
// cancel, receive_payment, or settle. receive_payment & settle for sandbox purpose
Action string `json:"action"`
}
PaymetLinkUpdatePayload represent request payload for Update a Payment Link API.
type PaymentMethodCreateQRISPayload ¶
type PaymentMethodCreateQRISPayload struct {
ReferenceID string `json:"referenceId"` // Required
DisplayName string `json:"displayName"`
}
PaymentMethodCreateQRISPayload represent request payload for Create Payment Method type QRIS API.
type PaymentMethodCreateVAPayload ¶
type PaymentMethodCreateVAPayload struct {
ReferenceID string `json:"referenceId"` // Required
BankShortCode string `json:"bankShortCode"` // Required
DisplayName string `json:"displayName"` // Required
SuffixNo string `json:"suffixNo,omitempty"`
}
PaymentMethodCreateVAPayload represent request payload for Create Payment Method type Virtual Account API.
type PaymentMethodOptions ¶
type PaymentMethodOptions struct {
Amount float32 `json:"amount"`
}
PaymentMethodOptions is part of PaymentMethodSimulatePayload
type PaymentMethodSimulatePayload ¶
type PaymentMethodSimulatePayload struct {
Action string `json:"action"`
Options PaymentMethodOptions `json:"options"`
}
PaymentMethodSimulatePayload represent request payload for Create a mock payment API.
type PaymentQRISOptions ¶
type PaymentQRISOptions struct {
DisplayName string `json:"displayName"`
}
PaymentQRISOptions is part of PaymentCreateQRISPayload
type PaymentRetailOptions ¶
type PaymentRetailOptions struct {
RetailOutletName string `json:"retailOutletName"`
DisplayName string `json:"displayName"`
}
PaymentRetailOptions is part of PaymentCreateRetailPayload
type PaymentUpdatePayload ¶
type PaymentUpdatePayload struct {
Action string `json:"action"`
}
PaymentUpdatePayload represent for request payload Update a Payment API.
type PaymentVAOptions ¶
type PaymentVAOptions struct {
BankShortCode string `json:"bankShortCode"`
DisplayName string `json:"displayName"`
SuffixNo string `json:"suffixNo,omitempty"`
}
PaymentVAOptions is part of PaymentCreateVAPayload
type ValidateBankAccountPayload ¶
type ValidateBankAccountPayload struct {
AccountNo string `json:"accountNo"`
BankShortCode string `json:"bankShortCode"`
}
ValidateBankAccount represent for payload request Validate a bank account API
Docs: https://docs.fazz.com/v4-ID/reference/validate-bank-account