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

Error 400 #6

Open
darmie opened this issue Dec 20, 2019 · 5 comments
Open

Error 400 #6

darmie opened this issue Dec 20, 2019 · 5 comments

Comments

@darmie
Copy link

darmie commented Dec 20, 2019

Kindly see if there's need for an update to this library.

I am getting an error 400 while trying to create a subaccount.

sa, err := r.Paystack.SubAccount.Create(&paystack.SubAccount{
			BusinessName:        *data.Name,
			SettlementBank:      *data.Bank,
			AccountNumber:       *data.AccountNumber,
			PercentageCharge:    PercentageCharge,
			SettlementSchedule:  SettlementSchedule,
			PrimaryContactEmail: *data.Email,
			Metadata:            metadata,
		})

if err != nil {
    return nil, err
}

{\"code\":400,\"details\":{},\"url\":{\"Scheme\":\"https\",\"Opaque\":\"\",\"User\":null,\"Host\":\"api.paystack.co\",\"Path\":\"/subaccount\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"header\":{\"Access-Control-Allow-Origin\":[\"*\"],\"Cf-Cache-Status\":[\"DYNAMIC\"],\"Cf-Ray\":[\"548097858dd2cdb7-CDG\"],\"Content-Length\":[\"64\"],\"Content-Type\":[\"application/json; charset=utf-8\"],\"Date\":[\"Fri, 20 Dec 2019 09:29:26 GMT\"],\"Etag\":[\"W/\\\"40-IhinKFxsDy9hOhy0AlnrOg\\\"\"],\"Expect-Ct\":[\"max-age=604800, report-uri=\\\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\\\"\"],\"Server\":[\"cloudflare\"],\"Set-Cookie\":[\"__cfduid=d966225626d511709c7deeaa7f9fc4a0c1576834166; expires=Sun, 19-Jan-20 09:29:26 GMT; path=/; domain=.paystack.co; HttpOnly; SameSite=Lax; Secure\",\"sails.sid=s:bLrbTdaDSSzE3xP9RhdNBkJkz68T0hrU.ElX48nd0jxKE+TOfOyxbNvv6ILMTTgxlgJcRlPZatdI; Path=/; HttpOnly; Secure\"],\"Strict-Transport-Security\":[\"max-age=15552000; includeSubDomains; preload\"],\"Vary\":[\"X-HTTP-Method-Override, Accept-Encoding\"],\"X-Content-Type-Options\":[\"nosniff\"],\"X-Powered-By\":[\"Sails \\u003csailsjs.org\\u003e\"]}}

@darmie
Copy link
Author

darmie commented Dec 20, 2019

Nevermind, I figured that paystack servers may be rejecting my SSL certificate.

@ozombo
Copy link

ozombo commented Jan 30, 2021

@darmie how did you solve this?

@darmie
Copy link
Author

darmie commented Jan 30, 2021

@ozombo i figured that I couldn't handle Paystack golang API from inside a containerized application, due to certificates validation reasons...

This is a very old issue and I don't remember how I worked around it.

@ozombo
Copy link

ozombo commented Jan 30, 2021

@darmie mine occurred with charge creation and after lots of hair pulling I figured out it was some issues with the card struct. Made a pr for it tho

@sendloveboxafrica
Copy link

yet to be reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants