Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

payment.NewClient #56

Closed
oscarict opened this issue Apr 5, 2024 · 1 comment
Closed

payment.NewClient #56

oscarict opened this issue Apr 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@oscarict
Copy link

oscarict commented Apr 5, 2024

I'm implement the Go SDK but when try make payment using PSE we go this error
json: cannot unmarshal number into Go struct field TransactionDetailsResponse.transaction_details.bank_transfer_id of type string

Our Code
accessToken := "TEST-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
cfg, err := config.New(accessToken)
if err != nil {
fmt.Println(err)
return err
}

	client := payment.NewClient(cfg)
	request := payment.Request{
		TransactionAmount: 500000,
		Description:       "pago realizo pago del pago",
		PaymentMethodID:   "pse",
		Payer: &payment.PayerRequest{
			Email:      "[email protected]",
			EntityType: "individual",
			Identification: &payment.IdentificationRequest{
				Type:   "CC",
				Number: "98666222",
			},
			Address: &payment.AddressRequest{
				ZipCode:      "111",
				StreetName:   "Siempre viva",
				StreetNumber: "111",
				Neighborhood: "Sarasa",
				City:         "Medellín",
				FederalUnit:  "1",
			},
			Phone: &payment.PhoneRequest{
				AreaCode: "011",
				Number:   "333333333",
			},
		},
		AdditionalInfo:     &payment.AdditionalInfoRequest{IPAddress: "127.0.0.1"},
		TransactionDetails: &payment.TransactionDetailsRequest{FinancialInstitution: "1303"},
		CallbackURL:        "http://www.your-site.com",
	}

	resource, err := client.Create(context.Background(), request)
	if err != nil {
		fmt.Println("!")
		fmt.Println(err)
		return err
	}

Response
json: cannot unmarshal number into Go struct field TransactionDetailsResponse.transaction_details.bank_transfer_id of type string

image

@gdeandradero gdeandradero added the bug Something isn't working label Apr 8, 2024
@gdeandradero gdeandradero self-assigned this Apr 8, 2024
@gdeandradero
Copy link
Collaborator

Hello, we fixed it, sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants