explaingit

go-pay/gopay

5,548GoAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

GoPay is a Go library that provides a unified interface for integrating WeChat Pay, Alipay, PayPal, QQ Pay, and other Chinese and international payment providers into backend applications without writing low-level API code.

Mindmap

mindmap
  root((GoPay))
    What it does
      Payment provider SDK
      Go library
      Unified interface
    Supported Providers
      WeChat Pay V2 V3
      Alipay V2 V3
      PayPal and Apple
      QQ Pay and others
    Features
      Order creation
      Refunds and queries
      Custom logging
    Notes
      Use V3 interfaces
      Apache 2.0 license
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add WeChat Pay V3 or Alipay V3 checkout to a Go web application using a pre-built client instead of writing raw payment API integration code.

USE CASE 2

Query order status, process refunds, and handle payment callbacks for Chinese payment providers in a Go backend service.

USE CASE 3

Use the included test files as ready-to-run examples to understand each payment provider's request and response format before integrating.

Tech stack

Go

Getting it running

Difficulty · moderate Time to first run · 30min

Requires merchant credentials such as API keys and certificates from each payment provider before any payment call can be tested, even in sandbox mode.

Apache 2.0 license: use freely in commercial or personal projects, keep the copyright notice and license file included.

In plain English

GoPay is a Go programming library that lets developers add payment processing to their applications without writing all the low-level integration code from scratch. It covers a wide range of payment platforms popular in China and internationally, including WeChat Pay, Alipay, QQ Pay, Allinpay, Lakala, PayPal, and Apple payment verification. The library works by providing a client for each payment provider. A developer creates a client configured with their merchant credentials, then calls methods on that client to initiate payments, query order status, handle refunds, and perform other payment-related operations. Each payment provider has its own documentation section in the project, linked from the README rather than embedded directly. WeChat Pay and Alipay each have two supported versions, V2 and V3. The README marks V2 as not recommended, so new projects should use the V3 interfaces. The project includes test files for each payment provider that double as usage examples, showing how to construct requests and handle responses. There is also a separate example project called gopay-platform that demonstrates a more complete integration. GoPay supports custom log output by calling a method on the client after initialization, passing in any logger that implements the required interface. This makes it easier to plug into existing application logging systems. The library requires Go 1.24 or newer and is released under the Apache 2.0 license. The README is written primarily in Chinese and is aimed at developers integrating Chinese payment systems into Go-based backends. The project notes that a 1-cent test transaction is the recommended approach when testing payment flows during development.

Copy-paste prompts

Prompt 1
Using GoPay, write Go code to create a WeChat Pay V3 client with merchant credentials, initiate a native pay order, and poll for its payment status.
Prompt 2
Show me how to use GoPay to process an Alipay V3 refund for an existing order ID, including proper error handling for a failed refund response.
Prompt 3
I want to verify Apple In-App Purchase receipts using GoPay. Show me the Go code to set up the Apple payment client and validate a receipt string.
Prompt 4
Using GoPay's logger interface, show me how to plug in a zap logger so all payment API calls and responses are captured at my application's log level.
Open on GitHub → Explain another repo

← go-pay on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.