After successful payment I want to redirect users to payment success page but It is not redirecting as of now. Here's my code:
paypal integration using 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,
];
in payment method
$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']);
it is not responding to return_url
or cancel_url
What am I missing here? Please Help!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire