Skip to main content
Version: Next (unreleased)

gopay

A unified payment-processing library for Go with support for Stripe, PayPal, and Razorpay.

The core package (github.com/KARTIKrocks/gopay) defines provider-agnostic interfaces, types, sentinel errors, a Client, and a MockProvider. Each provider lives in its own Go module, so importing one never pulls in the SDKs of the others.

go get github.com/KARTIKrocks/gopay
go get github.com/KARTIKrocks/gopay/stripe # or paypal, razorpay

What you get

Unified interfaceOne Client API across Stripe, PayPal, and Razorpay
Dependency isolationEach provider is a separate Go module
PaymentsCreate, capture (automatic or manual), get, and cancel
RefundsFull and partial refund processing
Customers & payment methodsCreate, manage, attach, detach
Setup intentsSave a card for later off-session charges
SubscriptionsPlans and recurring billing
InvoicesRead-only invoice retrieval with hosted URLs
WebhooksSignature-verified, normalized events
Cursor paginationA consistent List/paginate pattern
Mock providerIn-memory provider for tests, no network
Thread safeEvery method is safe for concurrent use

Where to go next

Documentation layout

These guides explain concepts, patterns, and provider quirks. For exact type signatures, method sets, and struct fields, use pkg.go.dev — it is generated from the source and is always authoritative.