mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:07:32 -05:00 
			
		
		
		
	Merge branch 'develop' of github.com:hillelcoren/invoice-ninja into develop
This commit is contained in:
		
						commit
						269aaa73bf
					
				@ -87,6 +87,7 @@ class AccountGatewayController extends BaseController
 | 
				
			|||||||
                                    ->where('id', '!=', GATEWAY_GOCARDLESS)
 | 
					                                    ->where('id', '!=', GATEWAY_GOCARDLESS)
 | 
				
			||||||
                                    ->where('id', '!=', GATEWAY_DWOLLA)
 | 
					                                    ->where('id', '!=', GATEWAY_DWOLLA)
 | 
				
			||||||
                                    ->where('id', '!=', GATEWAY_STRIPE)
 | 
					                                    ->where('id', '!=', GATEWAY_STRIPE)
 | 
				
			||||||
 | 
					                                    ->where('id', '!=', GATEWAY_WEPAY)
 | 
				
			||||||
                                    ->orderBy('name')->get();
 | 
					                                    ->orderBy('name')->get();
 | 
				
			||||||
        $data['hiddenFields'] = Gateway::$hiddenFields;
 | 
					        $data['hiddenFields'] = Gateway::$hiddenFields;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -400,7 +400,7 @@ class PaymentController extends BaseController
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static function processPaymentClientDetails($client, $accountGateway, $paymentType, $onSite = true){
 | 
					    public static function processPaymentClientDetails($client, $accountGateway, $paymentType, $onSite = true){
 | 
				
			||||||
        $rules = [
 | 
					        $rules = $paymentType == PAYMENT_TYPE_STRIPE_ACH ? [] : [
 | 
				
			||||||
            'first_name' => 'required',
 | 
					            'first_name' => 'required',
 | 
				
			||||||
            'last_name' => 'required',
 | 
					            'last_name' => 'required',
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
@ -433,9 +433,7 @@ class PaymentController extends BaseController
 | 
				
			|||||||
            $validator = Validator::make(Input::all(), $rules);
 | 
					            $validator = Validator::make(Input::all(), $rules);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ($validator->fails()) {
 | 
					            if ($validator->fails()) {
 | 
				
			||||||
                return Redirect::to('payment/'.$invitationKey)
 | 
					                return false;
 | 
				
			||||||
                    ->withErrors($validator)
 | 
					 | 
				
			||||||
                    ->withInput(Request::except('cvv'));
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ($requireAddress && $accountGateway->update_address) {
 | 
					            if ($requireAddress && $accountGateway->update_address) {
 | 
				
			||||||
@ -475,9 +473,10 @@ class PaymentController extends BaseController
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $result = static::processPaymentClientDetails($client,  $accountGateway, $paymentType,  $onSite);
 | 
					        if (!static::processPaymentClientDetails($client,  $accountGateway, $paymentType,  $onSite)) {
 | 
				
			||||||
        if ($result !== true) {
 | 
					            return Redirect::to('payment/'.$invitationKey)
 | 
				
			||||||
            return $result;
 | 
					                ->withErrors($validator)
 | 
				
			||||||
 | 
					                ->withInput(Request::except('cvv'));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
				
			|||||||
@ -884,9 +884,8 @@ class PublicClientController extends BaseController
 | 
				
			|||||||
        $accountGateway = $account->getGatewayByType($paymentType);
 | 
					        $accountGateway = $account->getGatewayByType($paymentType);
 | 
				
			||||||
        $sourceToken = $accountGateway->gateway_id == GATEWAY_STRIPE ? Input::get('stripeToken'):Input::get('payment_method_nonce');
 | 
					        $sourceToken = $accountGateway->gateway_id == GATEWAY_STRIPE ? Input::get('stripeToken'):Input::get('payment_method_nonce');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $result = PaymentController::processPaymentClientDetails($client,  $accountGateway, $paymentType);
 | 
					        if (!PaymentController::processPaymentClientDetails($client,  $accountGateway, $paymentType)) {
 | 
				
			||||||
        if ($result !== true) {
 | 
					            return Redirect::to('client/paymentmethods/add/' . $typeLink)->withInput(Request::except('cvv'));
 | 
				
			||||||
            return $result;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($sourceToken) {
 | 
					        if ($sourceToken) {
 | 
				
			||||||
 | 
				
			|||||||
@ -191,7 +191,8 @@ class PaymentService extends BaseService
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $data = $response->getData();
 | 
					            $data = $response->getData();
 | 
				
			||||||
            $sources = isset($data['sources']) ? $data['sources']['data'] : $data['cards']['data'];
 | 
					            $sources_list = isset($data['sources']) ? $data['sources'] : $data['cards'];
 | 
				
			||||||
 | 
					            $sources = isset($sources_list['data'])?$sources_list['data']:$sources_list;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Load
 | 
					            // Load
 | 
				
			||||||
            $accountGatewayToken->payment_methods();
 | 
					            $accountGatewayToken->payment_methods();
 | 
				
			||||||
@ -461,6 +462,9 @@ class PaymentService extends BaseService
 | 
				
			|||||||
            $data = $gatewayResponse->getData();
 | 
					            $data = $gatewayResponse->getData();
 | 
				
			||||||
            if (!empty($data['object']) && ($data['object'] == 'card' || $data['object'] == 'bank_account')) {
 | 
					            if (!empty($data['object']) && ($data['object'] == 'card' || $data['object'] == 'bank_account')) {
 | 
				
			||||||
                $source = $data;
 | 
					                $source = $data;
 | 
				
			||||||
 | 
					            } elseif (!empty($data['object']) && $data['object'] == 'customer') {
 | 
				
			||||||
 | 
					                $sources = !empty($data['sources']) ? $data['sources'] : $data['cards'];
 | 
				
			||||||
 | 
					                $source = reset($sources);
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                $source = !empty($data['source']) ? $data['source'] : $data['card'];
 | 
					                $source = !empty($data['source']) ? $data['source'] : $data['card'];
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
@ -84,7 +84,7 @@ class PaymentsChanges extends Migration
 | 
				
			|||||||
            $table->unsignedInteger('default_payment_method_id')->nullable();
 | 
					            $table->unsignedInteger('default_payment_method_id')->nullable();
 | 
				
			||||||
            $table->foreign('default_payment_method_id')->references('id')->on('payment_methods');
 | 
					            $table->foreign('default_payment_method_id')->references('id')->on('payment_methods');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $table->boolean('uses_local_payment_methods')->defalut(true);
 | 
					            $table->boolean('uses_local_payment_methods')->default(true);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        \DB::table('account_gateway_tokens')->update(array('uses_local_payment_methods' => false));
 | 
					        \DB::table('account_gateway_tokens')->update(array('uses_local_payment_methods' => false));
 | 
				
			||||||
 | 
				
			|||||||
@ -59,8 +59,8 @@
 | 
				
			|||||||
    <span class="payment_method_number">•••••{{$paymentMethod->last4}}</span>
 | 
					    <span class="payment_method_number">•••••{{$paymentMethod->last4}}</span>
 | 
				
			||||||
    @endif
 | 
					    @endif
 | 
				
			||||||
    @if($paymentMethod->payment_type_id == PAYMENT_TYPE_ACH)
 | 
					    @if($paymentMethod->payment_type_id == PAYMENT_TYPE_ACH)
 | 
				
			||||||
        @if($paymentMethod->bank())
 | 
					        @if($paymentMethod->bank_data)
 | 
				
			||||||
            {{ $paymentMethod->bank()->name }}
 | 
					            {{ $paymentMethod->bank_data }}
 | 
				
			||||||
        @endif
 | 
					        @endif
 | 
				
			||||||
        @if($paymentMethod->status == PAYMENT_METHOD_STATUS_NEW)
 | 
					        @if($paymentMethod->status == PAYMENT_METHOD_STATUS_NEW)
 | 
				
			||||||
        <a href="javasript::void" onclick="completeVerification('{{$paymentMethod->public_id}}','{{$paymentMethod->currency->symbol}}')">({{trans('texts.complete_verification')}})</a>
 | 
					        <a href="javasript::void" onclick="completeVerification('{{$paymentMethod->public_id}}','{{$paymentMethod->currency->symbol}}')">({{trans('texts.complete_verification')}})</a>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user