Documentation ¶
Overview ¶
Package client provides a Xendit client for invoking APIs across all products
Example ¶
This example shows the usage of Xendit's API client
package main import ( "fmt" "log" "github.com/xendit/xendit-go/client" "github.com/xendit/xendit-go/invoice" ) func main() { api := client.New("examplesecretkey") data := invoice.GetParams{ ID: "invoice-id", } resp, err := api.Invoice.Get(&data) if err != nil { log.Fatal(err) } fmt.Printf("retrieved invoice: %+v\n", resp) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Invoice *invoice.Client EWallet *ewallet.Client Balance *balance.Client RetailOutlet *retailoutlet.Client VirtualAccount *virtualaccount.Client Card *card.Client Payout *payout.Client RecurringPayment *recurringpayment.Client CardlessCredit *cardlesscredit.Client Disbursement *disbursement.Client // contains filtered or unexported fields }
API is the Xendit client which contains all products
func (*API) WithAPIRequester ¶
WithAPIRequester set custom APIRequester for Xendit Client Can be chained with constructor like below:
client.New(yourSecretKey).WithAPIRequester(yourCustomRequester)
func (*API) WithCustomHTTPClient ¶
WithCustomHTTPClient set custom HTTP Client for default API Requester Can be chained with constructor like below:
client.New(yourSecretKey).WithCustomHTTPClient(yourCustomHTTPClient)
func (*API) WithCustomURL ¶
WithCustomURL set custom xendit URL for Xendit Client Can be chained with constructor like below:
client.New(yourSecretKey).WithCustomURL(yourCustomURL)
Click to show internal directories.
Click to hide internal directories.