Skip to content

Commit 70a62f2

Browse files
maciejzgadzajbojanz
authored andcommitted
Pass the transaction mode from checkout to the offsite payment form (#595)
1 parent f4fd6e1 commit 70a62f2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentProcess.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public function buildPaneForm(array $pane_form, FormStateInterface $form_state,
168168
'#default_value' => $payment,
169169
'#return_url' => $this->buildReturnUrl($this->order),
170170
'#cancel_url' => $this->buildCancelUrl($this->order),
171+
'#capture' => $this->configuration['capture'],
171172
];
172173

173174
$complete_form['actions']['next']['#value'] = $this->t('Proceed to @gateway', [

modules/payment/src/PluginForm/PaymentOffsiteForm.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
2929
if (empty($form['#cancel_url'])) {
3030
throw new \InvalidArgumentException('The offsite-payment form requires the #cancel_url property.');
3131
}
32+
if (!isset($form['#capture'])) {
33+
$form['#capture'] = TRUE;
34+
}
3235

3336
return $form;
3437
}

0 commit comments

Comments
 (0)