Merge pull request #77 from anondev-sudo/patch-1
PaymentController improvents
This commit is contained in:
commit
3047f6b458
|
@ -62,6 +62,7 @@ class PaymentController extends Controller
|
||||||
"purchase_units" => [
|
"purchase_units" => [
|
||||||
[
|
[
|
||||||
"reference_id" => uniqid(),
|
"reference_id" => uniqid(),
|
||||||
|
"description" => $paypalProduct->description,
|
||||||
"amount" => [
|
"amount" => [
|
||||||
"value" => $paypalProduct->price,
|
"value" => $paypalProduct->price,
|
||||||
"currency_code" => strtoupper($paypalProduct->currency_code)
|
"currency_code" => strtoupper($paypalProduct->currency_code)
|
||||||
|
@ -72,6 +73,7 @@ class PaymentController extends Controller
|
||||||
"cancel_url" => route('payment.cancel'),
|
"cancel_url" => route('payment.cancel'),
|
||||||
"return_url" => route('payment.success', ['product' => $paypalProduct->id]),
|
"return_url" => route('payment.success', ['product' => $paypalProduct->id]),
|
||||||
'brand_name' => config('app.name', 'Laravel'),
|
'brand_name' => config('app.name', 'Laravel'),
|
||||||
|
'shipping_preference' => 'NO_SHIPPING'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -166,7 +168,7 @@ class PaymentController extends Controller
|
||||||
$user->notify(new ConfirmPaymentNotification($payment));
|
$user->notify(new ConfirmPaymentNotification($payment));
|
||||||
|
|
||||||
//redirect back to home
|
//redirect back to home
|
||||||
return redirect()->route('home')->with('success', 'Credits have been increased!');
|
return redirect()->route('home')->with('success', 'Your credit balance has been increased!');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If call returns body in response, you can get the deserialized version from the result attribute of the response
|
// If call returns body in response, you can get the deserialized version from the result attribute of the response
|
||||||
|
@ -194,7 +196,7 @@ class PaymentController extends Controller
|
||||||
*/
|
*/
|
||||||
public function cancel(Request $request)
|
public function cancel(Request $request)
|
||||||
{
|
{
|
||||||
return redirect()->route('store.index')->with('success', 'Payment Canceled');
|
return redirect()->route('store.index')->with('success', 'Payment was Cannceled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue