gform_post_add_subscription_payment

gform_post_add_subscription_payment

DescriptionUsageParametersExamples1. Basic usage2. Cancel a Stripe subscription after # paymentsSource Code

Description
Triggered after a payment is made to an existing subscription.
Usage
add_action( 'gform_post_add_subscription_payment', 'my_function', 10, 2 );

Parameters

$entry Entry Object
The entry object that was created.

$action array
The action that occurred within the subscription payment. Contains further information about the subscription.
$action = array(
'type' => '',
'amount' => '',
'transaction_type' => '',
'transaction_id' => '',
'subscription_id' => '',
'entry_id' => '',
'payment_status' => '',
'note' => '',
);

Examples
1. Basic usage
function my_function() {
//Do something here
}
add_action( 'gform_post_add_subscription_payment', 'my_function', 10, 2 );

2. Cancel a Stripe subscription after # payments
See the Cancel a Stripe Subscription After a Specified Number of Payments article for an example showing how this hook can be used to cancel a Stripe subscription after a set number of payments have occurred.
Source Code
do_action( 'gform_post_add_subscription_payment', $entry, $action );
This action hook is located in GFPaymentAddOn::add_subscription_payment() in includes/addon/class-gf-payment-addon.php.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註