question

Neil avatar image
Neil asked Neil commented

Credit card payment error in sandbox

I am attempting to test credit card payments in my sandbox merchant account using the v2 `/pay` endpoint, but I'm getting an `"Unexpected 'E'"` response back when making the requests with Postman - which I am _guessing_ (based on reading other posts) actually indicates a `503 Error connecting to Payment Gateway` response.

I am following the documentation here: https://docs.clover.com/build/developer-pay-api/, and have tried posting payments using these test cards https://docs.clover.com/build/simulate-transaction-scenarios-partialdecline/ as well as with some real cards.

Here is my process:
1. Successfully create an order with `POST /v3/merchants/{mId}/orders` (with minimal body like: `{ "state": "open", "total": 200}`)
2. Encrypt card number for `/pay` request using data in response from `/v2/merchant/{mid}/pay/key`. I'm pretty certain that I am generating the `cardEncrypted` string correctly following the these steps: https://docs.clover.com/build/developer-pay-api/#e...
3. Make a POST request to `/v2/merchant/{mid}/pay` referencing the order from #1 with body such as:
```
{ "orderId": "9CV07JMPX4S74", "zip": "22204", "expMonth": 9, "cvv": "123", "amount": 100, "currency": "usd", "last4": "4242", "expYear": 2020, "first6": "424242", "cardEncrypted": "base64_encrypted_string_from_step_2"}
```

The `/pay` request takes about 30 seconds to process before returning the error. I'm new to Clover APIs so forgive me if I'm missing something fundamental here such as not being able to process transactions in this way against a sandbox account. Or, perhaps I need to have clover hardware set up in order to process payments? I have not ordered a dev kit yet. Thank you in advance for any help.

PaymentsSandbox
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chanel avatar image chanel commented ·

Can you post the full error you're seeing?

Also, we have examples in various languages located here: https://github.com/cloverhackathons/DeveloperPayAPI Let me know if they help!

0 Likes 0 ·
Neil avatar image Neil chanel commented ·

Thank you Chanel and I'm sorry for the delayed reply. The primary issue I was facing here was the inability to allow end customers to store vaulted cards for later use using Clover's API. I've since integrated Spreedly which fills this gap. I appreciate the link to examples.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community