0% found this document useful (0 votes)
52 views1 page

Mandatory Parameters: Key Txnid Amount Productinfo Firstname Email Phone Surl Furl

The document describes the PayU payment API. It lists the mandatory parameters needed to make a payment including the merchant ID, transaction ID, amount, customer details, and success/failure URLs. It provides an example of making a simple payment using the pay_page function, passing in the required parameters and a salt obtained from PayU. On success, the payment_success function would be called, and on failure payment_failure would be triggered.

Uploaded by

Abhinay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views1 page

Mandatory Parameters: Key Txnid Amount Productinfo Firstname Email Phone Surl Furl

The document describes the PayU payment API. It lists the mandatory parameters needed to make a payment including the merchant ID, transaction ID, amount, customer details, and success/failure URLs. It provides an example of making a simple payment using the pay_page function, passing in the required parameters and a salt obtained from PayU. On success, the payment_success function would be called, and on failure payment_failure would be triggered.

Uploaded by

Abhinay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PayU

Payments made Easy

Mandatory Parameters
key Merchant ID provided by PayU.
txnid Transaction number that you would use to track orders. [ Must be unique ]
amount Payment Amount [ Type cast the amount to float ]
productinfo Product Description
firstname [ Only alphabets 'a' 'z' are allowed ]
email [ Must be a valid email id. ]
phone [ Numeric value only ]
surl Function to call in case of successful payment
furl Function to call in case of failed payment

salt Required for payment api. [ Obtained from PayU ]

Simple Pay API


pay_page( array ('key' => [ Merchant ID provided by PayU ],
'txnid' => [ Unique Transaction Number ],
'amount' => [ Payment Amount ],
'firstname' => [ Name of the customer ],
'email' => [ Email Id of the customer ],
'phone' => [ Mobile / Landline Number ],
'productinfo'=> [ Product Description ],
'surl' => [ Function ( success* ) to call in case of successful payment ],
'furl' => [ Function ( failure* ) to call in case of failed payment ]),
[ Salt obtained from PayU ] );

* success : This function needs to be defined.


* failure : This function needs to be defined.

Simple Pay Example


/* Include the payu library. */
require_once ' payu.php';

/* Call the pay_page function with the mandatory arguments. */


pay_page( array ('key' => 'tradus', 'txnid' => uniqid( 'animesh_' ),
'amount' => rand( 0, 100 ),'firstname' => 'animesh',
'email' => '[email protected]', 'phone' => '1234567890',
'productinfo' => 'Product Info', 'surl' => 'payment_success',
'furl' => 'payment_failure'), '200' );

/* Payment successful - logic goes here. */


function payment_success() {
echo "Payment Success" . "<pre>" . print_r( $_POST, true ) . "</pre>";
}

/* Payment failed - logic goes here. */


function payment_failure() {
echo "Payment Failure" . "<pre>" . print_r( $_POST, true ) . "</pre>";
}

You might also like