github.com/Ingenico-ePayments/connect-sdk-go@v0.0.0-20240318153750-1f8cd329b9c9/examples/merchant/services/ConvertBankAccountExample.go (about) 1 // This file was auto-generated from the API references found at 2 // https://epayments-api.developer-ingenico.com/ 3 4 package examples 5 6 import ( 7 "fmt" 8 9 "github.com/Ingenico-ePayments/connect-sdk-go/domain/definitions" 10 "github.com/Ingenico-ePayments/connect-sdk-go/domain/services" 11 ) 12 13 func convertBankAccountExample() { 14 client, clientErr := getClient() 15 if clientErr != nil { 16 panic(clientErr) 17 } 18 defer client.Close() 19 20 // Assigning literals to pointer variables directly is not supported. 21 // The below code uses helper function newString to overcome this issue. 22 // http://stackoverflow.com/a/30716481 lists a few more alternatives. 23 // The code for this helper function can be found in file Helper.go 24 25 var bankAccountBban definitions.BankAccountBban 26 bankAccountBban.AccountNumber = newString("0532013000") 27 bankAccountBban.BankCode = newString("37040044") 28 bankAccountBban.CountryCode = newString("DE") 29 30 var body services.BankDetailsRequest 31 body.BankAccountBban = &bankAccountBban 32 33 response, err := client.Merchant("merchantId").Services().Bankaccount(body, nil) 34 35 fmt.Println(response, err) 36 }