PHP Classes

PayU Button generator: Generate payment buttons for PayU system

Recommend this page to a friend!
  Info   View files Example   Demos   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 69 This week: 1All time: 10,266 This week: 560Up
Version License PHP version Categories
payugenerator 1.0.0Freely Distributable5HTML, PHP 5, E-Commerce
Description 

Author

This class can generate payment buttons for PayU system.

It takes several types of details for payment of goods to be purchased.

The class can generate HTML for a form with all the payment details in hidden inputs and a payment button than will make the page be redirected to the PalU payment pages.

The payment buttons can redirect either to the real payments site or its sandbox pages. It can open on the current or a blank browser Window.

Picture of Oliver Leuyim Angel
  Performance   Level  
Name: Oliver Leuyim Angel <contact>
Classes: 7 packages by
Country: Mexico Mexico
Age: 37
All time rank: 114412 in Mexico Mexico
Week rank: 52 Up2 in Mexico Mexico Up

Example

<?php
/*
  PayU Button generator by Oliver Leuyim Angel oliver.angel@dimworks.org www.dimworks.org

  VERSION 1.0

  Creates a PayU button for Checkout, Fully customizable.

  USAGE:

  require_once('payu.inc.php'); //require the class include file

  $button2 = new PayUButton; //initiate the class instance
  $button2->ApiKey = '4Vj8eK4rloUd272L48hsrarnUA'; //the api key of the merchant that is registered with payu where money will be sent to
  $button2->merchantId = '508029'; //the merchant id that is registered with payu where money will be sent to
  $button2->accountId = '512324'; //the account id that is registered with payu where money will be sent to
  $button2->amount = "7809.25"; //the amount of the order
  $button2->referenceCode = "Num2319487"; // a reference of the payment to validate in all services
  $button2->class = 'payubutton'; //CSS class to apply to the button. Comes in very handy
  $button2->width = '150'; //button width in pixels. Will apply am Inline CSS Style to the button. Comment if not needed.
  $button2->buttonimage = 'http://www.payulatam.com/logos/logo.php?l=123&c=58f6d9e5645e8'; //img to use for this button
  $button2->buttontext = 'I agree, proceed to Payment'; //text to use if image not found or not specified
  $button2->responseUrl = '?ext=ipnU&action=success'; //url of the page users are sent to after successful payment
  $button2->confirmationUrl = '?ext=ipnU&action=ipn'; //url of the IPN page (this overrides account settings, IF IPN has been setup at all.

  $button2->test = 1; // Let the class know if is a test 1 for test, 0 for real live

  $button2->buyerFullName = "Jorge Cadenas Largas"; // Full name of the buyer
  $button2->buyerEmail = "any@buyermail.com"; // Mail of the buyer
  $button2->shippingAddress = "one address of nevada #178"; // address of the buyer
  $button2->shippingCity = "Nevada"; // City of the buyer
  $button2->shippingCountry = "EEUU"; // Country of the buyerr
  $button2->telephone = "3776802347; // Tel of the buyer

  $button2->description = "Payment of the bill"; // Description of the bill or products or service.
  $button2->OutputButton(); //output the button!
                           

  -------------------------------------------------------------------------------
  UPDATE LOG:
  -------------------------------------------------------------------------------

  17-04-2017 Version 1.0 Release



 */


require_once('payu.inc.php'); //require the class include file

 
$button2 = new PayUButton; //initiate the class instance
 
$button2->ApiKey = '4Vj8eK4rloUd272L48hsrarnUA'; //the api key of the merchant that is registered with payu where money will be sent to
 
$button2->merchantId = '508029'; //the merchant id that is registered with payu where money will be sent to
 
$button2->accountId = '512324'; //the account id that is registered with payu where money will be sent to
 
$button2->amount = "7809.25"; //the amount of the order
 
$button2->referenceCode = "Num2319487"; // a reference of the payment to validate in all services
 
$button2->class = 'payubutton'; //CSS class to apply to the button. Comes in very handy
 
$button2->width = '150'; //button width in pixels. Will apply am Inline CSS Style to the button. Comment if not needed.
 
$button2->buttonimage = 'http://www.payulatam.com/logos/logo.php?l=123&c=58f6d9e5645e8'; //img to use for this button
 
$button2->buttontext = 'I agree, proceed to Payment'; //text to use if image not found or not specified
 
$button2->responseUrl = '?ext=ipnU&action=success'; //url of the page users are sent to after successful payment
 
$button2->confirmationUrl = '?ext=ipnU&action=ipn'; //url of the IPN page (this overrides account settings, IF IPN has been setup at all.

 
$button2->test = 1; // Let the class know if is a test 1 for test, 0 for real live

 
$button2->buyerFullName = "Jorge Cadenas Largas"; // Full name of the buyer
 
$button2->buyerEmail = "any@buyermail.com"; // Mail of the buyer
 
$button2->shippingAddress = "one address of nevada #178"; // address of the buyer
 
$button2->shippingCity = "Nevada"; // City of the buyer
 
$button2->shippingCountry = "EEUU"; // Country of the buyerr
 
$button2->telephone = "3776802347; // Tel of the buyer

 
$button2->description = "Payment of the bill"; // Description of the bill or products or service.
 
$button2->OutputButton(); //output the button!


?>


  encompra.comExternal page  

Open in a separate window

  Files folder image Files  
File Role Description
Plain text file payu.inc.php Class the php class
Accessible without login Plain text file ExampleAndDocumentation.php Example The example to use and the documentation of the class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:69
This week:1
All time:10,266
This week:560Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1509