Gopaymill
Paymill API client for Go lang
Install / Use
/learn @cyrrill/GopaymillREADME
Go Paymill
Here is how to connect to and interact with the Paymill API in Go.
Each model type is mapped to a struct, which has New() Get() All() methods.
- Client
- Payment
- Transaction
- Subscription
Connect
Import the package into your app and
package yourapp
import (
"fmt"
gp "github.com/cyrrill/gopaymill"
)
// Creates a client connection using a key: https://app.paymill.com/development/api-keys
p := gp.Paymill{PrivateKey: "000000000000000000"}
Models
The create individual structs and call the action method on the Paymill connection &p
// Creates a new client
client := gp.Client{Description: "Golang", Email: "test@golang.org"}.New(&p)
Reuse values directly in following calls
// Create a new payment object. Get the token from Paymills BridgeJS, client ID comes previous call
payment := gp.Payment{Token:"tok_000000000000", Client: client.ID}.New(&p)
// Create a recurring subscritpion with new payment method
subscription := gp.Subscription{
Offer: "offer_0000000000000000",
Client: client.ID,
Payment: payment.ID,
}.New(&p)
Output
The values in all the models are directly accesible after the call as:
fmt.Println("Subscription ID: "+subscription.ID)
fmt.Println("Client email: "+client.Email)
Get one, Get all
// Lookup by key
payment := gp.Payment{ID:"pay_000000000000"}.Get(&p)
// Get all []Transaction
transaction := gp.Transaction{}.All(&p)
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
