Skip to content
Snippets Groups Projects
Commit ec8fa305 authored by Vadym Abramchuk's avatar Vadym Abramchuk
Browse files

Issue #3270758 by abramm: Only pre-save payment entity if 3D Secure is enabled

parent 19a0f6c8
Branches
Tags
1 merge request!6Issue #3270758: 3D Secure support
......@@ -171,12 +171,6 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface {
$payment_method = $payment->getPaymentMethod();
$this->assertPaymentMethod($payment_method);
if ($payment->isNew()) {
// Save the payment entity to get its ID in case if it's not available
// yet.
$payment->save();
}
$transaction_data = [
'currency' => $payment->getAmount()->getCurrencyCode(),
'amount' => $this->util->formatNumber($payment->getAmount()),
......@@ -198,12 +192,19 @@ class Omise extends OnsitePaymentGatewayBase implements OmiseInterface {
}
if (!empty($this->configuration['3d_secure'])) {
if ($payment->isNew()) {
// Save the payment entity to get its ID in case if it's not available
// yet.
$payment->save();
}
$transaction_data['return_uri'] = Url::fromRoute('commerce_payment.checkout.return', [
'commerce_order' => $payment->getOrderId(),
'step' => 'payment',
], [
'absolute' => TRUE,
'query' => [
// @see onReturn()
'payment_id' => $payment->id(),
],
])->toString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment