Extracted from #2828525: Implement manual payment gateways.
PaymentMethod has the following base field definition:
$fields['expires'] = BaseFieldDefinition::create('timestamp')
->setLabel(t('Expires'))
->setDescription(t('The time when the payment method expires. 0 for never.'))
But PaymentMethodStorage::loadReusable() always does:
->condition('expires', $this->time->getRequestTime(), '>')
making it impossible to load non-expiring payment methods.
commerce-payment-method.html.twig also assumes that the expires timestamp is never empty.
Comments
Comment #2
bojanz commentedHere are the changes that @vasike made in the original issue:
Comment #3
bojanz commentedHere's a rerolled patch, let's see what the existing tests say.
We need to add test coverage, for sure.
Comment #5
bojanz commentedAdding facine, who started attacking this problem in another issue.
Comment #7
bojanz commentedComment #9
bojanz commentedTweaked the patch so that we don't show the "Expires" line for non-expiring methods, looks more natural than "Expires Never". Expanded the kernel tests.