zloter / przelewy24-php
Przelewy24 PHP库
0.0.1
2020-09-02 00:12 UTC
Requires
- php: >=7.1.3
- ext-json: *
- guzzlehttp/guzzle: ^6.4
Requires (Dev)
- phpunit/phpunit: ^8.0
This package is not auto-updated.
Last update: 2024-09-26 18:22:21 UTC
README
为www.przelewy24.pl提供的PHP封装。
使用方法
创建实例
use Przelewy24\Przelewy24; $przelewy24 = new Przelewy24([ 'merchant_id' => '12345', 'crc' => 'aef0...', 'mode' => 'sandbox', // live for production ]);
创建交易
$transaction = $przelewy24->transaction([ 'session_id' => 'unique order identifier from your application', 'url_return' => 'url to return to post transaction', 'url_status' => 'url to which the transaction status webhook will be sent', 'amount' => 'transaction amount as an integer (1.25 PLN = 125)', 'description' => 'transaction description', 'email' => 'buyer email address', ]);
检索交易的令牌
$transaction->token();
检索跳转到支付网关的URL
$transaction->redirectUrl();
监听交易状态webhook
$webhook = $przelewy24->handleWebhook();
验证交易
$przelewy24->verify([ 'session_id' => 'unique order identifier from your application', 'order_id' => $webhook->orderId(), // przelewy24 order id 'amount' => 'transaction amount as an integer (1.25 PLN = 125)', ]);