Documentation ¶
Index ¶
- Variables
- type Action
- type BCABankTransferDetail
- type BCABankTransferDetailFreeText
- type BCABankTransferLangDetail
- type BCAKlikBCADetail
- type BCAKlikPayDetail
- type Bank
- type BankTransferDetail
- type CIMBClicksDetail
- type CaptureReq
- type ChargeReq
- type ChargeReqWithMap
- type Client
- type ConvStoreDetail
- type CoreGateway
- func (gateway *CoreGateway) Approve(orderID string) (Response, error)
- func (gateway *CoreGateway) Call(method, path string, body io.Reader, v interface{}) error
- func (gateway *CoreGateway) Cancel(orderID string) (Response, error)
- func (gateway *CoreGateway) CaptureCard(req *CaptureReq) (Response, error)
- func (gateway *CoreGateway) Charge(req *ChargeReq) (Response, error)
- func (gateway *CoreGateway) ChargeWithMap(req *ChargeReqWithMap) (ResponseWithMap, error)
- func (gateway *CoreGateway) DirectRefund(orderID string, req *RefundReq) (Response, error)
- func (gateway *CoreGateway) Expire(orderID string) (Response, error)
- func (gateway *CoreGateway) PreauthCard(req *ChargeReq) (Response, error)
- func (gateway *CoreGateway) Refund(orderID string, req *RefundReq) (Response, error)
- func (gateway *CoreGateway) Status(orderID string) (Response, error)
- func (gateway *CoreGateway) StatusWithMap(orderID string) (ResponseWithMap, error)
- func (gateway *CoreGateway) Subscribe(req *SubscribeReq) (SubscribeResponse, error)
- func (gateway *CoreGateway) SubscribeDetail(subscriptionID string) (SubscribeResponse, error)
- func (gateway *CoreGateway) SubscribeDisable(subscriptionID string) (SubscribeResponse, error)
- func (gateway *CoreGateway) SubscribeEnable(subscriptionID string) (SubscribeResponse, error)
- func (gateway *CoreGateway) SubscribeUpdate(subscriptionID string, req *SubscribeReq) (SubscribeResponse, error)
- type CreditCardDetail
- type CustAddress
- type CustDetail
- type CustomExpiry
- type EnvironmentType
- type ExpiryDetail
- type GopayDetail
- type IndosatDompetkuDetail
- type InstallmentDetail
- type InstallmentTermsDetail
- type IrisApprovePayoutReq
- type IrisApprovePayoutResponse
- type IrisBalanceResponse
- type IrisBankAccountDetailErrorResponse
- type IrisBankAccountDetailResponse
- type IrisBeneficiaries
- type IrisBeneficiariesResponse
- type IrisBeneficiaryBankResponse
- type IrisBeneficiaryBanksResponse
- type IrisCreatePayoutDetailReq
- type IrisCreatePayoutDetailResponse
- type IrisCreatePayoutReq
- type IrisCreatePayoutResponse
- type IrisGateway
- func (gateway *IrisGateway) ApprovePayouts(req IrisApprovePayoutReq) (IrisApprovePayoutResponse, error)
- func (gateway *IrisGateway) Call(method, path string, body io.Reader, v interface{}) error
- func (gateway *IrisGateway) CheckBalance() (IrisBalanceResponse, error)
- func (gateway *IrisGateway) CreateBeneficiaries(req *IrisBeneficiaries) (bool, error)
- func (gateway *IrisGateway) CreatePayouts(req IrisCreatePayoutReq) (IrisCreatePayoutResponse, error)
- func (gateway *IrisGateway) GetListBeneficiaries() ([]IrisBeneficiaries, error)
- func (gateway *IrisGateway) GetListBeneficiaryBank() (IrisBeneficiaryBanksResponse, error)
- func (gateway *IrisGateway) GetPayoutDetails(referenceNo string) (IrisPayoutDetailResponse, error)
- func (gateway *IrisGateway) GetPayoutHistory(fromDate string, toDate string) ([]IrisPayoutDetailResponse, error)
- func (gateway *IrisGateway) RejectPayouts(req IrisRejectPayoutReq) (IrisRejectPayoutResponse, error)
- func (gateway *IrisGateway) UpdateBeneficiaries(aliasName string, req *IrisBeneficiaries) (bool, error)
- func (gateway *IrisGateway) ValidateBankAccount(bankName string, accountNo string) (IrisBankAccountDetailResponse, error)
- type IrisPayoutDetailResponse
- type IrisRejectPayoutReq
- type IrisRejectPayoutResponse
- type ItemDetail
- type MandiriBillBankTransferDetail
- type MandiriClickPayDetail
- type MandiriEcashDetail
- type PaymentType
- type PermataBankTransferDetail
- type Refund
- type RefundReq
- type Response
- type ResponseWithMap
- type ScheduleDetailReq
- type ScheduleDetailResponse
- type SnapGateway
- func (gateway *SnapGateway) Call(method, path string, body io.Reader, v interface{}) error
- func (gateway *SnapGateway) GetToken(r *SnapReq) (SnapResponse, error)
- func (gateway *SnapGateway) GetTokenQuick(orderID string, grossAmount float64) (SnapResponse, error)
- func (gateway *SnapGateway) GetTokenQuickWithMap(orderID string, grossAmount float64) (ResponseWithMap, error)
- func (gateway *SnapGateway) GetTokenWithMap(r *SnapReqWithMap) (ResponseWithMap, error)
- type SnapReq
- type SnapReqWithMap
- type SnapResponse
- type SubscribeReq
- type SubscribeResponse
- type TelkomselCashDetail
- type TransactionDetails
- type VANumber
Constants ¶
This section is empty.
Variables ¶
var AllPaymentSource = []PaymentType{ SourceGopay, SourceCreditCard, SourceMandiriClickpay, SourceCimbClicks, SourceDanamonOnline, SourceKlikBca, SourceBcaKlikpay, SourceBriEpay, SourceTelkomselCash, SourceEchannel, SourceIndosatDompetku, SourceMandiriEcash, SourceBNIVA, SourcePermataVA, SourceBCAVA, SourceIndomaret, SourceKioson, SourceGiftCardIndo, }
AllPaymentSource : Get All available PaymentType
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Name string `json:"name"` Method string `json:"method"` URL string `json:"url"` }
Action represents response action
type BCABankTransferDetail ¶
type BCABankTransferDetail struct { Bank Bank `json:"bank"` VaNumber string `json:"va_number,omitempty"` FreeText BCABankTransferDetailFreeText `json:"free_text"` SubCompanyCode string `json:"sub_company_code,omitempty"` }
BCABankTransferDetail : Represent BCA bank_transfer detail
type BCABankTransferDetailFreeText ¶
type BCABankTransferDetailFreeText struct { Inquiry []BCABankTransferLangDetail `json:"inquiry,omitempty"` Payment []BCABankTransferLangDetail `json:"payment,omitempty"` }
BCABankTransferDetailFreeText : Represent BCA bank_transfer detail free_text
type BCABankTransferLangDetail ¶
type BCABankTransferLangDetail struct { LangID string `json:"id,omitempty"` LangEN string `json:"en,omitempty"` }
BCABankTransferLangDetail : Represent BCA bank_transfer lang detail
type BCAKlikBCADetail ¶
BCAKlikBCADetail : Represent BCA KlikBCA detail
type BCAKlikPayDetail ¶
type BCAKlikPayDetail struct { // 1 = normal, 2 = installment, 3 = normal + installment Type string `json:"type"` Desc string `json:"description"` MiscFee int64 `json:"misc_fee,omitempty"` }
BCAKlikPayDetail : Represent Internet Banking for BCA KlikPay
type Bank ¶
type Bank string
Bank value
const ( //BankBni : bni BankBni Bank = "bni" //BankMandiri : mandiri BankMandiri Bank = "mandiri" //BankCimb : cimb BankCimb Bank = "cimb" //BankBca : bca BankBca Bank = "bca" //BankBri : bri BankBri Bank = "bri" //BankMaybank : maybank BankMaybank Bank = "maybank" //BankPermata : permata BankPermata Bank = "permata" )
type BankTransferDetail ¶
type BankTransferDetail struct { Bank Bank `json:"bank,omitempty"` VaNumber string `json:"va_number,omitempty"` FreeText *BCABankTransferDetailFreeText `json:"free_text,omitempty"` *MandiriBillBankTransferDetail }
BankTransferDetail : Represent bank_transfer detail
type CIMBClicksDetail ¶
type CIMBClicksDetail struct {
Desc string `json:"description"`
}
CIMBClicksDetail : Represent CIMB Clicks detail
type CaptureReq ¶
type CaptureReq struct { TransactionID string `json:"transaction_id"` GrossAmt float64 `json:"gross_amount"` }
CaptureReq : Represent Capture request payload
type ChargeReq ¶
type ChargeReq struct { PaymentType PaymentType `json:"payment_type"` TransactionDetails TransactionDetails `json:"transaction_details"` CreditCard *CreditCardDetail `json:"credit_card,omitempty"` BankTransfer *BankTransferDetail `json:"bank_transfer,omitempty"` MandiriBillBankTransferDetail *MandiriBillBankTransferDetail `json:"echannel,omitempty"` BCAKlikPay *BCAKlikPayDetail `json:"bca_klikpay,omitempty"` BCAKlikBCA *BCAKlikBCADetail `json:"bca_klikbca,omitempty"` MandiriClickPay *MandiriClickPayDetail `json:"mandiri_clickpay,omitempty"` MandiriEcash *MandiriEcashDetail `json:"mandiri_ecash,omitempty"` CIMBClicks *CIMBClicksDetail `json:"cimb_clicks,omitempty"` TelkomselCash *TelkomselCashDetail `json:"telkomsel_cash,omitempty"` IndosatDompetku *IndosatDompetkuDetail `json:"indosat_dompetku,omitempty"` CustomerDetail *CustDetail `json:"customer_details,omitempty"` ConvStore *ConvStoreDetail `json:"cstore,omitempty"` Gopay *GopayDetail `json:"gopay,omitempty"` Items *[]ItemDetail `json:"item_details,omitempty"` CustField1 string `json:"custom_field1,omitempty"` CustField2 string `json:"custom_field2,omitempty"` CustField3 string `json:"custom_field3,omitempty"` CustomExpiry *CustomExpiry `json:"custom_expiry,omitempty"` }
ChargeReq : Represent Charge request payload
type ChargeReqWithMap ¶
type ChargeReqWithMap map[string]interface{}
ChargeReqWithMap : Represent Charge request with map payload
type Client ¶
type Client struct { APIEnvType EnvironmentType ClientKey string ServerKey string LogLevel int Logger *log.Logger }
Client struct
func NewClient ¶
func NewClient() Client
NewClient : this function will always be called when the library is in use
func (*Client) Call ¶
Call the Midtrans API at specific `path` using the specified HTTP `method`. The result will be given to `v` if there is no error. If any error occurred, the return of this function is the error itself, otherwise nil.
func (*Client) ExecuteRequest ¶
ExecuteRequest : execute request
type ConvStoreDetail ¶
ConvStoreDetail : Represent cstore detail
type CoreGateway ¶
type CoreGateway struct {
Client Client
}
CoreGateway struct
func (*CoreGateway) Approve ¶
func (gateway *CoreGateway) Approve(orderID string) (Response, error)
Approve : Approve order using order ID
func (*CoreGateway) Call ¶
func (gateway *CoreGateway) Call(method, path string, body io.Reader, v interface{}) error
Call : base method to call Core API
func (*CoreGateway) Cancel ¶
func (gateway *CoreGateway) Cancel(orderID string) (Response, error)
Cancel : Cancel order using order ID
func (*CoreGateway) CaptureCard ¶
func (gateway *CoreGateway) CaptureCard(req *CaptureReq) (Response, error)
CaptureCard : Capture an authorized transaction for card payment
func (*CoreGateway) Charge ¶
func (gateway *CoreGateway) Charge(req *ChargeReq) (Response, error)
Charge : Perform transaction using ChargeReq
func (*CoreGateway) ChargeWithMap ¶
func (gateway *CoreGateway) ChargeWithMap(req *ChargeReqWithMap) (ResponseWithMap, error)
ChargeWithMap : Perform transaction using ChargeReqWithMap
func (*CoreGateway) DirectRefund ¶
func (gateway *CoreGateway) DirectRefund(orderID string, req *RefundReq) (Response, error)
DirectRefund : refund order using order ID
func (*CoreGateway) Expire ¶
func (gateway *CoreGateway) Expire(orderID string) (Response, error)
Expire : change order status to expired using order ID
func (*CoreGateway) PreauthCard ¶
func (gateway *CoreGateway) PreauthCard(req *ChargeReq) (Response, error)
PreauthCard : Perform authorized transactions using ChargeReq
func (*CoreGateway) Refund ¶
func (gateway *CoreGateway) Refund(orderID string, req *RefundReq) (Response, error)
Refund : refund order using order ID
func (*CoreGateway) Status ¶
func (gateway *CoreGateway) Status(orderID string) (Response, error)
Status : get order status using order ID
func (*CoreGateway) StatusWithMap ¶
func (gateway *CoreGateway) StatusWithMap(orderID string) (ResponseWithMap, error)
StatusWithMap : get order status using order ID
func (*CoreGateway) Subscribe ¶
func (gateway *CoreGateway) Subscribe(req *SubscribeReq) (SubscribeResponse, error)
Subscribe : Perform transaction using subscriptions
func (*CoreGateway) SubscribeDetail ¶
func (gateway *CoreGateway) SubscribeDetail(subscriptionID string) (SubscribeResponse, error)
SubscribeDetail : Perform get subscription details
func (*CoreGateway) SubscribeDisable ¶
func (gateway *CoreGateway) SubscribeDisable(subscriptionID string) (SubscribeResponse, error)
SubscribeDisable : Perform disable a subscription
func (*CoreGateway) SubscribeEnable ¶
func (gateway *CoreGateway) SubscribeEnable(subscriptionID string) (SubscribeResponse, error)
SubscribeEnable : Perform enable a subscription
func (*CoreGateway) SubscribeUpdate ¶
func (gateway *CoreGateway) SubscribeUpdate(subscriptionID string, req *SubscribeReq) (SubscribeResponse, error)
SubscribeUpdate : Perform update a subscription
type CreditCardDetail ¶
type CreditCardDetail struct { Secure string `json:"secure,omitempty"` TokenID string `json:"token_id"` Bank string `json:"bank,omitempty"` Bins []string `json:"bins,omitempty"` Installment *InstallmentDetail `json:"installment,omitempty"` InstallmentTerm int8 `json:"installment_term,omitempty"` Type string `json:"type,omitempty"` // indicate if generated token should be saved for next charge SaveTokenID bool `json:"save_token_id,omitempty"` SavedTokenIDExpireAt string `json:"saved_token_id_expired_at,omitempty"` Authentication string `json:"authentication,omitempty"` }
CreditCardDetail : Represent credit card detail
type CustAddress ¶
type CustAddress struct { FName string `json:"first_name"` LName string `json:"last_name"` Phone string `json:"phone"` Address string `json:"address"` City string `json:"city"` Postcode string `json:"postal_code"` CountryCode string `json:"country_code"` }
CustAddress : Represent the customer address
type CustDetail ¶
type CustDetail struct { // first name FName string `json:"first_name,omitempty"` // last name LName string `json:"last_name,omitempty"` Email string `json:"email,omitempty"` Phone string `json:"phone,omitempty"` BillAddr *CustAddress `json:"billing_address,omitempty"` ShipAddr *CustAddress `json:"customer_address,omitempty"` }
CustDetail : Represent the customer detail
type CustomExpiry ¶
type CustomExpiry struct { OrderTime string `json:"order_time,omitempty"` ExpiryDuration int `json:"expiry_duration,omitempty"` Unit string `json:"unit,omitempty"` }
CustomExpiry : Represent Core API custom_expiry
type EnvironmentType ¶
type EnvironmentType int8
EnvironmentType value
const ( // Sandbox : represent sandbox environment Sandbox EnvironmentType // Production : represent production environment Production )
func (EnvironmentType) IrisURL ¶
func (e EnvironmentType) IrisURL() string
IrisURL : Get environment API URL
func (EnvironmentType) SnapURL ¶
func (e EnvironmentType) SnapURL() string
SnapURL : Get environment API URL
type ExpiryDetail ¶
type ExpiryDetail struct { StartTime string `json:"start_time,omitempty"` Unit string `json:"unit"` Duration int64 `json:"duration"` }
ExpiryDetail : Represent SNAP expiry details
type GopayDetail ¶
type GopayDetail struct { EnableCallback bool `json:"enable_callback"` CallbackUrl string `json:"callback_url"` }
GopayDetail : Represent gopay detail
type IndosatDompetkuDetail ¶
type IndosatDompetkuDetail struct {
MSISDN string `json:"msisdn"`
}
IndosatDompetkuDetail : Represent Indosat Dompetku detail
type InstallmentDetail ¶
type InstallmentDetail struct { Required bool `json:"required"` Terms *InstallmentTermsDetail `json:"terms"` }
InstallmentDetail : Represent installment detail
type InstallmentTermsDetail ¶
type InstallmentTermsDetail struct { Bni []int8 `json:"bni,omitempty"` Mandiri []int8 `json:"mandiri,omitempty"` Cimb []int8 `json:"cimb,omitempty"` Mega []int8 `json:"mega,omitempty"` Bca []int8 `json:"bca,omitempty"` Bri []int8 `json:"bri,omitempty"` Maybank []int8 `json:"maybank,omitempty"` Offline []int8 `json:"offline,omitempty"` }
InstallmentTermsDetail : Represent installment available banks
type IrisApprovePayoutReq ¶
type IrisApprovePayoutReq struct { ReferenceNo []string `json:"reference_nos"` OTP string `json:"otp"` }
IrisApprovePayoutReq : Represent Approve Payout payload
type IrisApprovePayoutResponse ¶
type IrisApprovePayoutResponse struct { Status string `json:"status"` ErrorMessage string `json:"error_message"` Errors []string `json:"errors"` }
IrisApprovePayoutResponse : Represent Approve payout response payload
type IrisBalanceResponse ¶
type IrisBalanceResponse struct {
Balance string `json:"balance"`
}
IrisBalanceResponse : Represent balance detail response payload
type IrisBankAccountDetailErrorResponse ¶
type IrisBankAccountDetailErrorResponse struct { Account []string `json:"account"` Bank []string `json:"bank"` }
IrisBankAccountDetailErrorResponse : Represent Bank account detail error payload
type IrisBankAccountDetailResponse ¶
type IrisBankAccountDetailResponse struct { AccountName string `json:"account_name"` AccountNo string `json:"account_no"` BankName string `json:"bank_name"` ErrorMessage string `json:"error_message"` Errors *IrisBankAccountDetailErrorResponse `json:"errors"` }
IrisBankAccountDetailResponse : Represent Bank account detail payload
type IrisBeneficiaries ¶
type IrisBeneficiaries struct { Name string `json:"name"` Account string `json:"account"` Bank string `json:"bank"` AliasName string `json:"alias_name"` Email string `json:"email"` }
IrisBeneficiaries : Beneficiaries request (create, update, list) https://iris-docs.midtrans.com/#create-beneficiaries https://iris-docs.midtrans.com/#update-beneficiaries https://iris-docs.midtrans.com/#list-beneficiaries
type IrisBeneficiariesResponse ¶
type IrisBeneficiariesResponse struct { Status string `json:"status"` StatusCode string `json:"status_code"` Errors []string `json:"errors"` }
IrisBeneficiariesResponse : Represent Beneficiaries response payload
type IrisBeneficiaryBankResponse ¶
IrisBeneficiaryBankResponse : Represent Beneficiary bank response payload
type IrisBeneficiaryBanksResponse ¶
type IrisBeneficiaryBanksResponse struct { BeneficiaryBanks []IrisBeneficiaryBankResponse `json:"beneficiary_banks"` StatusCode string `json:"status_code"` }
IrisBeneficiaryBanksResponse : Show list of supported banks in IRIS. https://iris-docs.midtrans.com/#list-banks
type IrisCreatePayoutDetailReq ¶
type IrisCreatePayoutDetailReq struct { BeneficiaryName string `json:"beneficiary_name"` BeneficiaryAccount string `json:"beneficiary_account"` BeneficiaryBank string `json:"beneficiary_bank"` BeneficiaryEmail string `json:"beneficiary_email"` Amount string `json:"amount"` Notes string `json:"notes"` }
IrisCreatePayoutDetailReq : Represent Create Payout detail payload
type IrisCreatePayoutDetailResponse ¶
type IrisCreatePayoutDetailResponse struct { Status string `json:"status"` ReferenceNo string `json:"reference_no"` }
IrisCreatePayoutDetailResponse : Represent Create payout detail response payload
type IrisCreatePayoutReq ¶
type IrisCreatePayoutReq struct {
Payouts []IrisCreatePayoutDetailReq `json:"payouts"`
}
IrisCreatePayoutReq : Represent Create Payout request payload
type IrisCreatePayoutResponse ¶
type IrisCreatePayoutResponse struct { Payouts []IrisCreatePayoutDetailResponse `json:"payouts"` ErrorMessage string `json:"error_message"` Errors []string `json:"errors"` }
IrisCreatePayoutResponse : Represent Create payout response payload
type IrisGateway ¶
type IrisGateway struct {
Client Client
}
IrisGateway struct
func (*IrisGateway) ApprovePayouts ¶
func (gateway *IrisGateway) ApprovePayouts(req IrisApprovePayoutReq) (IrisApprovePayoutResponse, error)
ApprovePayouts : Use this API for Apporver to approve multiple payout request. (https://iris-docs.midtrans.com/#approve-payouts)
func (*IrisGateway) Call ¶
func (gateway *IrisGateway) Call(method, path string, body io.Reader, v interface{}) error
Call : base method to call IRIS API
func (*IrisGateway) CheckBalance ¶
func (gateway *IrisGateway) CheckBalance() (IrisBalanceResponse, error)
CheckBalance : Check Balance (Aggregator) (https://iris-docs.midtrans.com/#check-balance-aggregator)
func (*IrisGateway) CreateBeneficiaries ¶
func (gateway *IrisGateway) CreateBeneficiaries(req *IrisBeneficiaries) (bool, error)
CreateBeneficiaries : Create Beneficiaries (https://iris-docs.midtrans.com/#create-beneficiaries)
func (*IrisGateway) CreatePayouts ¶
func (gateway *IrisGateway) CreatePayouts(req IrisCreatePayoutReq) (IrisCreatePayoutResponse, error)
CreatePayouts : This API is for Creator to create a payout. It can be used for single payout and also multiple payouts. (https://iris-docs.midtrans.com/#create-payouts)
func (*IrisGateway) GetListBeneficiaries ¶
func (gateway *IrisGateway) GetListBeneficiaries() ([]IrisBeneficiaries, error)
GetListBeneficiaries : Get List Beneficiaries (https://iris-docs.midtrans.com/#list-beneficiaries)
func (*IrisGateway) GetListBeneficiaryBank ¶
func (gateway *IrisGateway) GetListBeneficiaryBank() (IrisBeneficiaryBanksResponse, error)
GetListBeneficiaryBank : Show list of supported banks in IRIS. (https://iris-docs.midtrans.com/#list-banks)
func (*IrisGateway) GetPayoutDetails ¶
func (gateway *IrisGateway) GetPayoutDetails(referenceNo string) (IrisPayoutDetailResponse, error)
GetPayoutDetails : Get details of a single payout (https://iris-docs.midtrans.com/#get-payout-details)
func (*IrisGateway) GetPayoutHistory ¶
func (gateway *IrisGateway) GetPayoutHistory(fromDate string, toDate string) ([]IrisPayoutDetailResponse, error)
GetPayoutHistory : Returns all the payout details for specific dates (https://iris-docs.midtrans.com/#payout-history)
func (*IrisGateway) RejectPayouts ¶
func (gateway *IrisGateway) RejectPayouts(req IrisRejectPayoutReq) (IrisRejectPayoutResponse, error)
RejectPayouts : Use this API for Apporver to reject multiple payout request. (https://iris-docs.midtrans.com/#reject-payouts)
func (*IrisGateway) UpdateBeneficiaries ¶
func (gateway *IrisGateway) UpdateBeneficiaries(aliasName string, req *IrisBeneficiaries) (bool, error)
UpdateBeneficiaries : Update Beneficiaries (https://iris-docs.midtrans.com/#update-beneficiaries)
func (*IrisGateway) ValidateBankAccount ¶
func (gateway *IrisGateway) ValidateBankAccount(bankName string, accountNo string) (IrisBankAccountDetailResponse, error)
ValidateBankAccount : Check if an account is valid, if valid return account information. (https://iris-docs.midtrans.com/#validate-bank-account)
type IrisPayoutDetailResponse ¶
type IrisPayoutDetailResponse struct { Amount string `json:"amount"` BeneficiaryName string `json:"beneficiary_name"` BeneficiaryAccount string `json:"beneficiary_account"` Bank string `json:"bank"` ReferenceNo string `json:"reference_no"` Notes string `json:"notes"` BeneficiaryEmail string `json:"beneficiary_email"` Status string `json:"status"` CreatedBy string `json:"created_by"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ErrorMessage string `json:"error_message"` Errors string `json:"errors"` }
IrisPayoutDetailResponse : Represent Payout detail response payload
type IrisRejectPayoutReq ¶
type IrisRejectPayoutReq struct { ReferenceNo []string `json:"reference_nos"` RejectReason string `json:"reject_reason"` }
IrisRejectPayoutReq : Represent Reject Payout payload
type IrisRejectPayoutResponse ¶
type IrisRejectPayoutResponse struct { Status string `json:"status"` ErrorMessage string `json:"error_message"` Errors []string `json:"errors"` }
IrisRejectPayoutResponse : Represent Reject payout response payload
type ItemDetail ¶
type ItemDetail struct { ID string `json:"id"` Name string `json:"name"` Price float64 `json:"price"` Qty int32 `json:"quantity"` Brand string `json:"brand,omitempty"` Category string `json:"category,omitempty"` MerchantName string `json:"merchant_name,omitempty"` }
ItemDetail : Represent the transaction details
type MandiriBillBankTransferDetail ¶
type MandiriBillBankTransferDetail struct { BillInfo1 string `json:"bill_info1,omitempty"` BillInfo2 string `json:"bill_info2,omitempty"` }
MandiriBillBankTransferDetail : Represent Mandiri Bill bank_transfer detail
type MandiriClickPayDetail ¶
type MandiriClickPayDetail struct { TokenID string `json:"token_id"` Input1 string `json:"input1"` Input2 string `json:"input2"` Input3 string `json:"input3"` Token string `json:"token"` }
MandiriClickPayDetail : Represent Mandiri ClickPay detail
type MandiriEcashDetail ¶
type MandiriEcashDetail struct {
Desc string `json:"description"`
}
MandiriEcashDetail : Represent Mandiri e-Cash detail
type PaymentType ¶
type PaymentType string
PaymentType value
const ( // SourceBankTransfer : bank_transfer SourceBankTransfer PaymentType = "bank_transfer" // SourceBNIVA : bni_va SourceBNIVA PaymentType = "bni_va" // SourcePermataVA : permata_va SourcePermataVA PaymentType = "permata_va" // SourceBCAVA : bca_va SourceBCAVA PaymentType = "bca_va" // SourceOtherVA : other_va SourceOtherVA PaymentType = "other_va" // SourceBcaKlikpay : bca_klikpay SourceBcaKlikpay PaymentType = "bca_klikpay" // SourceBriEpay : bri_epay SourceBriEpay PaymentType = "bri_epay" // SourceCreditCard : credit_card SourceCreditCard PaymentType = "credit_card" // SourceCimbClicks : cimb_clicks SourceCimbClicks PaymentType = "cimb_clicks" // SourceDanamonOnline : danamon_online SourceDanamonOnline PaymentType = "danamon_online" // SourceConvStore : cstore SourceConvStore PaymentType = "cstore" // SourceKlikBca : bca_klikbca SourceKlikBca PaymentType = "bca_klikbca" // SourceEchannel : echannel SourceEchannel PaymentType = "echannel" // SourceMandiriClickpay : mandiri_clickpay SourceMandiriClickpay PaymentType = "mandiri_clickpay" // SourceTelkomselCash : telkomsel_cash SourceTelkomselCash PaymentType = "telkomsel_cash" // SourceIndosatDompetku : indosat_dompetku SourceIndosatDompetku PaymentType = "indosat_dompetku" // SourceMandiriEcash : mandiri_ecash SourceMandiriEcash PaymentType = "mandiri_ecash" // SourceKioson : kioson SourceKioson PaymentType = "kioson" // SourceIndomaret : indomaret SourceIndomaret PaymentType = "indomaret" // SourceAlfamart : alfamart SourceAlfamart PaymentType = "alfamart" // SourceGiftCardIndo : gci SourceGiftCardIndo PaymentType = "gci" // SourceGopay : gopay SourceGopay PaymentType = "gopay" // SourceAkulaku : akulaku SourceAkulaku PaymentType = "akulaku" )
type PermataBankTransferDetail ¶
type PermataBankTransferDetail struct {
Bank Bank `json:"bank"`
}
PermataBankTransferDetail : Represent Permata bank_transfer detail
type Refund ¶
type Refund struct { RefundChargebackID int `json:"refund_chargeback_id"` RefundAmount string `json:"refund_amount"` Reason string `json:"reason"` RefundKey string `json:"refund_key"` RefundMethod string `json:"refund_method"` BankConfirmedAt string `json:"bank_confirmed_at"` CreatedAt string `json:"created_at"` }
Refund Details
type RefundReq ¶
type RefundReq struct { RefundKey string `json:"refund_key"` Amount int64 `json:"amount"` Reason string `json:"reason"` }
RefundReq : Represent Refund request payload
type Response ¶
type Response struct { StatusCode string `json:"status_code"` StatusMessage string `json:"status_message"` PermataVaNumber string `json:"permata_va_number"` SignKey string `json:"signature_key"` CardToken string `json:"token_id"` SavedCardToken string `json:"saved_token_id"` SavedTokenExpAt string `json:"saved_token_id_expired_at"` SecureToken bool `json:"secure_token"` Bank string `json:"bank"` BillerCode string `json:"biller_code"` BillKey string `json:"bill_key"` XlTunaiOrderID string `json:"xl_tunai_order_id"` BIIVaNumber string `json:"bii_va_number"` ReURL string `json:"redirect_url"` ECI string `json:"eci"` ValMessages []string `json:"validation_messages"` Page int `json:"page"` TotalPage int `json:"total_page"` TotalRecord int `json:"total_record"` FraudStatus string `json:"fraud_status"` PaymentType string `json:"payment_type"` OrderID string `json:"order_id"` TransactionID string `json:"transaction_id"` TransactionTime string `json:"transaction_time"` TransactionStatus string `json:"transaction_status"` GrossAmount string `json:"gross_amount"` VANumbers []VANumber `json:"va_numbers"` PaymentCode string `json:"payment_code"` Store string `json:"store"` MerchantID string `json:"merchant_id"` MaskedCard string `json:"masked_card"` Currency string `json:"currency"` CardType string `json:"card_type"` Actions []Action `json:"actions"` RefundChargebackID int `json:"refund_chargeback_id"` RefundAmount string `json:"refund_amount"` RefundKey string `json:"refund_key"` Refunds []Refund `json:"refunds"` }
Response after calling the API
type ResponseWithMap ¶
type ResponseWithMap map[string]interface{}
ResponseWithMap after calling the API
type ScheduleDetailReq ¶
type ScheduleDetailReq struct { Interval int `json:"interval"` IntervalUnit string `json:"interval_unit"` }
ScheduleDetailReq : Represent Schedule object payload
type ScheduleDetailResponse ¶
type SnapGateway ¶
type SnapGateway struct {
Client Client
}
SnapGateway struct
func (*SnapGateway) Call ¶
func (gateway *SnapGateway) Call(method, path string, body io.Reader, v interface{}) error
Call : base method to call Snap API
func (*SnapGateway) GetToken ¶
func (gateway *SnapGateway) GetToken(r *SnapReq) (SnapResponse, error)
GetToken : Get token by consuming SnapReq
func (*SnapGateway) GetTokenQuick ¶
func (gateway *SnapGateway) GetTokenQuick(orderID string, grossAmount float64) (SnapResponse, error)
GetTokenQuick : Quickly get token without constructing the body manually
func (*SnapGateway) GetTokenQuickWithMap ¶
func (gateway *SnapGateway) GetTokenQuickWithMap(orderID string, grossAmount float64) (ResponseWithMap, error)
GetTokenQuickWithMap : Quickly get token without constructing the body manually
func (*SnapGateway) GetTokenWithMap ¶
func (gateway *SnapGateway) GetTokenWithMap(r *SnapReqWithMap) (ResponseWithMap, error)
GetTokenWithMap : Get token by consuming SnapReqWithMap
type SnapReq ¶
type SnapReq struct { TransactionDetails TransactionDetails `json:"transaction_details"` EnabledPayments []PaymentType `json:"enabled_payments"` Items *[]ItemDetail `json:"item_details,omitempty"` CustomerDetail *CustDetail `json:"customer_details,omitempty"` Expiry *ExpiryDetail `json:"expiry,omitempty"` CreditCard *CreditCardDetail `json:"credit_card,omitempty"` Gopay *GopayDetail `json:"gopay,omitempty"` CustomField1 string `json:"custom_field1"` CustomField2 string `json:"custom_field2"` CustomField3 string `json:"custom_field3"` BCAVA BCABankTransferDetail `json:"bca_va,omitempty"` }
SnapReq : Represent SNAP API request payload
type SnapReqWithMap ¶
type SnapReqWithMap map[string]interface{}
SnapReqWithMap : Represent snap request with map payload
type SnapResponse ¶
type SnapResponse struct { StatusCode string `json:"status_code"` Token string `json:"token"` RedirectURL string `json:"redirect_url"` ErrorMessages []string `json:"error_messages,omitempty"` }
SnapResponse : Response after calling the Snap API
type SubscribeReq ¶
type SubscribeReq struct { Name string `json:"name"` Amount string `json:"amount"` Currency string `json:"currency"` Token string `json:"token"` PaymentType PaymentType `json:"payment_type"` Schedule ScheduleDetailReq `json:"schedule"` }
SubscribeReq : Represent Subscribe object payload (request and response)
type SubscribeResponse ¶
type SubscribeResponse struct { ID string `json:"id"` CreatedAt string `json:"created_at"` Status string `json:"status"` Name string `json:"name"` Amount string `json:"amount"` Currency string `json:"currency"` Token string `json:"token"` PaymentType PaymentType `json:"payment_type"` Schedule ScheduleDetailResponse `json:"schedule"` StatusMessage string `json:"status_message"` TransactionIDs []string `json:"transaction_ids"` }
type TelkomselCashDetail ¶
type TelkomselCashDetail struct { Promo bool `json:"promo"` IsReversal int8 `json:"is_reversal"` Customer string `json:"customer"` }
TelkomselCashDetail : Represent Telkomsel Cash detail
type TransactionDetails ¶
type TransactionDetails struct { OrderID string `json:"order_id"` GrossAmt float64 `json:"gross_amount"` }
TransactionDetails : Represent transaction details