Skip to content
Snippets Groups Projects
Commit dcbb0f50 authored by Jonathan Sacksick's avatar Jonathan Sacksick Committed by Jonathan Sacksick
Browse files

Issue #3273582 by jsacksick, OwilliwO: Void pending manual payment.

parent f8abc7db
No related branches found
No related tags found
7 merge requests!418Issue #3511232 by ccjjmartin: Fix add to cart dropdown when only one non-default variation type is provided,!379Issue #3491248 Validation is breaking the amount number format decimal point,!375Issue #3413020 by czigor: Using a translatable string as a category for field...,!357Issue #2914933: Add service tags to order-related interfaces,!344Resolve #3107602 "Product attributes do not update visually when switching variations",!343Resolve #3107602 "Product attributes do not update visually when switching variations",!342Issue #3476581 by josephr5000: add OrderItemLabelEvent
......@@ -157,30 +157,36 @@ class Manual extends PaymentGatewayBase implements ManualPaymentGatewayInterface
* {@inheritdoc}
*/
public function buildPaymentOperations(PaymentInterface $payment) {
$payment_state = $payment->getState()->getId();
$operations = [];
$operations['receive'] = [
'title' => $this->t('Receive'),
'page_title' => $this->t('Receive payment'),
'plugin_form' => 'receive-payment',
'access' => $payment_state == 'pending',
'access' => $payment->getState()->getId() === 'pending',
];
$operations['void'] = [
'title' => $this->t('Void'),
'page_title' => $this->t('Void payment'),
'plugin_form' => 'void-payment',
'access' => $payment_state == 'pending',
'access' => $this->canVoidPayment($payment),
];
$operations['refund'] = [
'title' => $this->t('Refund'),
'page_title' => $this->t('Refund payment'),
'plugin_form' => 'refund-payment',
'access' => in_array($payment_state, ['completed', 'partially_refunded']),
'access' => $this->canRefundPayment($payment),
];
return $operations;
}
/**
* {@inheritdoc}
*/
public function canVoidPayment(PaymentInterface $payment) {
return $payment->getState()->getId() === 'pending';
}
/**
* {@inheritdoc}
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment