Card Gateway Authorization
Process a payment using an authorization operation. This is faster than the sale operation as it only authorizes the payment. The capture is then done asynchronously within 30 seconds of the authorization.
Note: If you intend to use the sandbox, you should use the following base URI:
https://youcanpay.com/sandbox/api/
Parameters
| Parameter | Type | Description |
|---|---|---|
pub_key | required | Merchant account's public key. |
token_id | required | A tokenized payment ID. |
credit_card | required | The card's number. |
card_holder_name | required | The card holder's name, used for AVS verification. |
cvv | required | Card verification value number, usually on the back of the card. |
expire_date | required | Card expiry date in MM/YY format. |
Returns
A transaction ID if successful. Returns redirect and return URLs if the card has 3DS enabled.
Request
Endpoint: https://youcanpay.com/api/authorize
Method: POST
bash
$ curl --location --request POST 'https://youcanpay.com/api/authorize' \
--header 'Accept: application/json' \
--form 'pub_key="pub_d8116a60-ece8-4e14-b475-c8d349a5"' \
--form 'token_id="1e7862f6-266b-46b1-b550-afcd34f4b76f"' \
--form 'expire_date="10/24"' \
--form 'credit_card="4012888888881881"' \
--form 'cvv="000"' \
--form 'card_holder_name="John Doe"'1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Response
The response object
json
{
"success": true,
"code": "000",
"message": "The payment was processed successfully",
"transaction_id": "f78d4a85-80bf-4405-8aef-9b256ce3f8ac",
"order_id": "12"
}1
2
3
4
5
6
7
2
3
4
5
6
7