Exemplo n.º 1
0
 /**
  * @param EloquentDriverRepository $driver
  *
  * @return bool|mixed
  */
 public function buySticker(EloquentDriverRepository $driver)
 {
     $transaction = $this->getFuturePaymentTransaction($driver->getStickerPrice(), $driver->currency, "Sticker Payment");
     $payment = $this->createPayment(null, $transaction, $driver);
     // Capture the payment
     if ($capturedPayment = $this->capturePayment(null, $payment, $driver)) {
         // Todo:: record capture purchase sticker payment success.
         return $capturedPayment;
     } else {
         // Todo:: record capture purchase sticker payment failed.
         return false;
     }
 }