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.
- PHP 5.2.1 or greater
- cURL extension
- XML extension
- mbstring extension
- JSON extension
- Clone or Download this repository
- Unzip the archive if needed
- Copy the folder in the htdocs dir
- Start a Text Editor (Atom, Sublime, Visual Studio Code, Vim, etc)
- Add the project folder to the editor
- Go to htdocs dir
- Windows
$ cd /d C:\xampp\htdocs
- Linux
$ cd /opt/lampp/htdocs
- MAC
$ cd applications/mamp/htdocs
- Go to the project folder
$ cd PayU-Integration-SDK
- Install with composer
$ composer install
Or
$ sudo php composer.phar install
Copy the .env.example
file and call it .env
.
Change the database configuration in the new file.
- Install cURL
$ sudo apt-get install curl
- Restart Apache
$ sudo service apache2 restart
- 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
- Restart Apache
$ sudo service apache2 restart
- 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
- Restart Apache
$ sudo service apache2 restart
-
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",
]
Use index.html
for testing.
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
- Manuel Gil - Owner - ManuelGil
See also the list of contributors who participated in this project.
This API is licensed under the MIT License - see the MIT License for details.