付款成功后,我想将用户重定向到付款成功页面,但是到目前为止,它还没有重定向。这是我的代码:
使用Srmklive\PayPal
Srmklive\PayPal\Providers\PayPalServiceProvider::class
paypal.php
<?php
return [
'mode' => env('PAYPAL_MODE', 'sandbox')
'sandbox' => [
'username' => env('PAYPAL_SANDBOX_API_USERNAME', ''),
'password' => env('PAYPAL_SANDBOX_API_PASSWORD', ''),
'secret' => env('PAYPAL_SANDBOX_API_SECRET', ''),
'certificate' => env('PAYPAL_SANDBOX_API_CERTIFICATE', ''),
'app_id' => 'APP-80W284485P519543T',
],
'payment_action' => 'Sale',
'currency' => env('PAYPAL_CURRENCY', 'USD'),
'billing_type' => 'MerchantInitiatedBilling',
'notify_url' => '',
'locale' => '',
'validate_ssl' => false,
];
以付款方式
$data = [];
$data['items'] = [
[
'name' => 'name ',
'price' => 100,
'desc' => 'Description for ItSolutionStuff.com',
'qty' => 1
]
];
$data['invoice_id'] = 1;
$data['invoice_description'] = "Order #{$data['invoice_id']} Invoice";
$data['return_url'] = route('payment.success');
$data['cancel_url'] = route('payment.cancel');
$data['total'] = 100;
$provider = new ExpressCheckout;
$response = $provider->setExpressCheckout($data);
$response = $provider->setExpressCheckout($data, true);
return redirect($response['paypal_link']);
它没有响应return_url
或cancel_url
我在这里想念什么? 请帮忙!