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

Bigcommerce 401 error on Processing payment with code 10001 #251

Open
sardarusama41062 opened this issue Sep 18, 2019 · 2 comments
Open

Comments

@sardarusama41062
Copy link

Expected behavior

Actual behavior

i'm trying to process payment in bigcommerce by using Payment API.
But i'm getting the error of 401.
i have followed the doc but unable to solve the issue, i have also provided the Authorization code for cards, but it's not working for me.
here is my request to bigcommerce payment APi
axios(${store.PAYMENT_API}/, { headers: { 'Accept': 'application/vnd.bc.v1+json', 'Content-Type': 'application/json', 'Authorization': PTA ${accesstoken} }, method: 'POST', data: { "payment": { "instrument": {}, "payment_method_id": "cod", "amount": 81505146, "currency_code": "PKR" } } } ) .then(res => { console.log(res) dispatch({ type: 'SET_PAYMENT_METHODS', }) })

Steps to reproduce behavior

@karen-white
Copy link

Hey @sardarusama41062 , looks like you're sending PTA in the authorization instead of PAT. You'll also want to make sure there's a space between PAT and the token itself.

@sardarusama41062
Copy link
Author

sardarusama41062 commented Sep 20, 2019

Thanks this worked for me, but now it is displaying the error of payment was declined.
Here is my data for request
{ "payment": { "instrument": { "type": "card", "number": "4111111111111111", "cardholder_name": "asd", "expiry_month": 12, "expiry_year": 2020, "verification_value": "123" }, "payment_method_id": "testgateway.card" } }
and this is the response
{
"id": "584999f7-a1e1-4902-9146-837d3d24bbc6",
"status": 422,
"code": 30102,
"title": "The payment was declined.",
"type": "https://developer.bigcommerce.com/api#api-status-codes",
"errors": {}
}
Also, how can i process offline methods? for offline methods it is giving this error
{
"code": 10001,
"errors": {
"payment.instrument.type": "Type is invalid."
},
"id": "831d27ba-55f8-4b37-9add-d76c2c71ed26",
"status": 422,
"title": "Missing or incorrect required fields.",
"type": "https://developer.bigcommerce.com/api#api-status-codes"
}
I checked in the server logs and found this
Transaction ID: , Status: declined, Message: invalid_gateway - gateway is invalid, missing_test_mode - test_mode is required

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

2 participants