echowine / unicredit
此包已废弃,不再维护。未建议替代包。
最新版本(v1.0.1)的此包没有可用的许可信息。
v1.0.1
2018-07-03 19:03 UTC
Requires
- railken/bag: ^1.0
Requires (Dev)
- donatj/mock-webserver: ^2.0
- duncan3dc/dusk: ^0.8.0
- friendsofphp/php-cs-fixer: ^2.12
- phpstan/phpstan: ^0.10.1
- phpunit/phpunit: ~7.0
This package is not auto-updated.
Last update: 2020-02-21 16:57:02 UTC
README
一个非常非常简单的库,用于通过unicredit进行在线支付。这更像是一个示例而不是一个实际的库。
链接
用户:UNIBO
密码:UniBo2014
原始库可以在Backoffice的以下路径找到
PROFILO ESERCENTE >> 文档和支持 >> API Pack
安装
$ composer require railken/unicredit
基本配置
<?php use Railken\Unicredit\Unicredit; $uc = new Unicredit([ 'terminal_id' => 'UNI_ECOM', 'api_key' => 'UNI_TESTKEY', 'currency' => 'EUR', 'lang' => 'IT', 'base_url' => 'https://testuni.netsw.it', 'verify_url' => 'https:///verify.php', 'error_url' => 'https:///error.php' ]);
结账页面
<?php use Railken\Unicredit\Unicredit; # Make a new instance $uc = new Unicredit(); # Create a random ID for an order $order_id = md5(time()); # Make a payment for 10,00 EUR # Return the Payment ID $response = $uc->payment($order_id, 'email@customer.com', 10); if (!$response->error) { # IMPORTANT !!! # Save $order_id and $transaction_id in DB or Cookie in order to retrieve in the next page # Redirect to the checkout $response->redirect_url; }else{ # Get error $error = $response->error->message; }
验证页面
<?php use Railken\Unicredit\Unicredit; # Retrieve $transaction_id and $order_id from DB/Cookie # Make a new instance $uc = new Unicredit(); $response = $uc->verify($order_id, $transaction_id); if (!$response->error) { # Success } else { # Get error $error = $response->error->message; }