1. Home
  2. WP Simple Pay Pro 2.5 & Lite 1.6
  3. Using the Payment Details Filter (Pro 2.5 & Lite 1.6)

Using the Payment Details Filter (Pro 2.5 & Lite 1.6)

In order to change the output of your payment details in WP Simple Pay Pro 2.5 & Lite 1.6, you’ll need to add a custom PHP function. See Adding Custom Functions to WP Simple Pay.

Note that WP Simple Pay Pro 3 provides a no-code solution for this. See Configuring the Payment Confirmation Display.

You can use the sc_payment_details filter hook to change the output of your payment details. To see all of the available options that are returned by the charge object you can visit the Stripe API page at https://stripe.com/docs/api/php#charge_object.

Please see our code snippets which include displaying the last 4 digits and expiration date of the card number and/or the billing address.

Note: If using sc_payment_details with Subscriptions, increase the priority number in add_filter() to override the default subscriptions payment details output. Example:

add_filter( 'sc_payment_details', 'sc_payment_details_example', 20, 2 );

Updated on November 19, 2018

Was this article helpful?

Related Articles