项目作者: ManuelGil

项目描述 :
Integration of PayU Latam Payments PHP SDK
高级语言: PHP
项目地址: git://github.com/ManuelGil/PayU-Integration-SDK.git
创建时间: 2019-02-07T19:08:55Z
项目社区:https://github.com/ManuelGil/PayU-Integration-SDK

开源协议:

下载



PayU Integration SDK


:traffic_light: 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
  1. $ cd /d C:\xampp\htdocs
  • Linux
  1. $ cd /opt/lampp/htdocs
  • MAC
  1. $ cd applications/mamp/htdocs
  1. Go to the project folder
  1. $ cd PayU-Integration-SDK
  1. Install with composer
  1. $ composer install

Or

  1. $ 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.

:package: Deployment

Installing cURL extension

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

Installing XML extension

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

Routes

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

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

  1. args = [
  2. // Enter the reference code here.
  3. string $referenceCode => "payment_test_00000001",
  4. // Enter the description here.
  5. string $description => "payment test",
  6. // Enter the value here.
  7. string $amount => "20000",
  8. // Enter the value of the VAT (Value Added Tax only valid for Colombia) of the transaction,
  9. // if no VAT is sent, the system will apply 19% automatically. It can contain two decimal digits.
  10. // Example 19000.00. In case you have no VAT you should fill out 0.
  11. string $tax => "3193",
  12. // Enter the value of the base value on which VAT (only valid for Colombia) is calculated.
  13. // If you do not have VAT should be sent to 0.
  14. string $taxReturnBase => "16806",
  15. // Enter the currency here.
  16. string $currency => "COP",
  17. // Enter the name of the buyer here.
  18. string $buyerName => "First name and second buyer name",
  19. // Enter the email of the buyer here.
  20. string $buyerEmail => "buyer_test@test.com",
  21. // Enter the telephone number of the buyer here.
  22. string $buyerPhone => "7563126",
  23. // Enter the contact document of the buyer here.
  24. string $buyerDocument => "5415668464654",
  25. // Enter the name of the payer here.
  26. string $payerName => "APPROVED",
  27. // Enter the email of the payer here.
  28. string $payerEmail => "payer_test@test.com",
  29. // Enter the telephone number of the payer here.
  30. string $payerPhone => "7563126",
  31. // Enter the contact document of the payer here.
  32. string $payerDocument => "5415668464654",
  33. // Enter the address of the payer here.
  34. string $shippingAddress => "calle 100",
  35. string $shippingCity => "Bogota",
  36. string $shippingState => "Bogota",
  37. string $shippingCountry => "CO",
  38. string $shippingPostalCode => "000000",
  39. // Enter the number of credit card here.
  40. string $cardNumber => "4097440000000004",
  41. // Enter the expiration date of the credit card here.
  42. string $cardExpirationDate => "2020/12",
  43. // Enter the security code of the credit card here.
  44. string $cardSecurityCode => "321",
  45. // Enter the credit card name here.
  46. // VISA||MASTERCARD||AMEX||DINERS
  47. string $paymentMethod => "VISA",
  48. // Enter the number of installments here.
  49. string $installments => "1",
  50. ]
  • 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

  1. args = [
  2. // Enter the reference code here.
  3. string $referenceCode => "payment_test_00000001",
  4. // Enter the description here.
  5. string $description => "payment test",
  6. // Enter the value here.
  7. string $amount => "20000",
  8. // Enter the value of the VAT (Value Added Tax only valid for Colombia) of the transaction,
  9. // if no VAT is sent, the system will apply 19% automatically. It can contain two decimal digits.
  10. // Example 19000.00. In case you have no VAT you should fill out 0.
  11. string $tax => "3193",
  12. // Enter the value of the base value on which VAT (only valid for Colombia) is calculated.
  13. // If you do not have VAT should be sent to 0.
  14. string $taxReturnBase => "16806",
  15. // Enter the currency here.
  16. string $currency => "COP",
  17. // Enter the buyer's email here.
  18. string $buyerEmail => "buyer_test@test.com",
  19. // Enter the payer's name here.
  20. string $payerName => "First name and second payer name",
  21. // Enter the payer's email here.
  22. string $payerEmail => "payer_test@test.com",
  23. // Enter the payer's contact phone here.
  24. string $payerPhone => "7563126",
  25. // Enter the bank PSE code here.
  26. string $pseBank => "1007",
  27. // Enter the person type here (Natural or legal).
  28. string $personType => "N",
  29. // Enter the payer's contact document here.
  30. string $payerDocument => "123456789",
  31. // Enter the payer’s document type here: CC, CE, NIT, TI, PP,IDC, CEL, RC, DE.
  32. string $payerDocumentType => "CC",
  33. ]

:100: Running the tests

Use index.html for testing.

:wrench: Built With

:information_source: 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


:eyeglasses: Authors

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

:memo: License

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