Libraries
Go Libraries
Accepting credit card payments with Go
The following example uses PinPayments Library by Alex Skripov:
config := pinpayments.NewConfig(true, YOUR_SECRET_KEY_HERE, YOUR_PUBLISHABLE_KEY_HERE)
client, err := pinpayments.NewClient(nil, config)
if err != nil {
panic(err) // Or your way of handling errors
}
client.Charges.CreateCharge(ChargesRequest {
Email: "customer@email.com",
Description: "Widgets",
Amount: 4999,
Currency: "USD",
CardToken: "card_nytGw7koRg23EEp9NTmz9w",
IPAddress: "1.2.3.4",
})