Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

ManuelGil/PayU-Integration-SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayU Integration SDK

🚥 Getting Started

Integrate your application with the PayU platform. Create a connector using the PayU Latam Payments PHP SDK and use that connector to connect to the PayU ecosystem.

Requirements

  • PHP 5.2.1 or greater
  • cURL extension
  • XML extension
  • mbstring extension
  • JSON extension

Installation

Copy this project

  1. Clone or Download this repository
  2. Unzip the archive if needed
  3. Copy the folder in the htdocs dir
  4. Start a Text Editor (Atom, Sublime, Visual Studio Code, Vim, etc)
  5. Add the project folder to the editor

Install the project

  1. Go to htdocs dir
  • Windows
$ cd /d C:\xampp\htdocs
  • Linux
$ cd /opt/lampp/htdocs
  • MAC
$ cd applications/mamp/htdocs
  1. Go to the project folder
$ cd PayU-Integration-SDK
  1. Install with composer
$ composer install

Or

$ sudo php composer.phar install

Configure the project

Copy the .env.example file and call it .env.

Change the database configuration in the new file.

📦 Deployment

Installing cURL extension

  1. Install cURL
$ sudo apt-get install curl
  1. Restart Apache
$ sudo service apache2 restart
  1. Install PHP CURL
  • PHP 7.2:
$ sudo apt-get install php7.2-curl
  • PHP 7.1:
$ sudo apt-get install php7.1-curl
  • PHP 7.0:
$ sudo apt-get install php7.0-curl
  • PHP 5.6:
$ sudo apt-get install php5.6-curl
  • PHP 5.5:
$ sudo apt-get install php5.5-curl
  1. Restart Apache
$ sudo service apache2 restart

Installing XML extension

  1. Install PHP XML
  • PHP 7.2:
$ sudo apt-get install php7.2-xml
  • PHP 7.1:
$ sudo apt-get install php7.1-xml
  • PHP 7.0:
$ sudo apt-get install php7.0-xml
  • PHP 5.6:
$ sudo apt-get install php5.6-xml
  • PHP 5.5:
$ sudo apt-get install php5.5-xml
  1. Restart Apache
$ sudo service apache2 restart

Routes

  • post => /payments - This method is used for make payments. e.g.:

    uri = http://localhost/PayU-Integration-SDK/public/payments

  args = [
    // Enter the reference code here.
    string	$referenceCode				=>	"payment_test_00000001",
    // Enter the description here.
    string	$description    			=>	"payment test",
    // Enter the value here.
    string	$amount          			=>	"20000",
    // Enter the value of the VAT (Value Added Tax only valid for Colombia) of the transaction,
    // if no VAT is sent, the system will apply 19% automatically. It can contain two decimal digits.
    // Example 19000.00. In case you have no VAT you should fill out 0.
    string	$tax             			=>	"3193",
    // Enter the value of the base value on which VAT (only valid for Colombia) is calculated.
    // If you do not have VAT should be sent to 0.
    string	$taxReturnBase				=>	"16806",
    // Enter the currency here.
    string	$currency        			=>	"COP",
    // Enter the name of the buyer here.
    string	$buyerName    				=>	"First name and second buyer name",
    // Enter the email of the buyer here.
    string	$buyerEmail      			=>	"[email protected]",
    // Enter the telephone number of the buyer here.
    string	$buyerPhone      			=>	"7563126",
    // Enter the contact document of the buyer here.
    string	$buyerDocument   			=>	"5415668464654",
    // Enter the name of the payer here.
    string	$payerName   				=>	"APPROVED",
    // Enter the email of the payer here.
    string	$payerEmail      			=>	"[email protected]",
    // Enter the telephone number of the payer here.
    string	$payerPhone      			=>	"7563126",
    // Enter the contact document of the payer here.
    string	$payerDocument   			=>	"5415668464654",
    // Enter the address of the payer here.
    string	$shippingAddress			=>	"calle 100",
    string	$shippingCity				=>	"Bogota",
    string	$shippingState				=>	"Bogota",
    string	$shippingCountry			=>	"CO",
    string	$shippingPostalCode			=>  "000000",
    // Enter the number of credit card here.
    string	$cardNumber					=>	"4097440000000004",
    // Enter the expiration date of the credit card here.
    string	$cardExpirationDate			=>	"2020/12",
    // Enter the security code of the credit card here.
    string	$cardSecurityCode			=>	"321",
    // Enter the credit card name here. 
    // VISA||MASTERCARD||AMEX||DINERS
    string	$paymentMethod				=>	"VISA",
    // Enter the number of installments here.
    string	$installments				=>	"1",
  ]
  • get => /payments/banks - This method gets the banks list for PSE Payments. e.g.:

    uri = http://localhost/PayU-Integration-SDK/public/payments/banks

  • post => /payments/pse - This method is used for make PSE Payments. e.g.:

    uri = http://localhost/PayU-Integration-SDK/public/payments/pse

  args = [
    // Enter the reference code here.
    string	$referenceCode				=>	"payment_test_00000001",
    // Enter the description here.
    string	$description				=>	"payment test",
    // Enter the value here.
    string	$amount						=>	"20000",
    // Enter the value of the VAT (Value Added Tax only valid for Colombia) of the transaction,
    // if no VAT is sent, the system will apply 19% automatically. It can contain two decimal digits.
    // Example 19000.00. In case you have no VAT you should fill out 0.
    string	$tax						=>	"3193",
    // Enter the value of the base value on which VAT (only valid for Colombia) is calculated.
    // If you do not have VAT should be sent to 0.
    string	$taxReturnBase				=>	"16806",
    // Enter the currency here.
    string	$currency					=>	"COP",
    // Enter the buyer's email here.
    string	$buyerEmail					=>	"[email protected]",
    // Enter the payer's name here.
    string	$payerName					=>	"First name and second payer name",
    // Enter the payer's email here.
    string	$payerEmail					=>	"[email protected]",
    // Enter the payer's contact phone here.
    string	$payerPhone					=>	"7563126",
    // Enter the bank PSE code here.
    string	$pseBank					=>	"1007",
    // Enter the person type here (Natural or legal).
    string	$personType					=>	"N",
    // Enter the payer's contact document here.
    string	$payerDocument				=>	"123456789",
    // Enter the payer’s document type here: CC, CE, NIT, TI, PP,IDC, CEL, RC, DE.
    string	$payerDocumentType			=>	"CC",
  ]

💯 Running the tests

Use index.html for testing.

🔧 Built With

ℹ️ Changelog

0.0.0.4 (02/14/2019)

  • Language: PHP
    Changes:
    • Add the Banks List
    • Add PSE Payments

0.0.0.3 (02/10/2019)

  • Language: PHP
    Changes:
    • Change the 'Payments' route to POST method
    • Separate the payment controller

0.0.0.2 (02/09/2019)

  • Language: PHP
    Changes:
    • Composer Installation
    • PSR-4 Integration
    • Monolog Integration

0.0.0.1 (02/07/2019)

  • Language: PHP
    Changes:
    • Initial commit

👓 Authors

See also the list of contributors who participated in this project.

📝 License

This API is licensed under the MIT License - see the MIT License for details.