mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 00:07:35 -05:00 
			
		
		
		
	Merge pull request #4213 from beganovich/v5-checkout-token-billing
(v5) Checkout.com payments using token
This commit is contained in:
		
						commit
						d555796418
					
				@ -309,11 +309,11 @@ class BaseDriver extends AbstractPaymentDriver
 | 
				
			|||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        SystemLogger::dispatch(
 | 
					        SystemLogger::dispatch(
 | 
				
			||||||
            $this->checkout->payment_hash,
 | 
					            $gateway->payment_hash,
 | 
				
			||||||
            SystemLog::CATEGORY_GATEWAY_RESPONSE,
 | 
					            SystemLog::CATEGORY_GATEWAY_RESPONSE,
 | 
				
			||||||
            SystemLog::EVENT_GATEWAY_ERROR,
 | 
					            SystemLog::EVENT_GATEWAY_ERROR,
 | 
				
			||||||
            $gateway::SYSTEM_LOG_TYPE,
 | 
					            $gateway::SYSTEM_LOG_TYPE,
 | 
				
			||||||
            $this->checkout->client,
 | 
					            $gateway->client,
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        throw new PaymentFailed($error, $e->getCode());
 | 
					        throw new PaymentFailed($error, $e->getCode());
 | 
				
			||||||
 | 
				
			|||||||
@ -146,7 +146,7 @@ class CreditCard
 | 
				
			|||||||
        } catch (\Checkout\Library\Exceptions\CheckoutHttpException $e) {
 | 
					        } catch (\Checkout\Library\Exceptions\CheckoutHttpException $e) {
 | 
				
			||||||
            $this->checkout->unWindGatewayFees($this->checkout->payment_hash);
 | 
					            $this->checkout->unWindGatewayFees($this->checkout->payment_hash);
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            return $this->processInternallyFailedPayment($e);
 | 
					            return $this->checkout->processInternallyFailedPayment($this->checkout, $e);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -134,11 +134,11 @@ trait Utilities
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            $data = [
 | 
					            $data = [
 | 
				
			||||||
                'payment_meta' => $payment_meta,
 | 
					                'payment_meta' => $payment_meta,
 | 
				
			||||||
                'token' => $response->id,
 | 
					                'token' => $response->source['id'],
 | 
				
			||||||
                'payment_method_id' => $this->checkout->payment_hash->data->payment_method_id,
 | 
					                'payment_method_id' => $this->checkout->payment_hash->data->payment_method_id,
 | 
				
			||||||
            ];
 | 
					            ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return $this->checokut->saveCard($data);
 | 
					            return $this->checkout->storePaymentMethod($data);
 | 
				
			||||||
        } catch (\Exception $e) {
 | 
					        } catch (\Exception $e) {
 | 
				
			||||||
            session()->flash('message', ctrans('texts.payment_method_saving_failed'));
 | 
					            session()->flash('message', ctrans('texts.payment_method_saving_failed'));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -24,7 +24,7 @@
 | 
				
			|||||||
        <input type="hidden" name="raw_value" value="{{ $raw_value }}">
 | 
					        <input type="hidden" name="raw_value" value="{{ $raw_value }}">
 | 
				
			||||||
        <input type="hidden" name="currency" value="{{ $currency }}">
 | 
					        <input type="hidden" name="currency" value="{{ $currency }}">
 | 
				
			||||||
        @isset($token)
 | 
					        @isset($token)
 | 
				
			||||||
            <input type="hidden" name="token" value="{{ $token->meta->id }}">
 | 
					            <input type="hidden" name="token" value="{{ $token->token }}">
 | 
				
			||||||
        @endisset
 | 
					        @endisset
 | 
				
			||||||
    </form>
 | 
					    </form>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user