1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Working on Paypal

This commit is contained in:
David Bomba 2019-09-26 15:47:37 +10:00
parent bbe5049a2d
commit 49b97038f7

View File

@ -37,6 +37,20 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
];
}
/**
* Processes the payment with this gateway
*
* @var $data['invoices']
* @var $data['amount']
* @var $data['fee']
* @var $data['amount_with_fee']
* @var $data['token']
* @var $data['payment_method_id']
* @var $data['hashed_ids']
*
* @param array $data variables required to build payment page
* @return view Gateway and payment method specific view
*/
public function processPaymentView(array $data)
{
@ -47,14 +61,24 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
}
protected function paymentDetails($paymentMethod = false)
protected function paymentDetails()
{
$data = parent::paymentDetails();
$data['amount'] = $invoice->getRequestedAmount();
$data['returnUrl'] = $completeUrl;
$data['cancelUrl'] = $this->invitation->getLink();
$data['description'] = trans('texts.' . $invoice->getEntityType()) . " {$invoice->invoice_number}";
$data['transactionId'] = $invoice->invoice_number;
$data['ButtonSource'] = 'InvoiceNinja_SP';
$data['solutionType'] = 'Sole'; // show 'Pay with credit card' option
$data['transactionId'] = $data['transactionId'] . '-' . time();
return $data;
}
}
}
'currency' => $this->client->getCurrencyCode(),
'transactionType' => 'Purchase',
'clientIp' => request()->getClientIp(),