mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 08:17:32 -05:00 
			
		
		
		
	Merge pull request #853 from joshuadwire/payments-changes
Payments bug fixes
This commit is contained in:
		
						commit
						0f47cbef51
					
				@ -558,14 +558,8 @@ class PaymentService extends BaseService
 | 
			
		||||
        
 | 
			
		||||
        if (!empty($paymentDetails['card'])) {
 | 
			
		||||
            $card = $paymentDetails['card'];
 | 
			
		||||
            $payment->last4 = substr($card->number, -4);
 | 
			
		||||
            $year = $card->expiryYear;
 | 
			
		||||
            if (strlen($year) == 2) {
 | 
			
		||||
                $year = '20' . $year;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $payment->expiration = $year . '-' . $card->expiryMonth . '-00';
 | 
			
		||||
            $payment->payment_type_id = $this->detectCardType($card->number);
 | 
			
		||||
            $payment->last4 = $card->getNumberLastFour();
 | 
			
		||||
            $payment->payment_type_id = $this->detectCardType($card->getNumber());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($accountGateway->gateway_id == GATEWAY_STRIPE) {
 | 
			
		||||
@ -863,7 +857,7 @@ class PaymentService extends BaseService
 | 
			
		||||
                function ($model) {
 | 
			
		||||
                    $max_refund = number_format($model->amount - $model->refunded, 2);
 | 
			
		||||
                    $formatted = Utils::formatMoney($max_refund, $model->currency_id, $model->country_id);
 | 
			
		||||
                    $symbol = Utils::getFromCache($model->currency_id, 'currencies')->symbol;
 | 
			
		||||
                    $symbol = Utils::getFromCache($model->currency_id ? $model->currency_id : 1, 'currencies')->symbol ;
 | 
			
		||||
                    return "javascript:showRefundModal({$model->public_id}, '{$max_refund}', '{$formatted}', '{$symbol}')";
 | 
			
		||||
                },
 | 
			
		||||
                function ($model) {
 | 
			
		||||
 | 
			
		||||
@ -488,6 +488,7 @@
 | 
			
		||||
                        <input type="hidden" name="payment_method_nonce" value="{{$sourceId}}">
 | 
			
		||||
                        <input type="hidden" name="first_name" value="{{$paypalDetails->firstName}}">
 | 
			
		||||
                        <input type="hidden" name="last_name" value="{{$paypalDetails->lastName}}">
 | 
			
		||||
                        <input type="hidden" name="email" value="{{$paypalDetails->email}}">
 | 
			
		||||
                        <p> </p>
 | 
			
		||||
                        @if (isset($amount) && $client && $account->showTokenCheckbox())
 | 
			
		||||
                            <input id="token_billing" type="checkbox" name="token_billing" {{ $account->selectTokenCheckbox() ? 'CHECKED' : '' }} value="1" style="margin-left:0px; vertical-align:top">
 | 
			
		||||
 | 
			
		||||
@ -82,6 +82,7 @@
 | 
			
		||||
@endforeach
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
@if($gateway->gateway_id != GATEWAY_STRIPE || $gateway->getPublishableStripeKey())
 | 
			
		||||
<center>
 | 
			
		||||
    {!! Button::success(strtoupper(trans('texts.add_credit_card')))
 | 
			
		||||
    ->asLinkTo(URL::to('/client/paymentmethods/add/'.($gateway->getPaymentType() == PAYMENT_TYPE_STRIPE ? 'stripe_credit_card' : 'credit_card'))) !!}
 | 
			
		||||
@ -98,6 +99,7 @@
 | 
			
		||||
        <div id="paypal-container"></div>
 | 
			
		||||
    @endif
 | 
			
		||||
</center>
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
<div class="modal fade" id="completeVerificationModal" tabindex="-1" role="dialog" aria-labelledby="completeVerificationModalLabel" aria-hidden="true">
 | 
			
		||||
    <div class="modal-dialog" style="min-width:150px">
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user