我在 golang 應用程序中使用 logpacker 包來使用 paypal 進行信用卡交易,但它返回POST https://api.sandbox.paypal.com/v1/payments/payment: 500錯誤我的 main.go 文件具有此代碼::package main import ( paypalsdk "github.com/logpacker/PayPal-Go-SDK" "fmt")var ClientID = "my-client-id"var SecretID = "my-secret-key"func main() { // Initialize client c, err := paypalsdk.NewClient(ClientID, SecretID, paypalsdk.APIBaseSandBox) if err != nil { panic(err) } // Retrieve access token _, err = c.GetAccessToken() if err != nil { panic(err) } // Create credit card payment p := paypalsdk.Payment{ Intent: "sale", Payer: &paypalsdk.Payer{ PaymentMethod: "credit_card", FundingInstruments: []paypalsdk.FundingInstrument{{ CreditCard: &paypalsdk.CreditCard{ Number: "43118885805455", Type: "visa", ExpireMonth: "11", ExpireYear: "2023", CVV2: "123", FirstName: "abc", LastName: "abc", }, }}, }, Transactions: []paypalsdk.Transaction{{ Amount: &paypalsdk.Amount{ Currency: "USD", Total: "7.00", }, Description: "My Payment", }}, RedirectURLs: &paypalsdk.RedirectURLs{ ReturnURL: "http://...", CancelURL: "http://...", }, } _, err = c.CreatePayment(p) if err != nil { fmt.Println(err) } //fmt.Println(data)}在此之后我運行 main.go 文件并生成以下錯誤錯誤:POST https://api.sandbox.paypal.com/v1/payments/payment: 500這是一個logpacker包github鏈接:https ://github.com/logpacker/PayPal-Go-SDK
如何使用 logpacker package paypal 進行信用卡支付?
慕田峪9158850
2023-04-17 16:09:34