creditcard Credit Card


Sandbox end point URL: https://gateway2-stg.tcbpay.com/apis/{method}
Example: https://gateway2-stg.tcbpay.com/apis/sale.php

Sale API

This will create a new payment transaction.

URL To Call: https://gateway2.tcbpay.com/apis/sale.php
Method of Form Submission: POST

The table describes the request parameters to perform a sale.

Variable Name Description Required Expected Values
username TCB Pay Gateway Username Y TCB Pay Gateway Username
api_key TCB Pay Gateway API Key Y TCB Pay Gateway API Key
creditcard_number Credit Card Number upon which Sales to be done Y 4111111111111111
expire_month Expiry Month of the Credit Card Y 04
expire_year Expiry Year of the Credit Card Y 2022
cvv CVV of the Credit Card Y 123
amount Amount to be charged Y 133.24
currency Currency of Transaction Y USD,EUR,GBP
company_name Company Name of the customer N -
first_name First name of Account Holder Y Roberto
last_name Last name of Account Holder Y Diaz
adress Address of the customer N 4446 Green Avenue, Suite 56
city City of the customer N Los Angeles
state State of the customer N CA
country_code Country of the customer(ISO alpha-2) Y US, CN
zip_code Zipcode of the customer N 94085
phone_number Phone Number of the customer N 408-345-2323
e-mail Email ID of the customer Y test@test.com
e-mail receipt Send transaction details to specified email N Y or N (default value N)
Y- Send email
N- Not send
client_IP Client ip address N 127.0.0.1
custom_field_1 N -
custom_filed_2 N -

Response:

Response Type of the API Call is an JSON Array. For Error, Elements are code and description and for Successful transactions, Elements are returned. code, description and transaction_id. code is always 00 for success.

Example:

                    
        <form name="" action="https://gateway2.tcbpay.com/apis/sale.php" method="post">
        <input type="text" name="username" value=" tcbpayusername"/>
        <input type="text" name="api_key" value=" tcbpayapikey"/>
        <input type="text" name="creditcard_number" value="4111111111111111"/>
        <input type="text" name="expire_month" value="04"/>
        <input type="text" name="expire_year" value="2022"/>
        <input type="text" name="cvv" value="123"/>
        <input type="text" name="amount" value="14.5"/>
        <input type="text" name="currency" value="USD"/>
        <input type="text" name="company_name" value="TCB Pay"/>
        <input type="text" name="first_name" value="Roberto"/>
        <input type="text" name="last_name" value="Diaz"/>
        <input type="text" name="address" value="4446 Green Avenue, Suite 56"/>
        <input type="text" name="city" value="Los Angeles"/>
        <input type="text" name="state" value="CA"/>
        <input type="text" name="country_code" value="US"/>
        <input type="text" name="zip_code" value="11111"/>
        <input type="text" name="phone_number" value="323-323-3223"/>
        <input type="text" name="client_ip" value="127.0.0.1"/>
        <input type="text" name="email" value="tanumondal@gmail.com"/>
        <input type="checkbox" name="email_receipt"  value="Y"/>
        <br/>
        <input type="submit" value="submit"/>
        </form>
        
            

Sample Response :

{"response":{"code":"00","description":" Transaction Entry Success","transaction_id":102," total_amount":15.7," convenience_fee":1.2}}

Authorize API:

This API allows you to perform pre-authorization payment.

URL To Call: https://gateway2.tcbpay.com/apis/ authorize.php
Method of Form Submission: POST
Parameters:
Variable Name Description Required Expected Values
username TCB Pay Gateway Username Y TCB Pay Gateway Username
api_key TCB Pay Gateway API Key Y TCB Pay Gateway API Key
creditcard_number Credit Card Number upon which Sales to be done Y 4111111111111111
expire_month Expiry Month of the Credit Card Y 04
expire_year Expiry Year of the Credit Card Y 2022
cvv CVV of the Credit Card Y 123
amount Amount to be charged Y 133.24
currency Currency of Transaction Y USD,EUR,GBP
company_name Company Name of the customer N -
first_name First name of Account Holder Y Roberto
last_name Last name of Account Holder Y Diaz
adress Address of the customer N 4446 Green Avenue, Suite 56
city City of the customer N Los Angeles
state State of the customer N CA
country_code Country of the customer(ISO alpha-2) Y US, CN
zip_code Zipcode of the customer N 94085
phone_number Phone Number of the customer N 408-345-2323
e-mail Email ID of the customer Y test@test.com
e-mail receipt Send transaction details to specified email N Y or N (default value N)
Y- Send email
N- Not send
client_ip Client ip address N 127.0.0.1

Response:

Response Type of the API Call is an JSON Array. For Error, Elements are code and description and for Successful transactions, Elements are returned. code, description and transaction_id. code is always 00 for success.

Example:

                    
            <form name="" action="https://gateway2.tcbpay.com/apis/authorize.php" method="post">
            <input type="text" name="username" value=" tcbpayusername"/>
            <input type="text" name="api_key" value=" tcbpayapikey"/>
            <input type="text" name="creditcard_number" value="4111111111111111"/>
            <input type="text" name="expire_month" value="04"/>
            <input type="text" name="expire_year" value="2022"/>
            <input type="text" name="cvv" value="123"/>
            <input type="text" name="amount" value="14.5"/>
            <input type="text" name="currency" value="USD"/>
            <input type="text" name="company_name" value="TCB Pay"/>
            <input type="text" name="first_name" value="Roberto"/>
            <input type="text" name="last_name" value="Diaz"/>
            <input type="text" name="address" value="4446 Green Avenue, Suite 56"/>
            <input type="text" name="city" value="Los Angeles"/>
            <input type="text" name="state" value="CA"/>
            <input type="text" name="country_code" value="US"/>
            <input type="text" name="zip_code" value="11111"/>
            <input type="text" name="phone_number" value="323-323-3223"/>
            <input type="text" name="email" value="tanumondal@gmail.com"/>
            <input type="checkbox" name="email_receipt"  value="Y"/>
            <br/>
            <input type="submit" value="submit"/>
            </form>
        
            

