noaber/lunar-paynl
最新稳定版本:v1.0.1
Composer 安装命令:
composer require noaber/lunar-paynl
包简介
Pay.nl payment driver for LunarPHP.
关键字:
README 文档
README
Pay.nl payment driver for LunarPHP v1.x
Installation
Require the composer package
composer require noaber/lunar-paynl
Publish the Pay.nl configuration
Use the below command to publish the configuration file to config/lunar/paynl.php.
php artisan vendor:publish --tag=lunar.paynl.config
Enable the payment driver
Set the driver in config/lunar/payments.php
<?php return [ // ... 'types' => [ 'paynl' => [ 'driver' => 'paynl', ], ], ];
Add your Paynl credentials and other config
Take a look at the configuration in config/paynl.php.
Where appropriate, edit or set the environment variables in your .env file. At least the keys will need to be set.
PAYNL_TEST_MODE=true PAYNL_TOKEN_CODE= PAYNL_TOKEN_CODE_TEST= PAYNL_API_TOKEN= PAYNL_API_TOKEN_TEST= PAYNL_SERVICE_ID= PAYNL_SERVICE_ID_TEST=
You can use the PAYNL_TEST_MODE environment variable to switch between live and test mode.
create named routes for success and cancellation pages
When the user returns form the payment provider webpage, a redirect will be generated, based on the result of the payment. Therefore there have to be four named routed, as defined in the config.
<?php 'payment_paid_route' => 'checkout-success.view', 'payment_canceled_route' => 'checkout-canceled.view', 'payment_open_route' => 'checkout-open.view', 'payment_failed_route' => 'checkout-failure.view',
or create urls using the .env variables (eg: when using a headless CMS and custom urls)
PAYNL_CHECKOUT_SUCCESS="order-confirmed" #will redirect to url.tld/order-confirmed PAYNL_CHECKOUT_CANCELED="your-url-canceled" #will redirect to url.tld/your-url-canceled PAYNL_CHECKOUT_OPEN="your-url-open" #will redirect to url.tld/your-url-open PAYNL_CHECKOUT_FAILURE="your-url-failure" #will redirect to url.tld/your-url-failure
Example
To start a payment:
<?php $payment = \Lunar\Facades\Payments::driver('paynl') ->cart($this->cart) ->withData([ 'description' => 'Description', 'redirectRoute' => config('lunar.paynl.redirect_route'), 'webhookUrl' => config('lunar.paynl.override_webhook_url') ?: route(config('lunar.paynl.webhook_route')), 'method' => $paymentMethod, 'bank' => $bankID, // optional 'extra1' => '', // optional 'extra2' => '', // optional 'extra3' => '', // optional ]) ->initiatePayment(); return redirect($payment->getRedirectUrl());
Thanks to
Thanks to: https://github.com/lobbesnl/lunar-paynl for the initial package for LunarPHP v0.x
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-12