Skip to content

Commit

Permalink
Added constants
Browse files Browse the repository at this point in the history
  • Loading branch information
sudiptpa committed May 20, 2018
1 parent 75a9585 commit c469e59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/Http/Controllers/PayPalController.php
Expand Up @@ -72,7 +72,10 @@ public function completed($order_id, Request $request)
]);

if ($response->isSuccessful()) {
$order->update(['transaction_id' => $response->getTransactionReference()]);
$order->update([
'transaction_id' => $response->getTransactionReference(),
'payment_status' => Order::PAYMENT_COMPLETED,
]);

return redirect()->route('order.paypal', encrypt($order_id))->with([
'message' => 'You recent payment is sucessful with reference code ' . $response->getTransactionReference(),
Expand Down
2 changes: 2 additions & 0 deletions app/Order.php
Expand Up @@ -6,6 +6,8 @@

class Order extends Model
{
const PAYMENT_COMPLETED = 1;
const PAYMENT_PENDING = 0;
/**
* @var string
*/
Expand Down

0 comments on commit c469e59

Please sign in to comment.