Sample Response :

{"response":{"code":"01","description":" Merchant Information is Missing"}}

Void API:

This API cancel an existing transaction.

URL To Call: https://gateway2.tcbpay.com/apis/ void.php
Method of Form Submission : POST
Parameters:
Variable Name Description Required Expected Values
username TCB Pay Gateway Username Y TCB Pay Gateway Username
api_key TCB Pay Gateway API Key Y TCB Pay Gateway API Key
transaction_id Unique transaction id generate by gateway Y -
email_receipt Send transaction details to specified email during authorize N Y or N (default value N)
Y- Send email
N- Not send

Response:

Response Type of the API Call is an JSON Array. For Error, Elements are code and description and for Successful transactions, Elements are returned. code, description and transaction_id. code is always 00 for success.

Example:

                    
            <form name="" action="https://gateway2.tcbpay.com/apis/void.php" method="post">
            <input type="text" name="username" value=" tcbpayusername"/>
            <input type="text" name="api_key" value=" tcbpayapikey"/>
            <input type="text" name="transaction_id" value=""/>
            <input type="checkbox" name="email_receipt"  value="Y"/>
            <br/>
            <input type="submit" value="submit"/>
            </form>
        
            

Sample Response :

{"response":{"code":"01","description":" Merchant Information is Missing"}}

Capture API:

This API allows you to capture an existing authorization transaction.

URL To Call: https://gateway2.tcbpay.com/apis/ capture.php
Method of Form Submission: POST
Parameters:
Variable Name Description Required Expected Values
username TCB Pay Gateway Username Y TCB Pay Gateway Username
api_key TCB Pay Gateway API Key Y TCB Pay Gateway API Key
transaction_id Unique transaction id generate by gateway Y -
amount Amount to be charged, <= orginal transaction amount Y 133.24
email_receipt Send transaction details to specified email during authorize N Y or N (default value N)
Y- Send email
N- Not send

Response:

Response Type of the API Call is an JSON Array. For Error, Elements are code and description and for Successful transactions, Elements are returned. code, description and transaction_id. code is always 00 for success.

Example:

                    
            <form name="" action="https://gateway2.tcbpay.com/apis/capture.php" method="post">
            <input type="text" name="username" value=" tcbpayusername"/>
            <input type="text" name="api_key" value=" tcbpayapikey"/>
            <input type="text" name="transaction_id" value=""/>
            <input type="text" name="amount" value="14.5"/>
            <input type="checkbox" name="email_receipt"  value="Y"/>
            <br/>
            <input type="submit" value="submit"/>
            </form>
        
            

Sample Response :

{"response":{"code":"01","description":" Merchant Information is Missing"}}

Refund API:

This API allows you to refund an existing successfull transaction.

URL To Call: https://gateway2.tcbpay.com/apis/ refund.php
Method of Form Submission : POST
Parameters:
Variable Name Description Required Expected Values
username TCB Pay Gateway Username Y TCB Pay Gateway Username
api_key TCB Pay Gateway API Key Y TCB Pay Gateway API Key
transaction_id Unique transaction id generate by gateway Y -
amount Amount to be charged, <= orginal transaction amount Y 133.24
email_receipt Send transaction details to specified email during authorize N Y or N (default value N)
Y- Send email
N- Not send

Response:

Response Type of the API Call is an JSON Array. For Error, Elements are code and description and for Successful transactions, Elements are returned. code, description and transaction_id. code is always 00 for success.

Example :

                    
            <form name="" action="https://gateway2.tcbpay.com/apis/refund.php" method="post">
            <input type="text" name="username" value=" tcbpayusername"/>
            <input type="text" name="api_key" value=" tcbpayapikey"/>
            <input type="text" name="transaction_id" value=""/>
            <input type="text" name="amount" value="14.5"/>
            <input type="checkbox" name="email_receipt"  value="Y"/>
            <br/>
            <input type="submit" value="submit"/>
            </form>
        
            

Sample Response :

{"response":{"code":"01","description":" Merchant Information is Missing"}}

Response Codes:

Code Description
01 username is missing or invalid
02 Credit card is missing or invalid
03 Expiration Date is missing or invalid
04 First/Last Name is missing
05 Invalid Country Code
06 Proper Customer Email Id is missing
07 Invalid Amount
08 Transaction Currency is Missing
09 api_key is missing or invalid
10 Requested Currency is not allowed for this Merchant
11 Couldn't process transaction due to load balancer rules!!
12 Transaction ID is missing or invalid
13 Refund is not possible,Its already Void
14 Refund is not possible,Its already exceeds Actual Amount
15 Capture is not possible
16 Void is not possible
17 Sale Limit exceeded
18 Monthly Limit exceeded
19 Transaction Limit exceeded
20 IP/Transaction Limit exceeded
21 Slang word not allowed
22 IP Address is missing/invalid
A1 Transaction Entry Failure
A2 Transaction Update Failure
UN Unknown error, Please contact to administrator
F Your transaction is declined
00 Transaction Entry Success

Sandbox:

Sandbox end point URL: https://gateway2-stg.tcbpay.com/apis/{method}
Example: https://gateway2-stg.tcbpay.com/apis/sale.php

Test Credit Card's Details:

Card Number CVV
4005510000000013 123
4111111111111111 111
4012001037141112 083
5111111111111111 123