Closed remcotolsma closed 1 year ago
In https://github.com/pronamic/wp-pay-core/compare/39084c8...d8b108b a Subscription->is_manual_renewal_payment( Payment $payment )
method was introduced, is this related to this issue? It's used in https://github.com/wp-pay-gateways/mollie/compare/bcbceab...4a16ba1. Is the payment manually initiated and/or processed manually?
In pronamic/wp-pay-core@39084c8...d8b108b a Subscription->is_manual_renewal_payment( Payment $payment ) method was introduced, is this related to this issue?
In the Mollie integration, I needed a way to not set the sequence type to recurring
(like first payments) if the payment is a manual renewal; initiated via the subscription renewal URL. Instead of checking for the manual_subscription_renewal
meta in the gateway, I thought it might be cleaner/convenient to have a Subscription::is_manual_renewal_payment( $payment )
method, like Subscription::is_first_payment( $payment )
.
If we find an other way to mark a payment as initiated by the user, we could also use that instead. However, manually starting the next period payment for a subscription could also be considered as (admin) user initiated, but should not be considered an interactive payment. So, for example payment.origin.type = 'web'
won't be enough to distinguish between these cases.
For now i have changed this to:
$payment->set_meta( 'mollie_sequence_type', 'first' );
$payment->set_meta( 'mollie_sequence_type', 'recurring' );
As soon as we start supporting subscriptions for more gateways, I think we'll get a better idea of how we can design this.
Also talked about
payment.automatic
just like the Stripe payout object propertypayout.automatic
documented like:https://stripe.com/docs/api/payouts/object#payout_object-automatic
Or we could use something like GitHub actions event name
GITHUB_EVENT_NAME
:github.event
object
We could also extend the payment object with an event property that contains information about what event triggered the payment. I also mentioned the use of
origin
:For just Mollie we maybe even don't need the first payment, if there is no mandate ID we use
sequenceType
first
and otherwiserecurring
.For Gravity Forms there is currently an action that is triggered only for successful follow-up payments.
Originally posted by @remcotolsma in https://github.com/pronamic/wp-pronamic-pay/issues/228#issuecomment-936106294