Giter VIP home page Giter VIP logo

xendit / xendit-go Goto Github PK

View Code? Open in Web Editor NEW
126.0 35.0 58.0 1.64 MB

Xendit REST API Client for Go - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services, QR Codes

Home Page: https://developers.xendit.co/api-reference/

License: MIT License

Go 100.00%
xendit go golang payment payment-gateway card virtual-account invoice disbursement recurring-payments payout ewallet balance retail-outlet cardless-credit hacktoberfest qr-payments

xendit-go's Introduction

Xendit Go SDK

Xendit Go SDK

The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API in applications written in Go.

  • Package version: 6.0.0

Getting Started

Installation

Install xendit-go with:

go get github.com/xendit/xendit-go/v6

Put the package under your project folder and add the following in import:

import xendit "github.com/xendit/xendit-go/v6"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Authorization

The SDK needs to be instantiated using your secret API key obtained from the Xendit Dashboard. You can sign up for a free Dashboard account here.

xnd := xendit.NewClient("API-KEY")

Documentation

Find detailed API information and examples for each of our product's by clicking the links below,

All URIs are relative to https://api.xendit.co. For more information about our API, please refer to https://developers.xendit.co/.

Further Reading

xendit-go's People

Contributors

adityaokke avatar adityarx avatar akanta21 avatar ervanadetya avatar feliciagojali avatar glendaesutanto avatar gogotchuri avatar hecharles avatar itzpranz avatar karlseguin avatar kevindavee avatar lamarios avatar ligertsicat avatar mantishk avatar mrwildanmd avatar muthmainnah234 avatar mychaelgo avatar novalagung avatar novrian avatar riskimidiw avatar sekaranglila avatar shauny-xendit avatar stanleynguyen avatar stephenthajeb avatar wwwjfy avatar xen-hendryzheng avatar zombozo12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xendit-go's Issues

[new] Tokenization for ewallet

this issue raised to ask for support tokenization flow for ewallet. we'll need Initialize Linked Account Tokenization method to be able to pass in cancel_redirect_url

Propose, Error response details ?

I'm trying to use xendit-go with simple code like below

	data := invoice.CreateParams{
		ExternalID:      sop.ID,
		Amount:          sop.TotalAmount,
		PayerEmail:      sop.AccountID,
		Description:     fmt.Sprintf("Invoice #%s", sop.ID),
		InvoiceDuration: int(expiredAt.Sub(time.Now()).Seconds()),
	}
	resp, e := invoice.Create(&data)
	if e != nil {
		return e
	}

and only getting response API_VALIDATION_ERROR with There was an error with the format submitted to the server. without any clue.
but when using curl or postman it show more detail

{
    "error_code": "API_VALIDATION_ERROR",
    "message": "There was an error with the format submitted to the server.",
    "errors": [
        {
            "field": [
                "invoice_duration"
            ],
            "location": "body",
            "messages": [
                "\"invoice_duration\" must be greater than 0"
            ],
            "types": [
                "number.greater"
            ]
        }
    ]
}

It will good if we also got error details in response. it will saving more time for debugging what's wrong with it

GoDocs Improvements

  • Examples on root package (i.e. Disb, Invoice)
  • Point to GoDocs for each sub-packges:
    • instead of method signatures in READ
    • from GoDocs root package, under each data type for each product

Please standardize the callback payload

This is not golang specific, but in the VA created endpoint, sometimes the expected_amount type is string, which I thought it should always be integer.

I would like an explanation why it sometimes return string, and I propose to standardize the type to just integer.

The unexpected string type
image

How it's always been
image

Thank you

E-Wallet channel code as an enum

Hi, I see in this docs that E-Wallet channel code defined as

ID_OVO, ID_DANA, ID_LINKAJA, ID_SHOPEEPAY, ID_SAKUKU, PH_PAYMAYA,PH_GCASH, PH_GRABPAY

Code:

type EWalletCharge struct {

Docs: https://developers.xendit.co/api-reference/?bash#create-ewallet-charge

Can we make E-Wallet channel code as an enum? So we can easily compare this value using this library

type EWalletChannelCodeEnum string

const (
  EWalletChannelCodeOVO EWalletChannelCodeEnum = "ID_OVO"
  ...
)

Request for xenPlatform APIs

Currently, I have to create my own implementation to support xenPlatform APIs, e.g. create account, update account, create rule, etc. Given that xenPlatform is still in closed beta it makes sense why this Golang library does not support these APIs yet.

I am creating this ticket to be notified when xenPlatform APIs are supported in this official library.

Missing Dependencies

just started out and having issues with invoice module

Screen Shot 2020-02-29 at 22 16 48

resolved it by installing the dependencies manually

Missing qrcode.Client dependency in client.API

Missing qrcode.Client dependency in this struct

// API is the Xendit client which contains all products
type API struct {
	opt              xendit.Option
	apiRequester     xendit.APIRequester
	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
}

Chaining of config

Instead of having all config inside constructor's params

func New(secretKey string, xenditURL string, apiRequester *xendit.APIRequester) *API {

We can do chaining like below

// because secretKey is required param
func New(secretKey string) {}

func (c *Client) WithAPIRequester(r *APIRequester) *Client {}

func (c *Client) WithXenditURL(u string) *Client {}

[NEW API] Cards Get Token

In regards with cards new API and documentation update we will need new method of card.GetTokenParams on xendit-go client library.

This issue is request for it.

xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
	
getTokenData := card.GetTokenParams{
  TokenID: "605c05d3f81fa60011b2fa4e",
}

tokenResp, err := card.GetToken(&getTokenData)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("retrieved token: %+v\n", tokenResp)

Withdrawal

is it possible to do a withdrawal from API?

Invoice: failed to parse payload callback QRIS

// InvoiceFInvoicePaymentDetaile is data that contained in `Invoice` at PaymentDetail
type InvoicePaymentDetail struct {
    Type  string  `json:"receipt_id,omitempty"`
    Value float64 `json:"source,omitempty"`
 }

since v1.0.3
InvoicePaymentDetail.Value change to float64
Refer to this commit

but the payload payment_details.source still expect a string

this will make the callback event failed to request (status code: 400)

Please fix disbursement integration tests

It seems like the disbursement integration test is failing. The tests seems to fail when creating a disbursement. You can see the failed tests here.

Please help fix it and keep it updated. Thank you ๐Ÿ™๐Ÿป

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.