Documentation ¶
Overview ¶
* File Created: Saturday, 29th July 2023 10:39:48 pm * Author: Abdul Hamid (abdul.surel@gmail.com) * * Copyright (c) 2023 Author
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HeaderIdempotencyKey ¶
HeaderIdempotencyKey returns X-Idempotency-Key & idempotency-key values for DurianPay idempotency purposes. Difference about X-Idempotency-Key and idempotency-key you can read on [Docs Idempotent] https://durianpay.id/docs/integration/disbursements/idempotent/
Types ¶
type Api ¶
type Api interface {
Req(ctx context.Context, method string, url string, param any, body any, headers map[string]string, response any) *durianpay.Error
}
Api interface build for dependecy injection and testing.
type ApiImplement ¶
type ApiImplement struct {
ServerKey string
}
func NewAPI ¶
func NewAPI(serverKey string) *ApiImplement
func (*ApiImplement) Req ¶
func (c *ApiImplement) Req(ctx context.Context, method string, url string, param any, body any, headers map[string]string, response any) *durianpay.Error
Req is an http request made specifically to hit the DurianPay endpoint. If the HTTP status code returned is not 2xx then an error will be returned
Click to show internal directories.
Click to hide internal directories.