Documentation ¶
Index ¶
- func CreateDirectDebitPayment(data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func CreateDirectDebitPaymentWithContext(ctx context.Context, data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func GetDirectDebitPaymentStatusByID(data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func GetDirectDebitPaymentStatusByIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func GetDirectDebitPaymentStatusByReferenceID(data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
- func GetDirectDebitPaymentStatusByReferenceIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
- func ValidateOTPForDirectDebitPayment(data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func ValidateOTPForDirectDebitPaymentWithContext(ctx context.Context, data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- type Client
- func (c *Client) CreateDirectDebitPayment(data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func (c *Client) CreateDirectDebitPaymentWithContext(ctx context.Context, data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func (c *Client) GetDirectDebitPaymentStatusByID(data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func (c *Client) GetDirectDebitPaymentStatusByIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func (c *Client) GetDirectDebitPaymentStatusByReferenceID(data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
- func (c *Client) GetDirectDebitPaymentStatusByReferenceIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
- func (c *Client) ValidateOTPForDirectDebitPayment(data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- func (c *Client) ValidateOTPForDirectDebitPaymentWithContext(ctx context.Context, data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
- type CreateDirectDebitPaymentParams
- type DirectDebitPaymentResponse
- type GetDirectDebitPaymentStatusByIDParams
- type GetDirectDebitPaymentStatusByReferenceIDParams
- type ValidateOTPForDirectDebitPaymentParams
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirectDebitPayment ¶
func CreateDirectDebitPayment(data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
CreateDirectDebitPayment created new direct debit payment
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" metadata := map[string]interface{}{ "meta": "data", } data := directdebitpayment.CreateDirectDebitPaymentParams{ IdempotencyKey: "idem-key", ReferenceID: "test-ref-id", PaymentMethodID: "test-pm-id", Currency: "IDR", Amount: 15000, CallbackURL: "http://webhook.site", EnableOTP: true, Description: "Test description", Basket: []xendit.DirectDebitBasketItem{ { ReferenceID: "basket-product-ref-id", Name: "product-name", Category: "mechanics", Market: "ID", Price: 50000, Quantity: 5, Type: "product type", SubCategory: "product sub category", Description: "product description", URL: "https://product.url", }, }, Device: xendit.DirectDebitDevice{ ID: "device-id", IPAddress: "0.0.0.0", UserAgent: "user-agent", ADID: "ad-id", Imei: "123a456b789c", }, SuccessRedirectURL: "https://success-redirect.url", FailureRedirectURL: "https://failure-redirect.url", Metadata: metadata, } resp, err := directdebitpayment.CreateDirectDebitPayment(&data) if err != nil { log.Fatal(err) } fmt.Printf("created direct debit payment: %+v\n", resp)
Output:
func CreateDirectDebitPaymentWithContext ¶
func CreateDirectDebitPaymentWithContext(ctx context.Context, data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
CreateDirectDebitPaymentWithContext created new direct debit payment
func GetDirectDebitPaymentStatusByID ¶
func GetDirectDebitPaymentStatusByID(data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByID gets direct debit payment status by ID
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" data := directdebitpayment.GetDirectDebitPaymentStatusByIDParams{ ID: "test-ddpy-id", } resp, err := directdebitpayment.GetDirectDebitPaymentStatusByID(&data) if err != nil { log.Fatal(err) } fmt.Printf("retrieved direct debit payment: %+v\n", resp)
Output:
func GetDirectDebitPaymentStatusByIDWithContext ¶
func GetDirectDebitPaymentStatusByIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByIDWithContext gets direct debit payment status by ID
func GetDirectDebitPaymentStatusByReferenceID ¶
func GetDirectDebitPaymentStatusByReferenceID(data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByReferenceID gets direct debit payment status by reference ID
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" data := directdebitpayment.GetDirectDebitPaymentStatusByReferenceIDParams{ ReferenceID: "test-ddpy-ref-id", } resp, err := directdebitpayment.GetDirectDebitPaymentStatusByReferenceID(&data) if err != nil { log.Fatal(err) } fmt.Printf("retrieved direct debit payments: %+v\n", resp)
Output:
func GetDirectDebitPaymentStatusByReferenceIDWithContext ¶
func GetDirectDebitPaymentStatusByReferenceIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByReferenceIDWithContext gets direct debit payment status by reference ID
func ValidateOTPForDirectDebitPayment ¶
func ValidateOTPForDirectDebitPayment(data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
ValidateOTPForDirectDebitPayment validate OTP for direct debit payment
Example ¶
xendit.Opt.SecretKey = "examplesecretkey" data := directdebitpayment.ValidateOTPForDirectDebitPaymentParams{ DirectDebitID: "test-ddpy-id", OTPCode: "333000", } resp, err := directdebitpayment.ValidateOTPForDirectDebitPayment(&data) if err != nil { log.Fatal(err) } fmt.Printf("validated direct debit payment: %+v\n", resp)
Output:
func ValidateOTPForDirectDebitPaymentWithContext ¶
func ValidateOTPForDirectDebitPaymentWithContext(ctx context.Context, data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
ValidateOTPForDirectDebitPaymentWithContext validate OTP for direct debit payment
Types ¶
type Client ¶
type Client struct { Opt *xendit.Option APIRequester xendit.APIRequester }
Client is the client used to invoke direct debit (linked account) API.
func (*Client) CreateDirectDebitPayment ¶
func (c *Client) CreateDirectDebitPayment(data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
CreateDirectDebitPayment created new direct debit payment
func (*Client) CreateDirectDebitPaymentWithContext ¶
func (c *Client) CreateDirectDebitPaymentWithContext(ctx context.Context, data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
CreateDirectDebitPaymentWithContext created new direct debit payment
func (*Client) GetDirectDebitPaymentStatusByID ¶
func (c *Client) GetDirectDebitPaymentStatusByID(data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByID gets direct debit payment status by ID
func (*Client) GetDirectDebitPaymentStatusByIDWithContext ¶
func (c *Client) GetDirectDebitPaymentStatusByIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByIDWithContext gets direct debit payment status by ID
func (*Client) GetDirectDebitPaymentStatusByReferenceID ¶
func (c *Client) GetDirectDebitPaymentStatusByReferenceID(data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByReferenceID gets direct debit payment status by reference ID
func (*Client) GetDirectDebitPaymentStatusByReferenceIDWithContext ¶
func (c *Client) GetDirectDebitPaymentStatusByReferenceIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error)
GetDirectDebitPaymentStatusByReferenceIDWithContext gets direct debit payment status by reference ID
func (*Client) ValidateOTPForDirectDebitPayment ¶
func (c *Client) ValidateOTPForDirectDebitPayment(data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
ValidateOTPForDirectDebitPayment validate OTP for direct debit payment
func (*Client) ValidateOTPForDirectDebitPaymentWithContext ¶
func (c *Client) ValidateOTPForDirectDebitPaymentWithContext(ctx context.Context, data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error)
ValidateOTPForDirectDebitPayment validate OTP for direct debit payment
type CreateDirectDebitPaymentParams ¶
type CreateDirectDebitPaymentParams struct { IdempotencyKey string `json:"-"` ForUserID string `json:"-"` ReferenceID string `json:"reference_id" validate:"required"` PaymentMethodID string `json:"payment_method_id" validate:"required"` Currency string `json:"currency" validate:"required"` Amount float64 `json:"amount" validate:"required"` CallbackURL string `json:"callback_url,omitempty"` EnableOTP bool `json:"enable_otp,omitempty"` Description string `json:"description,omitempty"` Device xendit.DirectDebitDevice `json:"device,omitempty"` Basket []xendit.DirectDebitBasketItem `json:"basket,omitempty"` SuccessRedirectURL string `json:"success_redirect_url,omitempty"` FailureRedirectURL string `json:"failure_redirect_url,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
CreateDirectDebitPaymentParams contains parameters for CreateDirectDebitPayment
type DirectDebitPaymentResponse ¶
type DirectDebitPaymentResponse struct { ID string `json:"id"` ReferenceID string `json:"reference_id"` ChannelCode xendit.ChannelCodeEnum `json:"channel_code"` PaymentMethodID string `json:"payment_method_id"` Currency string `json:"currency"` Amount float64 `json:"amount"` Description string `json:"description"` Status string `json:"status"` FailureCode string `json:"failure_code"` IsOTPRequired bool `json:"is_otp_required"` OTPMobileNumber string `json:"otp_mobile_number"` OTPExpirationTimestamp string `json:"otp_expiration_timestamp"` Created string `json:"created"` Updated string `json:"updated"` Basket []xendit.DirectDebitBasketItem `json:"basket"` Metadata map[string]interface{} `json:"metadata"` Device xendit.DirectDebitDevice `json:"device"` RefundedAmount float64 `json:"refunded_amount"` Refunds xendit.DirectDebitRefunds `json:"refunds"` SuccessRedirectURL string `json:"success_redirect_url"` CheckoutURL string `json:"checkout_url"` FailureRedirectURL string `json:"failure_redirect_url"` RequiredAction string `json:"required_action"` }
type GetDirectDebitPaymentStatusByIDParams ¶
type GetDirectDebitPaymentStatusByIDParams struct { ForUserID string `json:"-"` ID string `json:"id" validate:"required"` }
GetDirectDebitPaymentStatusByIDParams contains parameters for GetDirectDebitPaymentStatusByID
type GetDirectDebitPaymentStatusByReferenceIDParams ¶
type GetDirectDebitPaymentStatusByReferenceIDParams struct { ForUserID string `json:"-"` ReferenceID string `json:"reference_id" validate:"required"` }
GetDirectDebitPaymentStatusByReferenceIDParams contains parameters for GetDirectDebitPaymentStatusByReferenceID
func (*GetDirectDebitPaymentStatusByReferenceIDParams) QueryString ¶
func (p *GetDirectDebitPaymentStatusByReferenceIDParams) QueryString() string
QueryString creates query string from GetDirectDebitPaymentStatusByReferenceIDParams, ignores nil values
type ValidateOTPForDirectDebitPaymentParams ¶
type ValidateOTPForDirectDebitPaymentParams struct { ForUserID string `json:"-"` DirectDebitID string `json:"direct_debit_id" validate:"required"` OTPCode string `json:"otp_code" validate:"required"` }
ValidateOTPForDirectDebitPaymentParams contains parameters for ValidateOTPForDirectDebitPayment