{"id":14974815,"url":"https://github.com/somosgad/laravel-payu","last_synced_at":"2025-10-27T10:30:48.998Z","repository":{"id":57055627,"uuid":"227213222","full_name":"somosgad/laravel-payu","owner":"somosgad","description":"A Laravel package to encapsulate global PayU requests.","archived":false,"fork":false,"pushed_at":"2020-02-03T20:52:47.000Z","size":116,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T04:51:24.066Z","etag":null,"topics":["laravel","laravel-framework","laravel-package","laravel6","payment","payment-integration","payment-methods","payment-module","payments","paymentsos","payu"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/somosgad.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-10T20:50:53.000Z","updated_at":"2022-04-11T21:43:54.000Z","dependencies_parsed_at":"2022-08-24T05:21:26.157Z","dependency_job_id":null,"html_url":"https://github.com/somosgad/laravel-payu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somosgad%2Flaravel-payu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somosgad%2Flaravel-payu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somosgad%2Flaravel-payu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somosgad%2Flaravel-payu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somosgad","download_url":"https://codeload.github.com/somosgad/laravel-payu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238480583,"owners_count":19479518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-framework","laravel-package","laravel6","payment","payment-integration","payment-methods","payment-module","payments","paymentsos","payu"],"created_at":"2024-09-24T13:51:07.163Z","updated_at":"2025-10-27T10:30:48.658Z","avatar_url":"https://github.com/somosgad.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-payu\n\nA Laravel package to encapsulate global PayU requests. More info at [PaymentsOS Docs][link-payudocs].\u003cbr\u003e\n\n\u003c!-- [![Latest Version on Packagist][ico-version]][link-packagist] --\u003e\n[![Total Downloads][ico-downloads]][link-downloads] \n\u003c!-- [![Build Status][ico-travis]][link-travis] --\u003e\n\u003c!-- [![StyleCI][ico-styleci]][link-styleci] --\u003e\n\n**Currently in development**\n\n\u003c!-- Take a look at [contributing.md][link-contributing] to see a to do list. --\u003e\n\n## Installation\n\nVia [Composer][link-composer]\n\n```bash\ncomposer require somosgad/laravel-payu:dev-master\n```\n\n## Configuration\n\n### Set API variables\n\nSet your PayU configs at `.env` file\n\n```ini\nPAYU_APP_ID=\nPAYU_ENV=\nPAYU_PUBLIC_KEY=\nPAYU_PRIVATE_KEY=\nPAYU_PROVIDER=\n```\n\nYour `.env` file must end up looking like:\n\n\n```ini\nPAYU_APP_ID=com.foo.bar\nPAYU_ENV=test\nPAYU_PUBLIC_KEY=g6l2g4yn-nvgp-uiil-6fm7-d2337cegunmz\nPAYU_PRIVATE_KEY=68lhkww3-lkgw-4mcc-r21m-cf8nnnx3wj2k\nPAYU_PROVIDER=\"PayU Argentina\"\n```\n\n### Export Config\n\n```bash\nphp artisan vendor:publish --provider=\"SomosGAD_\\LaravelPayU\\LaravelPayUServiceProvider\"\n```\n\n## Usage\n\n```php\nuse SomosGAD_\\LaravelPayU\\LaravelPayU;\n\n$payu = new LaravelPayU;\n```\n\n---\n\n### Payment\n\n#### Create\n```php\n$amount = 2000;\n$currency = 'USD';\n$payment = $payu-\u003ecreatePayment($amount, $currency);\n```\n\n---\n\n### Create Token\n\n```php\n$card_number = '4111111111111111';\n$credit_card_cvv = '123';\n$expiration_date = '10/29';\n$holder_name = 'John Doe';\n$token_type = 'credit_card';\n$token = $payu-\u003ecreateToken(\n    $card_number,\n    $credit_card_cvv,\n    $expiration_date,\n    $holder_name,\n    $token_type\n);\n```\n\n### Create Authorization\n\n```php\n$authorization = $payu-\u003ecreateAuthorization($payment['id'], $encrypted_cvv, $token);\n```\n\n### Create Capture\n\n```php\n$capture = $payu-\u003ecreateCapture($payment['id'], $payment['amount']);\n```\n\n---\n\n### Charge\n\n#### Create Card Charge\n\n```php\n$charge = $payu-\u003ecreateCharge($payment['id'], $token);\n```\n\n#### Create Cash Charge\n\n```php\n$charge = $payu-\u003ecreateCharge2($payment['id'], [\n    'payment_method' =\u003e [\n        'source_type' =\u003e 'cash',\n        'type' =\u003e 'untokenized',\n        'vendor' =\u003e 'COBRO_EXPRESS',\n        'additional_details' =\u003e [\n            'order_language' =\u003e 'en',\n            'cash_payment_method_vendor' =\u003e 'COBRO_EXPRESS',\n            'payment_method' =\u003e 'PSE',\n            'payment_country' =\u003e 'ARG',\n        ],\n    ],\n    'reconciliation_id' =\u003e time(),\n];\n```\n\n\\* Notes:\n\n1. `order_language` is always uppercased for you; \n2. Omitted `reconciliation_id` gets created;\n3. Only `ARG` `payment_country` are able to create cash charges for Argentina;\n4. Payments for cash charges must be created with `customer_id` set and customer must have `shipping_address` set with at least one field, otherwise, the receipt won't be printable or downloadable.\n\n---\n\n### Customer\n\n#### Create Customer\n\n##### Required Props\n\n```php\n$customer = $payu-\u003ecreateCustomer([\n    'customer_reference' =\u003e 'johntravolta18021954',\n]);\n```\n\n\\* Notes:\n\n1. `customer_reference`s are unique, API won't create customers for same references. Choose something like an ID, document or anything else unique and immutable to set as `customer_reference`.\n2. PayU Argentina won't print or download PDF if you haven't set customer's `shipping_address` with at least one info (like `country` or any other field).\n\n##### Customer Sample from PayU API Docs\n\n```php\n$customer = $payu-\u003ecreateCustomer([\n    'customer_reference' =\u003e 'johntravolta18021954',\n    'email' =\u003e 'john@travolta.com',\n]);\n```\n\n##### Optional Props\n\n```php\n$customer = $payu-\u003ecreateCustomer([\n    'customer_reference' =\u003e 'johntravolta18021954',\n    'email' =\u003e 'john@travolta.com',\n    'first_name' =\u003e 'John',\n    'last_name' =\u003e 'Travolta',\n    'additional_details' =\u003e [\n        'extra1' =\u003e 'Info Extra 1',\n        'extra2' =\u003e 'Info Extra 2',\n    ],\n    'shipping_address' =\u003e [\n        'country' =\u003e 'ARG',\n        'state' =\u003e 'TX',\n        'city' =\u003e 'Customer Shipping City',\n        'line1' =\u003e '10705 Old Mill Rd',\n        'line2' =\u003e '10706 Young Mill Rd',\n        'zip_code' =\u003e '75402-3435',\n        'title' =\u003e 'Dr.',\n        'first_name' =\u003e 'John',\n        'last_name' =\u003e 'Travolta',\n        'phone' =\u003e '23645963',\n        'email' =\u003e 'john@travolta.com',\n    ],\n]);\n```\n\n#### Delete Customer\n\n```php\n$customer_id = '0ab5511c-3a62-4b4b-8682-cb3c15172965';\n$delete = $payu-\u003edeleteCustomer($customer_id);\n```\n\n#### Get Customer by ID\n\n```php\n$customer_id = '0ab5511c-3a62-4b4b-8682-cb3c15172965';\n$customer = $payu-\u003egetCustomerById($customer_id);\n```\n\n#### Get Customers by Reference\n\n```php\n$customer_reference = 'johntravolta18021954';\n$customers = $payu-\u003egetCustomerByReference($customer_reference);\n```\n\\* Note: `getCustomerByReference` returns an `array` not a single record like `getCustomerById`;\n\n---\n\n### Create Payment Method\n\n```php\n$payment_method = $payu-\u003ecreatePaymentMethod($customer['id'], $token);\n```\n\n\u003c!-- ## Change log\n\nPlease see the [changelog][link-changelog] for more information on what has changed recently. --\u003e\n\n## Testing\n\n\u003c!-- # $ composer test --\u003e\n\n``` bash\nphpunit\n```\n\n## Contributing\n\nFeel free to contribute with anything on this package or contact us about it.\n\n\u003c!-- Please see [contributing.md][link-contributing] for details and a todolist. --\u003e\n\n## Security\n\nIf you discover any security related issues, please email giovanni@somosgad.com instead of using the issue tracker.\n\n## Credits\n\n- [Somos GAD_][link-author]\n- [Giovanni Pires da Silva][link-giovanni]\n- [Camilo Cunha de Azevedo][link-camilo]\n- [Danner Terra][link-danner]\n- [All Contributors][link-contributors]\n\n## License\n\nMIT. Please see the [license file](license.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/somosgad/laravel-payu.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/somosgad/laravel-payu.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/somosgad/laravel-payu/master.svg?style=flat-square\n[ico-styleci]: https://styleci.io/repos/12345678/shield\n\n[link-packagist]: https://packagist.org/packages/somosgad/laravel-payu\n[link-downloads]: https://packagist.org/packages/somosgad/laravel-payu\n[link-travis]: https://travis-ci.org/somosgad/laravel-payu\n[link-styleci]: https://styleci.io/repos/12345678\n[link-author]: https://github.com/somosgad\n[link-giovanni]: https://github.com/giovannipds\n[link-camilo]: https://github.com/Camilotk\n[link-danner]: https://github.com/DannerTerra\n[link-contributors]: ../../contributors\n[link-composer]: https://getcomposer.org\n[link-payudocs]: https://developers.paymentsos.com\n[link-changelog]: changelog.md\n[link-contributing]: contributing.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomosgad%2Flaravel-payu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomosgad%2Flaravel-payu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomosgad%2Flaravel-payu/lists"}