public function testInitializeOneTimeTransaction()
 {
     $mockTransactionResource = \Mockery::mock($this->transactionResource)->makePartial();
     $mockTransactionResource->shouldReceive('initialize')->once()->andReturn($this->initOneTimeTransactionResourceResponseData);
     $oneTimeTransaction = OneTimeTransaction::make($this->planData['amount'], $this->customerData['email'], '');
     $oneTimeTransaction->setTransactionResource($mockTransactionResource);
     $initOneTimeTransaction = $oneTimeTransaction->initialize();
     $this->assertEquals($this->initOneTimeTransactionResourceResponseData, $initOneTimeTransaction);
 }
 /**
  * Init a one time transaction to get payment page url.
  *
  * @param $amount
  * @param $email
  * @param string $plan
  *
  * @throws \Exception|mixed|Exceptions\PaystackInvalidTransactionException
  *
  * @return \Exception|mixed|Exceptions\PaystackInvalidTransactionException
  */
 public function startOneTimeTransaction($amount, $email, $plan = '')
 {
     $oneTimeTransaction = OneTimeTransaction::make($amount, $email, $plan instanceof Plan ? $plan->get('plan_code') : $plan);
     $oneTimeTransaction->setTransactionResource($this->getTransactionResource());
     $transaction = $oneTimeTransaction->initialize();
     if ($transaction instanceof \Exception) {
         throw $transaction;
     }
     return $transaction;
 }