Skip to content

apparently-studio/gopay-go-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unofficial Go SDK for GoPay Payments REST API

Go Reference

Installation

go get https://github.com/apparently-studio/gopay-go-api

Basic usage

client := gopay.NewClient("my id", "my secret", "my goid", "gateway url")

Create Payment

payment, err := gopay.CreatePayment(&client, gopay.PaymentBody{ /* define your payment */ })
if err != nil {
    log.Println(err)
    return
}

log.Println(payment.GWURL)

Get Payment

payment, err := gopay.GetPayment(&client, int64(id))
if err != nil {
    log.Println(err)
    return
}

log.Println(payment)

Refund Payment

err := gopay.RefundPayment(&client, int64(id), 50000)
if err != nil {
    log.Println(err)
    return
}

log.Println("Refund has been successful.")