PayUMoney Payment Gateway Integration in PHP
A payment gateway is an online service that authorizes and processes payments for online businesses.PayUMoney is the most polular payment Gateway in India. Easily integrate PayUMoney in your Web Application to let your customer to pay through Credit Cards, Debit Cards, Net Banking etc. In this tutorial how to integrate PayUmoney Payment Gateway in your Web Application.A simple code explained in this tutorial will guide you to enable PayUMoney payment for your application.
Steps for integration PayUMoney Payment Gateway.
Step 1: Go to PayUmoney developer guide and then to website integration
Click on PHP Kit for download and Extract the downloaded zip which contains 2 files: index.php and response.php. Deploy these files on your server
Step 2: Create Account
Sign up as a merchant/wallet account.
Before you get started, take a look at the folders and files structure of PayUMoney Payment Gateway Integration in PHP
- payumoney-payment-gateway-integration-php
- css
- style.css
- images
- templates
- header.php
- footer.php
- config.php
- index.php
- request.php
- response.php
- css
Step 3: At time of sign up, you need to use your valid email address. As you are creating test account, you can enter whatever details for the live/testing purpose.
PayUmoney Merchant Test Key & Test Salt Credentials (Copy paste these credentials
config.php
)Step 4:Create a file request.php and index.php
Calculate the request hash on the server and pass it
key.'|'.$data->txnid.'|'.$data->amount.'|'.$data->pinfo.'|'.$data->fname.'|'.$data->email.'|||||'.$data->udf5.'||||||'.$data->salt); $json=array(); $json['success'] = $hash; echo json_encode($json); } exit(0); } ?>
index.php
For test integration use URL:
https://sboxcheckout-static.citruspay.com/bolt/run/bolt.min.js
For live integration use URL:
https://checkout-static.citruspay.com/bolt/run/bolt.min.js
PayUMoney Payment Gateway Integration in PHP
(Visa) Card Name: TestCard Number: 4012001037141112Expiry Date :CVV : 123(Master) Card Name: TestCard Number: 5123456789012346Expiry Date :CVV : 123
Step 5: jQuery and Ajax Code:
We will also need to use Ajax code in index.php make Ajax request/response data.The details of the parameters to be passed as data object are detailed in transaction request/response parameters section.
Step 6: Create a file named response.php
if Payment process done success/failure.
Transaction Successful and Hash Verified...
Payment failed for Hasn not verified...
';
}
}
else exit(0);
?>
PayUMoney Payment Gateway Integration in PHP
Merchant Key:
Merchant Salt:
Transaction/Order ID:
Amount:
Product Info:
Name:
Emaul ID:
Mihpayid:
Hash:
Transaction Status:
Test MERCHANT KEY, Salt and Credentials for PayUMoney Payment Gateway
KEY:
mGgkQuFR
SALT:
WD297ko2zb
(Visa) Card Name: Test
Card Number: 4012001037141112
Expiry Date : 05/20
CVV : 123
(Master) Card Name: Test
Card Number: 5123456789012346
Expiry Date : 05/20
CVV : 123