github.com/Ingenico-ePayments/connect-sdk-go@v0.0.0-20240318153750-1f8cd329b9c9/examples/merchant/productgroups/Helper.go (about) 1 // This class was auto-generated from the API references found at 2 // https://epayments-api.developer-ingenico.com/ 3 4 package examples 5 6 import ( 7 "github.com/Ingenico-ePayments/connect-sdk-go" 8 "github.com/Ingenico-ePayments/connect-sdk-go/domain/errors" 9 "github.com/Ingenico-ePayments/connect-sdk-go/domain/payment" 10 "github.com/Ingenico-ePayments/connect-sdk-go/domain/payout" 11 "github.com/Ingenico-ePayments/connect-sdk-go/domain/refund" 12 ) 13 14 func getClient() (*connectsdk.Client, error) { 15 apiKeyID := "someKey" 16 secretAPIKey := "someSecret" 17 18 return connectsdk.CreateClient(apiKeyID, secretAPIKey, "Ingenico") 19 } 20 21 func newBool(value bool) *bool { 22 return &value 23 } 24 25 func newInt32(value int32) *int32 { 26 return &value 27 } 28 29 func newInt64(value int64) *int64 { 30 return &value 31 } 32 33 func newString(value string) *string { 34 return &value 35 } 36 37 func handleDeclinedPayment(paymentResult *payment.CreateResult) { 38 // handle the result here 39 } 40 41 func handleDeclinedPayout(payoutResult *payout.Result) { 42 // handle the result here 43 } 44 45 func handleDeclinedRefund(refundResult *refund.Result) { 46 // handle the result here 47 } 48 49 func handleAPIErrors(errors []errors.APIError) { 50 // handle the errors here 51 }