Skip to content
Snippets Groups Projects
Commit d9215071 authored by Anas Mawlawi's avatar Anas Mawlawi
Browse files

Issue #3448644 by Anas_maw: Automated Drupal 11 compatibility fixes for commerce_paytabs

parent 94f4140e
Branches 1.0.x
No related tags found
No related merge requests found
......@@ -439,29 +439,24 @@ class PaytabsHostedPage extends OffsitePaymentGatewayBase implements PaytabsInte
$order->set('payment_method', $payment_method->id());
$payment->set('payment_method', $payment_method->id());
}
$payment->save();
$this->logger->info('Payment information saved successfully. Transaction reference: ' . $trans_ref);
}
$order->set('state', $this->configuration['complete_order_status']);
$order->save();
$this->logger->info('order status updated successfully.');
}
}
/**
* {@inheritdoc}
*/
public function onCancel(OrderInterface $order, Request $request) {
// @todo this function is not working - no ping is received from PayTabs
$status = $request->get('status');
drupal_set_message($this->t('Payment @status on @gateway but may resume the checkout process here when you are ready.', [
$this->messenger()->addError('Payment @status on @gateway but may resume the checkout process here when you are ready.', [
'@status' => $status,
'@gateway' => $this->getDisplayLabel(),
]), 'error');
], 'error');
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment