在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):barryvdh/laravel-omnipay开源软件地址(OpenSource Url):https://github.com/barryvdh/laravel-omnipay开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Omnipay for LaravelThis is a package to integrate Omnipay with Laravel. You can use it to easily manage your configuration, and use the Facade to provide shortcuts to your gateway. InstallationRequire this package with composer.
Pre Laravel 5.5: After updating composer, add the ServiceProvider to the providers array in config/app.php 'Barryvdh\Omnipay\ServiceProvider', You need to publish the config for this package. A sample configuration is provided. The defaults will be merged with gateway specific configuration.
To use the Facade ( 'Omnipay' => 'Barryvdh\Omnipay\Facade', When calling the Omnipay facade/instance, it will create the default gateway, based on the configuration.
You can change the default gateway by calling Examples$params = [
'amount' => $order->amount,
'issuer' => $issuerId,
'description' => $order->description,
'returnUrl' => URL::action('PurchaseController@return', [$order->id]),
];
$response = Omnipay::purchase($params)->send();
if ($response->isSuccessful()) {
// payment was successful: update database
print_r($response);
} elseif ($response->isRedirect()) {
// redirect to offsite payment gateway
return $response->getRedirectResponse();
} else {
// payment failed: display message to customer
echo $response->getMessage();
} Besides the gateway calls, there is also a shortcut for the creditcard: $formInputData = [
'firstName' => 'Bobby',
'lastName' => 'Tables',
'number' => '4111111111111111',
];
$card = Omnipay::CreditCard($formInputData); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论