1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00

Fix for upgrading Stripe accounts

This commit is contained in:
Hillel Coren 2016-07-27 12:53:58 +03:00
parent a82739de70
commit bb590830cf
2 changed files with 14 additions and 1 deletions

View File

@ -115,6 +115,17 @@ class PaymentController extends BaseController
return View::make('payments.edit', $data); 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 * @param PaymentRequest $request
* @return \Illuminate\Contracts\View\View * @return \Illuminate\Contracts\View\View

View File

@ -153,7 +153,9 @@ class StripePaymentDriver extends BasePaymentDriver
$paymentMethod->source_reference = $source['id']; $paymentMethod->source_reference = $source['id'];
$paymentMethod->last4 = $source['last4']; $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->expiration = $source['exp_year'] . '-' . $source['exp_month'] . '-01';
$paymentMethod->payment_type_id = $this->parseCardType($source['brand']); $paymentMethod->payment_type_id = $this->parseCardType($source['brand']);