-1

Is there a test mode for 2pay.js? I'm trying to build an integration and getting an error that my transaction is forbidden, which leads me to believe I unfortunately need to wait for them to review a SAQ-A questionnaire to give me test access... But perhaps there's a magic incantation I'm just missing.

We have an account in demo mode.

{
  "error_code": "FORBIDDEN",
  "message": "You need to contact support in order to have this feature enabled"
}

Here is the request we are submitting:

curl --location --request POST 'https://api.avangate.com/rest/6.0/orders/' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Avangate-Authentication: code="xxx" date="2020-03-24 23:52:45" hash="yyy"' \
--data-raw '{
"BillingDetails": {
"FirstName": "Joe",
"LastName": "Sullivan",
"Address1": "123 Easy St",
"City": "Anywhere",
"State": "GA",
"Zip": "70403",
"CountryCode": "US",
"Email": "[email protected]"
},
"Currency": "usd",
"ExternalReference": "REST_API_AVANGTE",
"Items": [
{
"Code": "xxx",
"Quantity": "1"
}
],
"Language": "en",
"PaymentDetails": {
"Currency": "USD",
"PaymentMethod": {
"EesToken": "190f2d9c-0bbc-4ad0-a902-770adb8e7f90"
},
"Type": "EES_TOKEN_PAYMENT"
}
}'

They are telling me that I have to use the TEST type, but that results in an error about the PaymentMethod being empty:

{
    "error_code": "ORDER_PAYMENT_METHOD_INVALID",
    "message": "The payment method [] is not supported."
}

I'm pretty confident that the TEST type only has to do with using actual card data in the PaymentMethod just like you would with the CC type.

Anyone know if there's a way to test token payments with 2pay.js?

1
  • You are replying to the comment that contains the JSON request. It is in the curl. Commented Apr 6, 2020 at 1:29

1 Answer 1

1

As of 4/5/2020 there is no test mode for the 2pay.js / EES_TOKEN_PAYMENT.

Unfortunately this means you cannot actually test any code you write to interact with this method, because you end up having to send the entire BillingDetails as well as a complete PaymentDetails object, with card holder data (CHD), and a fairly different rest of the JSON. At that point you've not done anything useful with 2pay.js itself, and you are just implementing the full POST order creation process per: https://app.swaggerhub.com/apis-docs/2Checkout-API/api-rest_documentation/6.0#/Order/post_orders_

So, this is a big mess and hopefully they'll come out with a test mode soon.

Sign up to request clarification or add additional context in comments.

1 Comment

2pay.js requires the use of a token, which requires the use of EES_TOKEN_PAYMENT, which does not have a test mode. If you are using "Type":'TEST", then you may be using 2pay.js to initially get a token, but you cannot actually use the token to process your transaction, so therefore you cannot actually use 2pay.js as it is documented, which requires the token, which requires EES_TOKEN_PAYMENT. If you are using "Type":"TEST" then all you are doing is directly interacting with the 2checkout REST API, and you didn't need to do anything with 2pay.js at all in the first place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.