: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$args = wp_parse_args( $args, $defaults );
return Mandate::retrieve( $args, $auth_opts ?? Helpers::get_auth_opts() );
} catch ( Exception $e ) {
'Stripe: Unable to get Mandate.',
'type' => [ 'payment', 'error' ],
* Create Stripe Setup Intent.
* @param array $intent_data Intent data.
* @param array $args Additional arguments.
* @throws ApiErrorException If the request fails.
* @return SetupIntent|null
public function create_setup_intent( array $intent_data, array $args ) {
if ( isset( $args['mode'] ) ) {
$auth_opts = [ 'api_key' => Helpers::get_stripe_key( 'secret', $args['mode'] ) ];
return SetupIntent::create( $intent_data, $auth_opts ?? Helpers::get_auth_opts() );
} catch ( Exception $e ) {
'Stripe: Unable to create Setup Intent.',
'type' => [ 'payment', 'error' ],