Get invoice_id from payment has

This commit is contained in:
Benjamin Beganović 2021-02-15 11:45:14 +01:00
parent 1feba49670
commit 2a5cd72d0b

View File

@ -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']);