You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should we only trigger the Gravity Forms create_subscription payment action after the first subscript payment is successfully paid?
Could we implement a $subscription->get_first_payment() to easily retrieve the first subscription payment and to check if the payment in question is the first payment?
$subscription = $payment->get_subscription();
$payment_first = $subscription->get_first_payment();
if ( $payment === $payment_first ) {
// FIRST
}
@rvdsteege I think you know best how we use recurring_type, what are your thoughts on this?
Another point to consider may also be that a RECURRING payment does not require interaction from the customer. In #188 (comment) I also suggested a $payment->is_interactive() function.
The text was updated successfully, but these errors were encountered:
Can we make the
$payment->recurring_type
property more self explaining? We use it now for the following 3 values:\Pronamic\WordPress\Pay\Core\Recurring::FIRST
// Constant for the first payment.\Pronamic\WordPress\Pay\Core\Recurring::RECURRING
// Constant for recurring payments.\Pronamic\WordPress\Pay\Core\Recurring::SUBSCRIPTION
// Constant for subscription payments.https://github.com/pronamic/wp-pay-core/blob/aff3656759b15994d278232bef2e378c1bca4b75/src/Core/Recurring.php#L24-L43
In the Gravity Forms extension we use these to determine which actions should be triggered:
https://github.com/wp-pay-extensions/gravityforms/blob/0d0200864a24424949172346d2d38aa001802e62/src/Extension.php#L613-L653
Should we only trigger the Gravity Forms
create_subscription
payment action after the first subscript payment is successfully paid?Could we implement a
$subscription->get_first_payment()
to easily retrieve the first subscription payment and to check if the payment in question is the first payment?@rvdsteege I think you know best how we use
recurring_type
, what are your thoughts on this?Another point to consider may also be that a
RECURRING
payment does not require interaction from the customer. In #188 (comment) I also suggested a$payment->is_interactive()
function.The text was updated successfully, but these errors were encountered: