Documentation ¶
Index ¶
- Variables
- func SetAPIRequester(apiRequester APIRequester)
- func SetHTTPClient(newHTTPClient *http.Client)
- type APIRequester
- type APIRequesterImplementation
- type APIRequesterWrapper
- type AccountInquiryGet
- type AccountInquiryStatus
- type BalanceGet
- type BalanceStatus
- type BankCode
- type Checkout
- type CheckoutGet
- type CheckoutResult
- type DisbursementCallback
- type DisbursementGet
- type DisbursementResult
- type DisbursementStatus
- type Error
- type Option
- type ScheduledDisbursementCallback
- type ScheduledDisbursementGet
- type ScheduledDisbursementResult
- type ScheduledDisbursementStatus
Constants ¶
This section is empty.
Variables ¶
var AllBankCode = map[BankCode]string{}/* 104 elements not displayed */
AllBankCode : Get All available PaymentType
Functions ¶
func SetAPIRequester ¶
func SetAPIRequester(apiRequester APIRequester)
SetAPIRequester sets the APIRequester for API call
func SetHTTPClient ¶
SetHTTPClient sets the httpClient for API call
Types ¶
type APIRequester ¶
type APIRequester interface {
Call(ctx context.Context, method string, url string, header *http.Header, body interface{}, result interface{}) *Error
}
APIRequester abstraction of HTTP Client that will make API calls to OY backend. `body` is POST-requests' bodies if applicable. `result` pointer to value which response string will be unmarshalled to.
func GetAPIRequester ¶
func GetAPIRequester() APIRequester
GetAPIRequester returns the oy APIRequester. If it is already created, it will return the created one. Else, it will create a default implementation.
type APIRequesterImplementation ¶
APIRequesterImplementation is the default implementation of APIRequester
func (*APIRequesterImplementation) Call ¶
func (a *APIRequesterImplementation) Call(ctx context.Context, method string, url string, header *http.Header, body interface{}, result interface{}) *Error
Call makes HTTP requests with JSON-format body. `body` is POST-requests' bodies if applicable. `result` pointer to value which response string will be unmarshalled to.
type APIRequesterWrapper ¶
type APIRequesterWrapper struct {
// contains filtered or unexported fields
}
APIRequesterWrapper is the APIRequester with locker for setting the APIRequester
type AccountInquiryGet ¶
type AccountInquiryGet struct { Status AccountInquiryStatus `json:"status"` //Status of inquiry {code: <status_code>, message: <status_message>} BankCode BankCode `json:"bank_code"` //Bank Code of the Beneficiary account, see Disbursement Bank Codes AccountNumber string `json:"account_number"` //Account Number of the Beneficiary Account AccountName string `json:"account_name"` //Account Name of the Beneficiary Account Id string `json:"id"` //Unique ID of the inquiry. ID will be provided only for 000 or 209 status. Otherwise, the ID will be null. InvoiceId string `json:"invoice_id"` //ID of the invoice related to the inquiry result. Timestamp date.YYYYMMDDHHMMSS `json:"timestamp"` //UTC Timestamp api hit (Format: yyyy-MM-ddTHH:mm:ss) }
type AccountInquiryStatus ¶
type BalanceGet ¶
type BalanceGet struct { Status BalanceStatus `json:"status"` //Status of Payout in Object {code: <status_code>, message: <status_message>} Balance *float64 `json:"balance"` //Remaining balance (Accept non fraction number) OverdraftBalance *float64 `json:"overdraftBalance"` //Remaining overdraft balance (Accept non fraction number) OverbookingBalance *float64 `json:"overbookingBalance"` //Remaining overbooking balance (Accept non fraction number) PendingBalance *float64 `json:"pendingBalance"` //The cumulative balance of your pending transactions. AvailableBalance *float64 `json:"availableBalance"` //The total cumulative money of Balance + Available Overdraft - Pending Balance that you can use for disbursement. Timestamp *string `json:"timestamp"` //Execution time of Disbursement in OY! system ("dd-MM-yyyy HH:mm:ss"). }
type BalanceStatus ¶
type BankCode ¶
type BankCode string
BankCode value
const ( BankBRI BankCode = "002" BankMandiri BankCode = "008" BankBNI BankCode = "009" BankDanamon BankCode = "011" BankPermata BankCode = "013" BankBCA BankCode = "014" BIIMaybank BankCode = "016" BankPanin BankCode = "019" CIMBNiaga BankCode = "022" BankUOBINDONESIA BankCode = "023" BankOCBCNISP BankCode = "028" CITIBANK BankCode = "031" BankWinduKentjanaInternational BankCode = "036" BankARTHAGRAHA BankCode = "037" BankTOKYOMITSUBISHIUFJ BankCode = "042" BankDBS BankCode = "046" Standard BankCode = "050" BankCAPITAL BankCode = "054" ANZIndonesia BankCode = "061" BankOFCHINA BankCode = "069" BankBumiArta BankCode = "076" BankHSBC BankCode = "087" BankAntardaerah BankCode = "088" BankRabobank BankCode = "089" BankJTRUSTINDONESIA BankCode = "095" BankMAYAPADA BankCode = "097" BankJawaBarat BankCode = "110" BankDKI BankCode = "111" BankBPDDIY BankCode = "112" BankJATENG BankCode = "113" BankJatim BankCode = "114" BankJambi BankCode = "115" BankAceh BankCode = "116" BankSUMUT BankCode = "117" BankNAGARI BankCode = "118" BankRiau BankCode = "119" BankSUMSELBABEL BankCode = "120" BankLampung BankCode = "121" BankKALSEL BankCode = "122" BankKALBAR BankCode = "123" BankBPDKaltim BankCode = "124" BankBPDKalteng BankCode = "125" BankSULSELBAR BankCode = "126" BankSulut BankCode = "127" BankNTB BankCode = "128" BankBPDBali BankCode = "129" BankNTT BankCode = "130" BankMaluku BankCode = "131" BankBPDPapua BankCode = "132" BankSULTENG BankCode = "134" BankSultra BankCode = "135" BankBANTEN BankCode = "137" BankNusantaraParahyangan BankCode = "145" BankOfIndiaIndonesia BankCode = "146" BankMuamalat BankCode = "147" BankMestika BankCode = "151" BankSHINHAN BankCode = "152" BankSinarmas BankCode = "153" BankMaspion BankCode = "157" BankGanesha BankCode = "161" BankICBC BankCode = "164" BankQNBIndonesia BankCode = "167" BankBTN BankCode = "200" BankWooriSaudara BankCode = "212" BankBTPN BankCode = "213" BankVictoriaSyariah BankCode = "405" BankJabarBantenSyariah BankCode = "425" BankMega BankCode = "426" BankBukopin BankCode = "441" BankSyariahIndonesia BankCode = "451" BankJasaJakarta BankCode = "472" BankKEBHANA BankCode = "484" BankMNCINTERNATIONAL BankCode = "485" BankNeoCommerce BankCode = "490" BankRakyatIndonesiaAGRONIAGA BankCode = "494" BankSBIIndonesia BankCode = "498" BankRoyal BankCode = "501" BankNationalNobu BankCode = "503" BankMEGASYARIAH BankCode = "506" BankINA BankCode = "513" BankPANINSYARIAH BankCode = "517" PRIMAMASTERBANK BankCode = "520" BankSYARIAHBUKOPIN BankCode = "521" BankSahabatSampoerna BankCode = "523" BankDINAR BankCode = "526" BankKESEJAHTERAANEKONOMI BankCode = "535" BankBCASYARIAH BankCode = "536" BankJago BankCode = "542" BankBTPNSYARIAH BankCode = "547" BankMULTIARTASENTOSA BankCode = "548" BankMayora BankCode = "553" BankINDEX BankCode = "555" CNB BankCode = "559" BankMANTAP BankCode = "564" BankVICTORIAINTL BankCode = "566" HARDA BankCode = "567" BPRKS BankCode = "688" IBK BankCode = "945" BankCTBCIndonesia BankCode = "949" BankCOMMONWEALTH BankCode = "950" OVO BankCode = "ovo" LinkAja BankCode = "linkaja" Dana BankCode = "dana" Gopay BankCode = "gopay" ShopeePayEwallet BankCode = "shopeepay_ewallet" LinkAjaEwallet BankCode = "linkaja_ewallet" )
type Checkout ¶
type Checkout struct { PartnerTxId string `json:"partner_tx_id"` Amount int `json:"amount"` PaidAmount *int `json:"paid_amount"` SenderName *string `json:"sender_name"` SenderPhoneNumber *string `json:"sender_phone"` SenderNote *string `json:"sender_note"` SenderBank *string `json:"sender_bank"` SettlementStatus *string `json:"settlement_status"` SettlementType *string `json:"settlement_type"` SettlementTime *date.YYYYMMDDHHMMSS `json:"settlement_time"` PaymentMethod *string `json:"payment_method"` Status string `json:"status"` IsInvoice bool `json:"is_invoice"` TxRefNumber *string `json:"tx_ref_number"` Description string `json:"description"` Email string `json:"email"` Expiration *date.YYYYMMDDHHMMSS `json:"expiration"` Created date.YYYYMMDDHHMMSS `json:"created"` Updated date.YYYYMMDDHHMMSS `json:"updated"` }
type CheckoutGet ¶
type CheckoutResult ¶
type DisbursementCallback ¶
type DisbursementCallback struct { Status DisbursementStatus `json:"status" form:"status"` //Status of Payout in Object {code: <status_code>, message: <status_message>} TxStatusDescription string `json:"tx_status_description" form:"tx_status_description"` //additional information of status code (e.g. FORCE CREDIT) Amount float64 `json:"amount" form:"amount"` //Amount of disbursement (Accept Non-Decimal Number) RecipientName string `json:"recipient_name" form:"recipient_name"` //Account holder name of Beneficiary account number RecipientBank BankCode `json:"recipient_bank" form:"recipient_bank"` //Bank Code of the Beneficiary account, see Disbursement Bank Codes RecipientAccount string `json:"recipient_account" form:"recipient_account"` //Beneficiary account number TrxId string `json:"trx_id" form:"trx_id"` //Unique Payout ID from OY!. Partner can use this ID for settlement PartnerTrxId string `json:"partner_trx_id" form:"partner_trx_id"` //Unique Payout ID which partner put on the Request, generated by partner Timestamp string `json:"timestamp" form:"timestamp"` //Execution time of API remit status in OY! system ("dd-MM-yyyy HH:mm:ss") CreatedDate string `json:"created_date" form:"created_date"` //Executionn time of Disbures in OY! system ("dd-MM-yyyy HH:mm:ss") LastUpdatedDate string `json:"last_updated_date" form:"last_updated_date"` //Latest status change of a disbursement. Example from 'Pending' to 'Success' ("dd-MM-yyyy HH:mm:ss") }
type DisbursementGet ¶
type DisbursementGet struct { Status DisbursementStatus `json:"status"` //Status of Payout in Object {code: <status_code>, message: <status_message>} TxStatusDescription string `json:"tx_status_description"` //additional information of status code (e.g. FORCE CREDIT) Amount float64 `json:"amount"` //Amount of disbursement (Accept Non-Decimal Number) RecipientName string `json:"recipient_name"` //Account holder name of Beneficiary account number RecipientBank BankCode `json:"recipient_bank"` //Bank Code of the Beneficiary account, see Disbursement Bank Codes RecipientAccount string `json:"recipient_account"` //Beneficiary account number TrxId string `json:"trx_id"` //Unique Payout ID from OY!. Partner can use this ID for settlement PartnerTrxId string `json:"partner_trx_id"` //Unique Payout ID which partner put on the Request, generated by partner Timestamp string `json:"timestamp"` //Execution time of API remit status in OY! system ("dd-MM-yyyy HH:mm:ss") CreatedDate string `json:"created_date"` //Executionn time of Disbures in OY! system ("dd-MM-yyyy HH:mm:ss") LastUpdatedDate string `json:"last_updated_date"` //Latest status change of a disbursement. Example from 'Pending' to 'Success' ("dd-MM-yyyy HH:mm:ss") }
type DisbursementResult ¶
type DisbursementResult struct { Status DisbursementStatus `json:"status"` //Status of Payout in Object {code: <status_code>, message: <status_message>} Amount *float64 `json:"amount"` //Amount of disbursement (Accept Non-Decimal Number) RecipientBank BankCode `json:"recipient_bank"` //Bank Code of the Beneficiary account, see Disbursement Bank Codes RecipientAccount string `json:"recipient_account"` //Beneficiary account number TrxId string `json:"trx_id"` //Unique Payout ID from OY!. Partner can use this ID for settlement PartnerTrxId string `json:"partner_trx_id"` //Unique Payout ID which partner put on the Request Timestamp *string `json:"timestamp"` //Execution time of Disbursement in OY! system ("dd-MM-yyyy HH:mm:ss"). }
type DisbursementStatus ¶
type Error ¶
type Error struct { Message string `json:"message,omitempty"` Url string `json:"url,omitempty"` Status int `json:"status,omitempty"` }
func FromHTTPErr ¶
FromHTTPErr generates oygo.Error from http errors with non 2xx status
type Option ¶
type Option struct { SecretKey string // customer's secret API key Username string // customer's username OyURL string // should there be a need to override API base URL }
Option is the wrap of the parameters needed for the API call
type ScheduledDisbursementCallback ¶
type ScheduledDisbursementCallback struct { Status ScheduledDisbursementStatus `json:"status" form:"status"` //Status of Payout in Object {code: <status_code>, message: <status_message>} TxStatusDescription string `json:"tx_status_description" form:"tx_status_description"` //additional information of status code (e.g. FORCE CREDIT) Amount float64 `json:"amount" form:"amount"` //Amount of disbursement (Accept Non-Decimal Number) RecipientName string `json:"recipient_name" form:"recipient_name"` //Account holder name of Beneficiary account number RecipientBank BankCode `json:"recipient_bank" form:"recipient_bank"` //Bank Code of the Beneficiary account, see ScheduledDisbursement Bank Codes RecipientAccount string `json:"recipient_account" form:"recipient_account"` //Beneficiary account number TrxId string `json:"trx_id" form:"trx_id"` //Unique Payout ID from OY!. Partner can use this ID for settlement PartnerTrxId string `json:"partner_trx_id" form:"partner_trx_id"` //Unique Payout ID which partner put on the Request, generated by partner ScheduledTrxStatus string `json:"scheduled_trx_status" form:"scheduled_trx_status"` //Status of scheduled disbursement ScheduleDate string `json:"schedule_date" form:"schedule_date"` //Date for scheduled non-trigger-based disburse in "dd-mm-yyyy" format. Null if scheduled disbursement is trigger-based IsTriggerBased bool `json:"is_trigger_based" form:"is_trigger_based"` //Whether scheduled transfer is trigger-based TriggerDate string `json:"trigger_date" form:"trigger_date"` //Date when the disburse can be claimed by Beneficiary in "dd-mm-yyyy" format. Null if scheduled disbursement is non-trigger-based TriggerEmail string `json:"trigger_email" form:"trigger_email"` //Email which the fund acceptance email and URL will be sent to. Null if scheduled disbursement is non-trigger-based Timestamp string `json:"timestamp" form:"timestamp"` //Execution time of API remit status in OY! system ("dd-MM-yyyy HH:mm:ss") CreatedDate string `json:"created_date" form:"created_date"` //Executionn time of Disbures in OY! system ("dd-MM-yyyy HH:mm:ss") LastUpdatedDate string `json:"last_updated_date" form:"last_updated_date"` //Latest status change of a disbursement. Example from 'Pending' to 'Success' ("dd-MM-yyyy HH:mm:ss") }
type ScheduledDisbursementGet ¶
type ScheduledDisbursementGet struct { Status ScheduledDisbursementStatus `json:"status"` //Status of Payout in Object {code: <status_code>, message: <status_message>} TxStatusDescription string `json:"tx_status_description"` //additional information of status code (e.g. FORCE CREDIT) Amount float64 `json:"amount"` //Amount of disbursement (Accept Non-Decimal Number) RecipientName string `json:"recipient_name"` //Account holder name of Beneficiary account number RecipientBank BankCode `json:"recipient_bank"` //Bank Code of the Beneficiary account, see ScheduledDisbursement Bank Codes RecipientAccount string `json:"recipient_account"` //Beneficiary account number TrxId string `json:"trx_id"` //Unique Payout ID from OY!. Partner can use this ID for settlement PartnerTrxId string `json:"partner_trx_id"` //Unique Payout ID which partner put on the Request, generated by partner ScheduledTrxStatus string `json:"scheduled_trx_status"` //Status of scheduled disbursement ScheduleDate string `json:"schedule_date"` //Date for scheduled non-trigger-based disburse in "dd-mm-yyyy" format. Null if scheduled disbursement is trigger-based IsTriggerBased bool `json:"is_trigger_based"` //Whether scheduled transfer is trigger-based TriggerDate string `json:"trigger_date"` //Date when the disburse can be claimed by Beneficiary in "dd-mm-yyyy" format. Null if scheduled disbursement is non-trigger-based TriggerEmail string `json:"trigger_email"` //Email which the fund acceptance email and URL will be sent to. Null if scheduled disbursement is non-trigger-based Timestamp time.Time `json:"timestamp"` //Execution time of API remit status in OY! system ("dd-MM-yyyy HH:mm:ss") }
type ScheduledDisbursementResult ¶
type ScheduledDisbursementResult struct { Status ScheduledDisbursementStatus `json:"status"` //Status of Payout in Object {code: <status_code>, message: <status_message>} Amount *float64 `json:"amount"` //Amount of disbursement (Accept Non-Decimal Number) RecipientBank BankCode `json:"recipient_bank"` //Bank Code of the Beneficiary account, see Disbursement Bank Codes RecipientAccount string `json:"recipient_account"` //Beneficiary account number PartnerTrxId string `json:"partner_trx_id"` //Unique Payout ID which partner put on the Request ScheduledTrxStatus string `json:"scheduled_trx_status"` //Status of scheduled disbursement ScheduleDate string `json:"schedule_date"` //Date for scheduled non-trigger-based disburse in "dd-mm-yyyy" format. Null if scheduled disbursement is trigger-based IsTriggerBased bool `json:"is_trigger_based"` //Whether scheduled transfer is trigger-based TriggerDate string `json:"trigger_date"` //Date when the disburse can be claimed by Beneficiary in "dd-mm-yyyy" format. Null if scheduled disbursement is non-trigger-based TriggerEmail string `json:"trigger_email"` //Email which the fund acceptance email and URL will be sent to. Null if scheduled disbursement is non-trigger-based Timestamp *string `json:"timestamp"` //Execution time of Disbursement in OY! system ("dd-MM-yyyy HH:mm:ss"). }