diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 847e7fc0f0..59f79661c2 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -115,6 +115,17 @@ class PaymentController extends BaseController return View::make('payments.edit', $data); } + /** + * @param $publicId + * @return \Illuminate\Http\RedirectResponse + */ + public function show($publicId) + { + Session::reflash(); + + return redirect()->to("payments/{$publicId}/edit"); + } + /** * @param PaymentRequest $request * @return \Illuminate\Contracts\View\View diff --git a/app/Ninja/PaymentDrivers/StripePaymentDriver.php b/app/Ninja/PaymentDrivers/StripePaymentDriver.php index c9020fb796..d2da7bab42 100644 --- a/app/Ninja/PaymentDrivers/StripePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/StripePaymentDriver.php @@ -153,7 +153,9 @@ class StripePaymentDriver extends BasePaymentDriver $paymentMethod->source_reference = $source['id']; $paymentMethod->last4 = $source['last4']; - if ($this->isGatewayType(GATEWAY_TYPE_CREDIT_CARD)) { + // For older users the Stripe account may just have the customer token but not the card version + // In that case we'd use GATEWAY_TYPE_TOKEN even though we're creating the credit card + if ($this->isGatewayType(GATEWAY_TYPE_CREDIT_CARD) || $this->isGatewayType(GATEWAY_TYPE_TOKEN)) { $paymentMethod->expiration = $source['exp_year'] . '-' . $source['exp_month'] . '-01'; $paymentMethod->payment_type_id = $this->parseCardType($source['brand']);