benecaster_buyup_prices_provisioned
Fires once a buy-up’s Stripe Prices are in place for one Stripe keyset: every price row on the buy-up has a Price ID for that mode. It fires once per configured keyset, test and live, each time the buy-up is saved while active.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$buyup_id |
int |
— | ID of the buy-up. |
$mode |
string |
— | The Stripe keyset: `'test'` or `'live'`. |
Examples
Sync a buy-up's live Prices to an external catalog
add_action( 'benecaster_buyup_prices_provisioned', function ( int $buyup_id, string $mode ): void {
if ( 'live' !== $mode ) {
return;
}
my_catalogue_sync_prices( $buyup_id );
}, 10, 2 );
Notes
Anything that needs a buy-up's Stripe Price to exist should listen here, not to benecaster_buyup_definition_created or benecaster_buyup_definition_updated. Those fire before the Prices are created, so a callback on them finds no Price ID and does nothing. Benecaster's own listener is the free-buy-up backfill: it is what gives a newly saved $0 price to everyone already on that billing period.
Need this built rather than just documented? See our services →