Use a non-USD currency for buy-ups in a specific market
Buy-ups are priced in US dollars by default. benecaster_buyup_currency lets a podcaster selling into one market charge in that market’s currency instead.
Set it before the buy-up’s first sale, or not at all. The price is created at Stripe once and then reused for everybody who buys it. Changing the currency afterwards applies only to prices created from then on — every existing subscriber carries on being billed in the currency their price was created in, and nothing in the interface will tell you that you now have subscribers paying in two different currencies for the same thing. There is no migration for this. Decide the currency when you create the buy-up.
Code
<?php
add_filter( 'benecaster_buyup_currency', function ( string $default, int $buyup_id ): string {
// Use GBP for buy-ups whose token type starts with "uk_".
$repo = new \Benecaster\Membership\BuyupRepository();
$buyup = $repo->find( $buyup_id );
if ( $buyup && str_starts_with( (string) $buyup['token_type'], 'uk_' ) ) {
return 'gbp';
}
return $default;
}, 10, 2 );
Hooks Used
Need this built rather than just documented? See our services →