mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
Merge pull request #4907 from beganovich/v5-1502-pull-invoicee-from-hash
(v5) Custom payment driver: Pull invoices from payment hash
This commit is contained in:
commit
c4e85bc2bd
@ -57,11 +57,14 @@ class CustomPaymentDriver extends BaseDriver
|
||||
*/
|
||||
public function processPaymentView($data)
|
||||
{
|
||||
$invitation = Invoice::findOrFail(
|
||||
$this->decodePrimaryKey($data['invoices']['0']['invoice_id'])
|
||||
)->invitations->first();
|
||||
$variables = [];
|
||||
|
||||
$variables = (new HtmlEngine($invitation))->generateLabelsAndValues();
|
||||
if (count($this->payment_hash->invoices()) > 0) {
|
||||
$invoice_id = $this->decodePrimaryKey($this->payment_hash->invoices()[0]->invoice_id);
|
||||
$invoice = Invoice::findOrFail($invoice_id);
|
||||
|
||||
$variables = (new HtmlEngine($invoice->invitations->first()))->generateLabelsAndValues();
|
||||
}
|
||||
|
||||
$data['title'] = $this->company_gateway->getConfigField('name');
|
||||
$data['instructions'] = strtr($this->company_gateway->getConfigField('text'), $variables['values']);
|
||||
|
Loading…
Reference in New Issue
Block a user