cannonb4ll/larapay

该包已被废弃,不再维护。没有建议的替代包。

Laravel 5 pay.nl 提供商

1.1 2017-06-24 07:00 UTC

This package is auto-updated.

Last update: 2020-03-03 13:07:38 UTC


README

此类使将支付提供程序 Pay.nl 集成到您的网站中更加容易。

要求

  • Laravel 5.x
  • Pay.nl 账户

安装

通过以下命令安装此包:

composer require cannonb4ll/larapay

安装后,在 config/app.php 中注册服务提供者

LaraPay\ServiceProvider::class,

现在您可以使用以下命令发布配置文件:

php artisan vendor:publish --provider="LaraPay\ServiceProvider"

之后,您需要在您的 .env 文件中设置 2 个变量

PAY_TOKEN=
PAY_SERVICE_ID=

您可以从 https://admin.pay.nl 获取这些凭证

可用方法

$larapay = new LaraPay;

$larapay->methods(); // Returns list of payment methods

$larapay->banks(); // Returns list of banks (iDEAL)

// Starts a transaction, you can apply more data here according to the pay's API documentation.
$larapay->startTransaction([
   'amount' => $total,		
   'returnUrl' => 'http://www.example.com/thanks',		
	
   'exchangeUrl' => 'http://www.example.com/webhook',		
   'paymentMethod' => 138,
   'description' => 'ORder',		
   'testmode' => 1
]);

$larapay->getTransaction($id); // Returns a transaction