{"id":17398918,"url":"https://github.com/noweh/laravel-payzen","last_synced_at":"2025-04-16T01:47:59.297Z","repository":{"id":45564882,"uuid":"383374869","full_name":"noweh/laravel-payzen","owner":"noweh","description":"This library provides an easy and fast Payzen form creation.","archived":false,"fork":false,"pushed_at":"2023-07-13T15:38:19.000Z","size":32,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T15:07:06.449Z","etag":null,"topics":["laravel","payzen","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noweh.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-06T07:12:37.000Z","updated_at":"2025-04-03T16:16:39.000Z","dependencies_parsed_at":"2024-10-20T11:15:29.601Z","dependency_job_id":null,"html_url":"https://github.com/noweh/laravel-payzen","commit_stats":{"total_commits":18,"total_committers":4,"mean_commits":4.5,"dds":0.2222222222222222,"last_synced_commit":"30725ef3ee6e339ebaefa89694ad49c253c513ab"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-payzen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-payzen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-payzen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noweh%2Flaravel-payzen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noweh","download_url":"https://codeload.github.com/noweh/laravel-payzen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182966,"owners_count":21226123,"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","payzen","php"],"created_at":"2024-10-16T15:03:05.333Z","updated_at":"2025-04-16T01:47:59.252Z","avatar_url":"https://github.com/noweh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel-Payzen\n\n[![Payzen](https://img.shields.io/static/v1?message=Payzen\u0026color=blue\u0026logo=Payzen\u0026logoColor=FFFFFF\u0026label=)](https://payzen.io/en-EN/)\n[![Laravel](https://img.shields.io/badge/Laravel-v5/6/7/8/9/10-828cb7.svg?logo=Laravel\u0026color=FF2D20)](https://laravel.com/)\n[![Run Tests](https://github.com/noweh/laravel-payzen/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/noweh/laravel-payzen/actions/workflows/run-tests.yml)\n[![MIT Licensed](https://img.shields.io/github/license/noweh/laravel-payzen)](LICENSE)\n[![last version](https://img.shields.io/packagist/v/noweh/laravel-payzen)](https://packagist.org/packages/noweh/laravel-payzen)\n[![Downloads](https://img.shields.io/packagist/dt/noweh/laravel-payzen)](https://packagist.org/packages/noweh/laravel-payzen)\n\nThe library provides an easy and fast Payzen form creation.\nThis helps to instanciate all required parameters and create the form to access to payment interface.\nTo know required parameters, go to https://payzen.io/en-EN/form-payment/quick-start-guide/sending-a-payment-form-via-post.html\n\n## Installation\nFirst you need to add the component to your composer.json\n```\ncomposer require noweh/laravel-payzen\n```\nUpdate your packages with *composer update* or install with *composer install*.\n\nLaravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.\n\n### Laravel without auto-discovery\n\n    Noweh\\Payzen\\PayzenServiceProvider::class,\n\nTo use the facade, add this in app.php:\n\n    'Payzen' =\u003e Noweh\\Payzen\\PayzenFacade::class,\n\n### Service Provider\nAfter updating composer, add the ServiceProvider to the providers array in config/app.php\n\n## Configuration file\n\nNext, you must migrate config :\n\n    php artisan vendor:publish --provider=\"Noweh\\Payzen\\PayzenServiceProvider\"\n\n## Create a payment form\nNow we are finally ready to use the package! Here is a little example:\n```php\n     $blocks_html = \\Payzen::set_amount(300)\n        -\u003eset_trans_id(123456)\n        -\u003eset_order_info(\\Payzen::ascii_transcode('an information', 'an', 255, true))\n        -\u003eset_order_info2(\\Payzen::ascii_transcode('another information', 'an', 255, true))\n        -\u003eset_url_return(request()-\u003efullUrl())\n        -\u003eset_return_mode('POST')\n        -\u003eset_signature()\n        -\u003eget_form('\u003cdiv\u003e\u003cinput id=\"spSubmit\" type=\"submit\" value=\"Pay\" class=\"Button Button--black\"\u003e\u003c/div\u003e')\n    ;\n```\n\n## Check Payzen response signature\n```php\n     $payzen = \\Payzen::set_params(\\Arr::where(request()-\u003eall(), function($value, $key) {\n                 \treturn strrpos($key, 'vads_', -5) !== false;\n             \t}))\n     \t\t\t-\u003eset_signature()\n     \t\t;\n             return (request()-\u003einput('signature') \u0026\u0026 ($payzen::get_signature() === request()-\u003einput('signature')));\n    ;\n```\n\n## Other useful functions\n\n### add_product\nAdd a product to the order\n#### Parameters\narray $product , must have the following keys : 'label,amount,type,ref,qty\n#### Example\n```php\n    \\Payzen::add_product(\n        [\n            'label' =\u003e 'Concert Coldplay 2016',\n            'amount' =\u003e 235.00,\n            'type' =\u003e 'ENTERTAINMENT',\n            'ref' =\u003e 'COLD016',\n            'qty' =\u003e 3\n        ]\n    );\n```\nNote : the amount of each products price **must not** be multiplied by 100\n\n### set_amount\nDefines the total amount of the order. If you doesn't give the amount in parameter, it will be automaticly calculated by the sum of products you've got in your basket.\n#### Parameters\n[optional] int $amount, Payzen format. ex : for a product with a price of 150€, give 15000\n#### Example\n```php\n   $payzen = \\Payzen::add_product(\n       [\n           'label' =\u003e 'Concert Coldplay 2016',\n           'amount' =\u003e 235.00,\n           'type' =\u003e 'ENTERTAINMENT',\n           'ref' =\u003e 'COLD016',\n           'qty' =\u003e 3\n       ]\n   );\n   $payzen-\u003eset_amount();\n   echo $payzen-\u003eget_amount(); //will display 705.00 (3*235.00)\n```\n\n### get_amount\nGet total amount of the order\n#### Parameters\n[optional] bool $decimal if true, you get a decimal otherwise you get standard Payzen amount format (int). Default value is true.\n#### Example\n```php\n  $payzen = \\Payzen::add_product(\n      [\n          'label' =\u003e 'Concert Coldplay 2016',\n          'amount' =\u003e 235.00,\n          'type' =\u003e 'ENTERTAINMENT',\n          'ref' =\u003e 'COLD016',\n          'qty' =\u003e 3\n      ]\n  );\n  $payzen-\u003eset_amount();\n  echo $payzen-\u003eget_amount(); //will display 705.00 (3*235.00)\n  echo $payzen-\u003eget_amount(false); //will display 70500 (3*235.00)\n```\n\n### set_params\nMethod to do massive assignement of parameters\n#### Parameters\narray $params associative array of Payzen parameters\n#### Example\n```php\n   \\Payzen::set_params(\n       [\n           'vads_page_action' =\u003e 'PAYMENT',\n           'vads_action_mode' =\u003e 'INTERACTIVE',\n           'vads_payment_config' =\u003e 'SINGLE',\n           'vads_version' =\u003e 'V2',\n           'vads_trans_date' =\u003e gmdate('YmdHis'),\n           'vads_currency' =\u003e '978'\n       ]\n   );\n```\n\n### ascii_transcode\nMethod to convert an input in a compatible for Payzen\n#### Parameters\nstring $input, text to convert\n\nstring $allow, n|a|an|ans\n\nint $length 1..255\n\nboolean $truncate allow returning truncated result if the transcoded $input length is over $length\n#### Example\n```php\n    \\Payzen::ascii_transcode('123nd', 'n', 5, true);\n```\n\n### check signature in response\nChecking Payzen response signature\n#### Example\n```php\n    \\Payzen::isResponseSignatureValid();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoweh%2Flaravel-payzen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoweh%2Flaravel-payzen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoweh%2Flaravel-payzen/lists"}