mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 08:04:40 -04: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)
|
public function processPaymentView($data)
|
||||||
{
|
{
|
||||||
$invitation = Invoice::findOrFail(
|
$variables = [];
|
||||||
$this->decodePrimaryKey($data['invoices']['0']['invoice_id'])
|
|
||||||
)->invitations->first();
|
|
||||||
|
|
||||||
$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['title'] = $this->company_gateway->getConfigField('name');
|
||||||
$data['instructions'] = strtr($this->company_gateway->getConfigField('text'), $variables['values']);
|
$data['instructions'] = strtr($this->company_gateway->getConfigField('text'), $variables['values']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user