mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:29:03 -05:00 
			
		
		
		
	fixes for eWay
This commit is contained in:
		
							parent
							
								
									e7f2582986
								
							
						
					
					
						commit
						62b1591a9f
					
				@ -146,9 +146,22 @@ class CreditCard
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $invoice_numbers = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if($this->eway_driver->payment_hash->data)
 | 
				
			||||||
 | 
					            $invoice_numbers =  collect($this->eway_driver->payment_hash->data->invoices)->pluck('invoice_number')->implode(',');
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        $amount = array_sum(array_column($this->eway_driver->payment_hash->invoices(), 'amount')) + $this->eway_driver->payment_hash->fee_total;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $description = "Invoices: {$invoice_numbers} for {$amount} for client {$this->eway_driver->client->present()->name()}";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $transaction = [
 | 
					        $transaction = [
 | 
				
			||||||
            'Payment' => [
 | 
					            'Payment' => [
 | 
				
			||||||
                'TotalAmount' => $this->convertAmountForEway(),
 | 
					                'TotalAmount' => $this->convertAmountForEway(),
 | 
				
			||||||
 | 
					                'CurrencyCode' => $this->eway_driver->client->currency()->code,
 | 
				
			||||||
 | 
					                'InvoiceNumber' => $invoice_numbers,
 | 
				
			||||||
 | 
					                'Description' => $description,
 | 
				
			||||||
 | 
					                'InvoiceReference' => $description,
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
 | 
					            'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
 | 
				
			||||||
            'SecuredCardData' => $request->input('securefieldcode'),
 | 
					            'SecuredCardData' => $request->input('securefieldcode'),
 | 
				
			||||||
@ -225,12 +238,22 @@ class CreditCard
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        $amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
 | 
					        $amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if($this->eway_driver->payment_hash->data)
 | 
				
			||||||
 | 
					            $invoice_numbers =  collect($this->eway_driver->payment_hash->data->invoices)->pluck('invoice_number')->implode(',');
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        $description = "Invoices: {$invoice_numbers} for {$amount} for client {$this->eway_driver->client->present()->name()}";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $transaction = [
 | 
					        $transaction = [
 | 
				
			||||||
            'Customer' => [
 | 
					            'Customer' => [
 | 
				
			||||||
                'TokenCustomerID' => $token,
 | 
					                'TokenCustomerID' => $token,
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            'Payment' => [
 | 
					            'Payment' => [
 | 
				
			||||||
                'TotalAmount' => $this->convertAmountForEway($amount),
 | 
					                'TotalAmount' => $this->convertAmountForEway($amount),
 | 
				
			||||||
 | 
					                'CurrencyCode' => $this->eway_driver->client->currency()->code,
 | 
				
			||||||
 | 
					                'InvoiceNumber' => $invoice_numbers,
 | 
				
			||||||
 | 
					                'Description' => $description,
 | 
				
			||||||
 | 
					                'InvoiceReference' => $description,
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            'TransactionType' => \Eway\Rapid\Enum\TransactionType::RECURRING,
 | 
					            'TransactionType' => \Eway\Rapid\Enum\TransactionType::RECURRING,
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user