Skip to content

Commit

Permalink
Add reset() function to PaymentService
Browse files Browse the repository at this point in the history
  • Loading branch information
r-kujawa committed Aug 14, 2023
1 parent 202c6f8 commit 44c6a86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Facades/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* @method static \Payavel\Checkout\PaymentGateway merchant($merchant)
* @method static \Payavel\Checkout\Contracts\Merchantable getMerchant()
* @method static void setMerchant($merchant, $strict = true)
* @method static void reset()
* @method static string|int|\Payavel\Checkout\Contracts\Merchantable getDefaultMerchant()
* @method static \Payavel\Checkout\PaymentResponse getWallet(\Payavel\Checkout\Models\Wallet $wallet)
* @method static \Payavel\Checkout\PaymentResponse getPaymentMethod(\Payavel\Checkout\Models\PaymentMethod $paymentMethod)
Expand Down
12 changes: 12 additions & 0 deletions src/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,16 @@ protected function setGateway()

$this->gateway = new $gateway($provider, $merchant);
}

/**
* Reset the payment service to it's defaults.
*
* @return void
*/
public function reset()
{
$this->provider = null;
$this->merchant = null;
$this->gateway = null;
}
}

0 comments on commit 44c6a86

Please sign in to comment.