rcp_stripe_create_payment_intent_args

Filters the arguments when creating a Stripe Payment Intent. See the Stripe documentation for accepted arguments.

Parameters:

  • $intent_args (array) - Array of Payment Intent arguments for the API request.
  • $gateway (RCP_Payment_Gateway_Stripe) - Gateway object.

Examples:

Prevents card details from being saved in Stripe for future use.

/**
 * Don't save card details in Stripe for future use.
 * 
 * @param array                      $intent_args
 * @param RCP_Payment_Gateway_Stripe $stripe_gateway
 *
 * @return array
 */
function ag_rcp_prevent_saving_cards( array $intent_args, RCP_Payment_Gateway_Stripe $stripe_gateway ) {
	unset( $intent_args['setup_future_usage'] );

	return $intent_args;
}
add_filter( 'rcp_stripe_create_payment_intent_args', 'ag_rcp_prevent_saving_cards', 10, 2 );
Have more questions? Submit a request
Powered by Zendesk