Skip to content

Commit

Permalink
Merge pull request #29 from xendit/docs/godoc
Browse files Browse the repository at this point in the history
Docs improvements
  • Loading branch information
stanleynguyen authored Mar 4, 2020
2 parents 43c8181 + b5a9acd commit cf40ea5
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 287 deletions.
300 changes: 17 additions & 283 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Xendit API Go Client

This library is the abstraction of Xendit API for access from applications written with Go.
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/xendit/xendit-go)

---
This library is the abstraction of Xendit API for access from applications written with Go.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand All @@ -14,52 +14,7 @@ This library is the abstraction of Xendit API for access from applications writt
- [Usage](#usage)
- [Without Client](#without-client)
- [With Client](#with-client)
- [Packages Method Signatures](#packages-method-signatures)
- [Invoice](#invoice)
- [Create](#create)
- [Get](#get)
- [Expire](#expire)
- [GetAll](#getall)
- [E-Wallet](#e-wallet)
- [CreatePayment](#createpayment)
- [GetPaymentStatus](#getpaymentstatus)
- [Balance](#balance)
- [Get](#get-1)
- [Virtual Account](#virtual-account)
- [CreateFixedVA](#createfixedva)
- [GetFixedVA](#getfixedva)
- [UpdateFixedVA](#updatefixedva)
- [GetAvailableBanks](#getavailablebanks)
- [GetPayment](#getpayment)
- [Retail Outlet](#retail-outlet)
- [CreateFixedPaymentCode](#createfixedpaymentcode)
- [GetFixedPaymentCode](#getfixedpaymentcode)
- [UpdateFixedPaymentCode](#updatefixedpaymentcode)
- [Disbursement](#disbursement)
- [Create](#create-1)
- [GetByID](#getbyid)
- [GetByExternalID](#getbyexternalid)
- [GetAvailableBanks](#getavailablebanks-1)
- [CreateBatch](#createbatch)
- [Card](#card)
- [CreateCharge (Create Authorization)](#createcharge-create-authorization)
- [GetCharge](#getcharge)
- [CaptureCharge](#capturecharge)
- [CreateRefund](#createrefund)
- [ReverseAuthorization](#reverseauthorization)
- [Payout](#payout)
- [Create](#create-2)
- [Get](#get-2)
- [Expire](#expire-1)
- [Retail Outlet](#retail-outlet-1)
- [Create](#create-3)
- [Get](#get-3)
- [Edit](#edit)
- [Stop](#stop)
- [Pause](#pause)
- [Resume](#resume)
- [Cardless Credit](#cardless-credit)
- [CreatePayment](#createpayment-1)
- [Sub-Packages Documentations](#sub-packages-documentations)
- [Contribute](#contribute)
- [Test](#test)
- [Run all tests](#run-all-tests)
Expand All @@ -69,13 +24,11 @@ This library is the abstraction of Xendit API for access from applications writt

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

---

## Documentation

For the API documentation, check [Xendit API Reference](https://xendit.github.io/apireference).

For the details of this library, see the [GoDoc](http://godoc.org/github.com/xendit/xendit-go).
For the details of this library, see the [GoDoc](https://pkg.go.dev/github.com/xendit/xendit-go).

## Installation

Expand Down Expand Up @@ -147,7 +100,7 @@ resp, err := $product$.Create($product$.CreateParams)
resp, err := $product$.Get($product$.GetParams)

// GetAll
resp, err := $product$.Get($product$.GetAllParams)
resp, err := $product$.GetAll($product$.GetAllParams)
```

### With Client
Expand Down Expand Up @@ -176,239 +129,20 @@ resp, err := client.$product$.Get($product$.GetParams)
resp, err := client.$product$.GetAll($product$.GetAllParams)
```

### Packages Method Signatures

The following is a list of method signatures for each packages (for quick reference)

#### Invoice

##### Create

```go
invoice.Create(data *invoice.CreateParams) (*xendit.Invoice, *xendit.Error)
```

##### Get

```go
invoice.Get(data *invoice.GetParams) (*xendit.Invoice, *xendit.Error)
```

##### Expire

```go
invoice.Expire(data *invoice.ExpireParams) (*xendit.Invoice, *xendit.Error)
```

##### GetAll

```go
invoice.GetAll(data *invoice.GetAll) (*xendit.Invoice, *xendit.Error)
```

#### E-Wallet

##### CreatePayment

```go
ewallet.CreatePayment(data *ewallet.CreatePaymentParams) (*xendit.EWallet, *xendit.Error)
```

##### GetPaymentStatus

```go
ewallet.GetPaymentStatus(data *ewallet.GetPaymentStatusParams) (*xendit.EWallet, *xendit.Error)
```

#### Balance

##### Get

```go
balance.Get(data *balance.GetParams) (*xendit.Balance, *xendit.Error)
```

#### Virtual Account

##### CreateFixedVA

```go
virtualaccount.CreateFixedVA(data *virtualaccount.CreateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
```

##### GetFixedVA

```go
virtualaccount.GetFixedVA(data *virtualaccount.GetFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
```

##### UpdateFixedVA

```go
virtualaccount.UpdateFixedVA(data *virtualaccount.UpdateFixedVAParams) (*xendit.VirtualAccount, *xendit.Error)
```

##### GetAvailableBanks

```go
virtualaccount.GetAvailableBanks() ([]xendit.VirtualAccountBank, *xendit.Error)
```

##### GetPayment

```go
virtualaccount.GetPayment(data *virtualaccount.GetPaymentParams) (*xendit.VirtualAccountPayment, *xendit.Error)
```

#### Retail Outlet

##### CreateFixedPaymentCode

```go
retailoutlet.CreateFixedPaymentCode(data *retailoutlet.CreateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error)
```

##### GetFixedPaymentCode

```go
retailoutlet.GetFixedPaymentCode(data *retailoutlet.GetFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error)
```

##### UpdateFixedPaymentCode

```go
retailoutlet.UpdateFixedPaymentCode(data *retailoutlet.UpdateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error)
```

#### Disbursement

##### Create

```go
disbursement.Create(data *CreateParams) (*xendit.Disbursement, *xendit.Error)
```

##### GetByID

```go
disbursement.GetByID(data *GetByIDParams) (*xendit.Disbursement, *xendit.Error)
```

##### GetByExternalID

```go
disbursement.GetByExternalID(data *GetByExternalIDParams) ([]xendit.Disbursement, *xendit.Error)
```

##### GetAvailableBanks

```go
disbursement.GetAvailableBanks() ([]xendit.DisbursementBank, *xendit.Error)
```

##### CreateBatch

```go
disbursement.CreateBatch(data *CreateBatchParams) (*xendit.BatchDisbursement, *xendit.Error)
```

#### Card

##### CreateCharge (Create Authorization)

```go
card.CreateCharge(data *CreateChargeParams) (*xendit.CardCharge, *xendit.Error)
```

##### GetCharge

```go
card.GetCharge(data *GetChargeParams) (*xendit.CardCharge, *xendit.Error)
```

##### CaptureCharge

```go
card.CaptureCharge(data *CaptureChargeParams) (*xendit.CardCharge, *xendit.Error)
```

##### CreateRefund

```go
card.CreateRefund(data *CreateRefundParams) (*xendit.CardRefund, *xendit.Error)
```

##### ReverseAuthorization

```go
card.ReverseAuthorization(data *ReverseAuthorizationParams) (*xendit.CardReverseAuthorization, *xendit.Error)
```

#### Payout

##### Create

```go
payout.Create(data *payout.CreateParams) (*xendit.Payout, *xendit.Error)
```

##### Get

```go
payout.Get(data *payout.GetParams) (*xendit.Payout, *xendit.Error)
```

##### Expire

```go
payout.Expire(data *payout.ExpireParams) (*xendit.Payout, *xendit.Error)
```

#### Retail Outlet

##### Create

```go
retailoutlet.Create(data *retailoutlet.CreateParams) (*xendit.RetailOutlet, *xendit.Error)
```

##### Get

```go
retailoutlet.Get(data *retailoutlet.GetParams) (*xendit.RetailOutlet, *xendit.Error)
```

##### Edit

```go
retailoutlet.Edit(data *retailoutlet.EditParams) (*xendit.RetailOutlet, *xendit.Error)
```

##### Stop
### Sub-Packages Documentations

```go
retailoutlet.Stop(data *retailoutlet.StopParams) (*xendit.RetailOutlet, *xendit.Error)
```

##### Pause
The following is a list of pointers to documentations for sub-packages of [xendit-go](https://github.com/xendit/xendit-go).

```go
retailoutlet.Pause(data *retailoutlet.PauseParams) (*xendit.RetailOutlet, *xendit.Error)
```

##### Resume

```go
retailoutlet.Resume(data *retailoutlet.ResumeParams) (*xendit.RetailOutlet, *xendit.Error)
```

#### Cardless Credit

##### CreatePayment

```go
CreatePayment(data *CreatePaymentParams) (*xendit.CardlessCredit, *xendit.Error)
```
- [Invoice](https://pkg.go.dev/github.com/xendit/xendit-go/invoice)
- [E-Wallet](https://pkg.go.dev/github.com/xendit/xendit-go/ewallet)
- [Balance](https://pkg.go.dev/github.com/xendit/xendit-go/balance)
- [Virtual Account](https://pkg.go.dev/github.com/xendit/xendit-go/virtualaccount)
- [Retail Outlet](https://pkg.go.dev/github.com/xendit/xendit-go/retailoutlet)
- [Disbursement](https://pkg.go.dev/github.com/xendit/xendit-go/disbursement)
- [Card](https://pkg.go.dev/github.com/xendit/xendit-go/card)
- [Payout](https://pkg.go.dev/github.com/xendit/xendit-go/payout)
- [Recurring Payment](https://pkg.go.dev/github.com/xendit/xendit-go/recurringpayment)
- [Cardless Credit](https://pkg.go.dev/github.com/xendit/xendit-go/cardlesscredit)

## Contribute

Expand Down
1 change: 1 addition & 0 deletions balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func (b *BalanceAccountTypeEnum) String() string {

// Balance contains data from Xendit's API response of balance related request.
// For more details see https://xendit.github.io/apireference/?bash#balances.
// For documentation of subpackage balance, checkout https://pkg.go.dev/github.com/xendit/xendit-go/balance
type Balance struct {
Balance float64 `json:"balance"`
}
3 changes: 3 additions & 0 deletions card.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "time"
// and Create Authorization request.
// For more details see https://xendit.github.io/apireference/?bash#create-charge
// and https://xendit.github.io/apireference/?bash#create-authorization.
// For documentation of subpackage card, checkout https://pkg.go.dev/github.com/xendit/xendit-go/card
type CardCharge struct {
ID string `json:"id"`
Status string `json:"status"`
Expand All @@ -30,6 +31,7 @@ type CardCharge struct {

// CardRefund contains data from Xendit's API response of card's Create Refund request.
// For more details see https://xendit.github.io/apireference/?bash#CreateRefund.
// For documentation of subpackage card, checkout https://pkg.go.dev/github.com/xendit/xendit-go/card
type CardRefund struct {
ID string `json:"id"`
Updated *time.Time `json:"updated"`
Expand All @@ -46,6 +48,7 @@ type CardRefund struct {

// CardReverseAuthorization contains data from Xendit's API response of card's Reverse Authorization request.
// For more details see https://xendit.github.io/apireference/?bash#reverse-authorization.
// For documentation of subpackage card, checkout https://pkg.go.dev/github.com/xendit/xendit-go/card
type CardReverseAuthorization struct {
ID string `json:"id"`
ExternalID string `json:"external_id"`
Expand Down
1 change: 1 addition & 0 deletions cardlesscredit.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (

// CardlessCredit contains data from Xendit's API response of cardless credit related requests.
// For more details see https://xendit.github.io/apireference/?bash#cardless-credit.
// For documentation of subpackage cardlesscredit, checkout https://pkg.go.dev/github.com/xendit/xendit-go/cardlesscredit
type CardlessCredit struct {
RedirectURL string `json:"redirect_url"`
TransactionID string `json:"transaction_id"`
Expand Down
Loading

0 comments on commit cf40ea5

Please sign in to comment.