go.stripe 是一个简单的 Go 语言信用卡处理库,使用 Stripe API。
示例代码:
//Create Customer params := stripe.CustomerParams{ Email: "george.costanza@mail.com", Desc: "short, bald", Card: &stripe.CardParams { Name : "George Costanza", Number : "4242424242424242", ExpYear : 2012, ExpMonth : 5, CVC : "26726", }, } customer, err := stripe.Customers.Create(¶ms) //Charge Card params := stripe.ChargeParams{ Desc: "Calzone", Amount: 400, Currency: "usd", Card: &stripe.CardParams { Name : "George Costanza", Number : "4242424242424242", ExpYear : 2012, ExpMonth : 5, CVC : "26726", }, } charge, err := stripe.Charges.Create(¶ms)