Recurring donations
Let donors say how often they would like to give. Pro records the choice on the order and announces it when the order is paid, so a subscription or payment integration can charge again.
siteryn_donations_pro_recurring_donation_paid (see Connecting a subscription or gateway).- Frequency Choice: Offer recurring donations (off), Frequencies (Monthly) and Question
Settings
Shows the frequency choice. It records the donor's choice on the order and fires siteryn_donations_pro_recurring_donation_paid when the order is paid.
Any of Weekly, Monthly and Yearly. With none chosen, the choice isn't shown.
The heading of the choice.
What donors see
"How often would you like to give?" with One time (pre-selected) and your frequencies, in the donation box above its button and on donation product pages above the add to cart button. The choice appears as Frequency: Monthly under the donation in the cart, at checkout, on the order and in order emails, and in the CSV export.
- The cart donation box with "How often would you like to give?": One time (selected), Monthly and Yearly
- Monthly and Yearly were turned on for this screenshot
Connecting a subscription or gateway
When an order with a recurring donation is paid for the first time, Pro fires this action once per donation line:
add_action( 'siteryn_donations_pro_recurring_donation_paid', function ( $item, $interval, $amount, $order ) {
// $interval is 'week', 'month' or 'year'; $amount is the paid donation.
// Create the subscription or schedule the next charge in your integration here.
}, 10, 4 );
The interval is also stored on the order line as _siteryn_donations_recurring. See the Hooks reference.