/** * @param StripeFacade $stripe * @param $stripeToken * @param $paymentCountryCode * @param string $paymentType * @return \PatternSeek\ComponentView\Response */ private function getDelayedOrRepeatPaymentTransaction($stripe, $stripeToken, $paymentCountryCode, $paymentType) { $params = ["source" => $stripeToken, "description" => $this->state->email]; $customer = $stripe->customerCreate($params); if ($this->state->email) { $params['receipt_email'] = $this->state->email; } $futureTxn = new DelayedOrRepeatTransaction(); $futureTxn->paymentCountryCode = $paymentCountryCode; $futureTxn->paymentType = $paymentType; $this->parent->populateTransactionDetails($futureTxn); $futureTxn->storedToken = $customer->id; $futureTxn->providerClass = "\\PatternSeek\\ECommerce\\Stripe"; $this->state->complete = true; $ret = $this->parent->delayedTransactionSuccess($futureTxn); return $ret; }