Web Integration
You can easily accept payments from your customers in a hassle-free and secure way with PayGoal. Your customers get a easy, user-friendly and streamlined flow with the ‘Checkout’ form for initiating payments. You can submit additional fields, visible or hidden, along with the form.
With the below mentioned sample code, PayGoal ‘Checkout’ options will be passed as the HTML data attributes.
Once the checkout process is complete, an additional field <name=id>
will be added to the form containing the script tag. Further, the form is submitted automatically. With the authorisation of the payment made, the form along with the Paygoal_payment_id to the action URL.
In the sample code mentioned below, replace the URL with the success callback URL of your website.
Step I - Integration
Web integration is the easiest and the simplest way to integrate PayGoal Payment Services on your Website. While using this mode of integration the customer will be redirected from your checkout page to PayGoal’s payment page. Our payment page is inclusive of all the features and built-in support to collect payment details for all payment mode such as Credit and Debit Cards, Net-banking, UPI wallets etc.
The merchants can experience a hassle-free journey without any worries as our Payment page is hosted at PayGoal Servers which are PCI-DSS compliant (Payment Card Industry Data Security Standard).
Step II - Generate Test Credentials
Please follow the steps mentioned below in order to generate the test credentials:
- Login to your merchant account
- Click on My Account Tab
- Click on My Profile
- Click on integration tab
- You can find Salt, PAY_ID and Request URL value under the Integration Tab
Alternatively, you can contact the integration support team at tech@paygoal.in to get the keys.
Step III - Checkout API
Create the order form the below mentioned Request URLs -
Integration URL for UAT | https://uat.paygoal.in/order/v1/payment |
Integration URL for Production | https://www.paygoal.in/order/v1/payment |
Step IV - Generate Secure Hash
Every request passed is assisted by a secure Hash that verifies the request’s Integrity as well as the identity of the merchant. The secure Hash algorithm is SHA-256.
To generate secure Hash, use the following method:
- Collect all the request parameters that are to be shared with PayGoal and organize them in ascending order according to the name of each field.
- Prepare a String of these sorted name value parameters with Tiled (~) as the separator.
-
Next is to append the Salt at the end of the parameter string given by PayGoal Payment Gateway to you. After appending you will receive the following output (If salt is 6615f2c6e57743d3)
Note: Please append the salt in lower case without any separator after the last value.
-
After completing the above-mentioned process, you will have to call SHA 256 algorithm and pass the parameter string to the same and the SHA will return you the desired result as below
Hash value= {6797f1842deb4f3ebaead53e1bafd5a535d322b9fa3893f201fdb03933eeae09}
-
Now you must convert the generated value to the Upper Case, and you will get the final result as hash value
Hash value = 6797F1842DEB4F3EBAEAD53E1BAFD5A535D322B9FA3893F201FDB03933EEAE09
Step V - Submit Form
Once the checkout form is prepared, the user can click on the submit button or the merchant can implement an automatic javascript for form auto submit and user will be redirected to PayGoal Payment Page.
- In order to achieve better success rate, PayGoal recommends that you redirect customers to the Payment Gateway in the same browser window.
- Amount format should be in the least parts without decimals like INR 1500.75 will be written as 150075 and INR 1.00 as 100
Step VI - Testing
You can use the below mentioned cards in your test suite
Card Network | Card Number |
---|---|
Mastercard |
5104 0155 5555 5558 5104 0600 0000 0008 |
Visa |
4111 1111 1111 1111 |
Step VII - Validating the response
It is mandatory for the merchant application to validate the transaction response in the status response.
This can be done as follows:
Using the response parameters, you are supposed to Match the response hash that is present in the response against the merchant application calculated hash value.
In case there is a mismatch in the merchant hash and response hash, that particular transaction must not be considered a successful transaction.
For successful transaction RESPONSE_CODE
is 000 and STATUS
is marked as “Captured” or “Approved”.
Please ensure that response Hash is validated in your production system.
Step VIII - Request Parameters
Field Name | Description | Required | Type* | Min | Max | Example |
---|---|---|---|---|---|---|
Merchant Details | ||||||
PAY_ID | Pay ID is a unique merchant identifier provided by PayGoal | YES | NU | 16 | 16 | 1001120714125722 |
ORDER_ID | Merchant reference number | YES | AN | 1 | 50 | PG859575 |
RETURN_URL | URL of merchant website to get the response after transaction is processed | YES | CH | 5 | 1024 | http://www.response.com |
HASH | Unique value generated by SHA 256 hashing algorithm | YES | AN | 64 | 64 | 7995156CE4C40C44C41BECA3B9CE09B9 |
Customer Details | ||||||
CUST_NAME | Customer name | NO | CH | 1 | 150 | Ankit Sharma |
CUST_FIRST_NAME | Customer first name | NO | CH | 2 | 150 | Ankit |
CUST_LAST_NAME | Customer last name | NO | CH | 2 | 150 | Sharma |
CUST_STREET_ADDRESS1 | Customer address | NO | CH | 2 | 250 | 293, B-Wing, DLF Moti Nagar |
CUST_CITY | Customer city | NO | CH | 2 | 50 | Delhi |
CUST_STATE | Customer state | NO | CH | 2 | 100 | Delhi |
CUST_COUNTRY | Customer country | NO | CH | 2 | 100 | India |
CUST_ZIP | Customer zip | NO | AN | 6 | 9 | 110015 |
CUST_PHONE* | Customer phone | NO | NU | 8 | 15 | 9876543210 |
CUST_ID* | Unique ID assigned to customer | NO | CH | 5 | 250 | CUST102365 |
CUST_EMAIL* | Customer email | NO | CH | 6 | 120 | ankit.sharma@gmail.com |
CUST_SHIP_LAST_NAME | Customer Shipping last name | NO | CH | 2 | 150 | Sharma |
CUST_SHIP_FIRST_NAME | Customer shipping first name | NO | CH | 2 | 150 | Ankit |
CUST_SHIP_NAME | Customer shipping name | NO | CH | 2 | 150 | Ankit Sharma |
CUST_SHIP_STREET_ADDRESS1 | Customer shipping address | NO | CH | 2 | 250 | 293, B-Wing, DLF Moti Nagar |
CUST_SHIP_STREET_ADDRESS2 | Customer shipping address | NO | CH | 2 | 250 | Block B |
CUST_SHIP_CITY | Customer shipping city | NO | CH | 2 | 50 | Delhi |
CUST_SHIP_STATE | Customer shipping state | NO | CH | 2 | 100 | Delhi |
CUST_SHIP_COUNTRY | Customer shipping country | NO | CH | 2 | 100 | India |
CUST_SHIP_ZIP | Customer shipping zip | NO | AN | 6 | 9 | 110015 |
CUST_SHIP_PHONE | Customer shipping phone | NO | NU | 8 | 15 | 9876543210 |
Payment Details | ||||||
AMOUNT** | Total Sale Amount | YES | NU | 3 | 12 | 100 |
CURRENCY_CODE | 3-digit code of the currency | YES | NU | 3 | 3 | 356 |
Item Level Details | ||||||
PRODUCT_DESC | Description of product | NO | CH | 1 | 1024 | PRODXYZ |
*(Abbreviation NU – Numeric, CH – Character, AN – Alphanumeric)
Response Parameters
Field name | Description | Example Value |
---|---|---|
CUST_NAME | Customer name | Ankit Sharma |
TXNTYPE | Type of transaction processed | SALE/AUTH |
AMOUNT | Total Sale Amount | 100 |
CURRENCY_CODE * | 3-digit code of the currency | 356 |
ORDER_ID | Merchant reference number | PG859575 |
PAY_ID | Pay ID is given by PayGoal | 1001120714125722 |
TXN_ID | Transaction Id generated by PayGoal to identify the current step | 754394526847844 |
PAYMENT_TYPE | Type of payment mode used by customer | CC/DC/NB |
MOP_TYPE | Method of payment | VI/MC/SBI |
CARD_MASK | Masked card number for card txns | 401200******7138 |
PG_REF_NUM | Id generated by PayGoal. Use for further communication with PayGoal, for tracking the full order | 157395783459207 |
RESPONSE_CODE * | Code for transaction status | 000 |
RESPONSE_MESSAGE * | Response message for transaction status | SUCCESS |
HASH* | Unique value generated by SHA 256 hashing algorithm | 7995156CE4C40C44C41BECA3B9CE09B9 |
ECI | Bank issued ECI flag | |
AUTH_CODE | Authorization code | 123456 |
RRN | Bank reference number | 763812937 |
AVR | Address verification flag | Y/N |
ACQ_ID | Bank reference number | ABC1234 |
STATUS | Transaction status | Approved/Captured/Declined |
CUST_EMAIL | Echo back field | ankit.sharma@gmail.com |
CUST_ID | Echo back field | |
CUST_PHONE | Echo back field | |
PG_TXN_MESSAGE | Detailed message for transaction | |
RETURN_URL | Merchant return URL in request | www.merchantsite.com/paymentresponse |
RESPONSE_DATE | Date of response | dd/mm/yyyy |
RESPONSE_TIME | Time of response | hh:mm:ss |
PRODUCT_DESC | Description of product | PRODXYZ |
CARD_ISSUER_BANK | Card issuing bank | SBI |
CARD_ISSUER_COUNTRY | Issuing country of the customer card | India |
TOTAL_AMOUNT | Total amount debited to customer in case of surcharge model | 10134 |
Step IX - Response Code
For successful transaction RESPONSE_CODE
is 000. Any other response code other than 000, shall be treated as unsuccessful transaction.