WP Simple Pay: Hide reCAPTCHA Badge

/** * @link https://library.wpcode.com/snippet/ro8w3kow/ */ add_action( ‘simpay_form_before_form_bottom’, function() { ?> This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.Continue reading

WP Simple Pay: Create WordPress User After Payment

/** * @link https://library.wpcode.com/snippet/3234p8or/ * * @param \Stripe\Event $event Stripe Event. * @param \Stripe\Subscription|\Stripe\PaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_custom_create_user( $event, $object ) { $email_address = $object->customer->email; // Don’t create duplicate records. if ( false !== username_exists( $email_address…Continue reading

WP Simple Pay: Create WordPress User After Payment (Lite)

/** * @link https://library.wpcode.com/snippet/32j68l5l/ */ add_action( ‘simpay_payment_receipt_viewed’, /** * @param array $payment_confirmation_data { * Contextual information about this payment confirmation. * * @type \SimplePay\Vendor\Stripe\Customer $customer Stripe Customer * @type \SimplePay\Core\Abstracts\Form $form Payment form. * @type array $subscriptions Subscriptions associated with…Continue reading

WP Simple Pay: Custom Webhook Handling Example

/** * @link https://library.wpcode.com/snippet/qorp835k/ * * Wait until WP Simple Pay is fully loaded. */ add_action( ‘init’, function() { require_once( SIMPLE_PAY_INC . ‘pro/webhooks/class-webhook-base.php’ ); require_once( SIMPLE_PAY_INC . ‘pro/webhooks/class-webhook-interface.php’ ); /** * Adds handling for `coupon.updated` webhook. * * @param array…Continue reading

WP Simple Pay: Per-Form Fixed Tax Rate Percentages

/** * @link https://library.wpcode.com/snippet/924rp65g/ * * @param int $percentage Tax rate percentage. * @param \SimplePay\Pro\Taxes\TaxRate[] $tax_rates Tax Rates */ function simpay_find_tax_rate( $percentage, $tax_rates ) { return array_values( array_filter( $tax_rates, function ( $tax_rate ) use ( $percentage ) { return $tax_rate->percentage…Continue reading

WP Simple Pay: Lower reCAPTCHA Threshold

/** * @link https://library.wpcode.com/snippet/qo9eyj21/ */ add_filter( ‘simpay_recpatcha_minimum_score’, /** * @param string $threshold Threshold. Default 0.5 * @return string */ function( $threshold ) { return ‘0.3’; } );Continue reading

WP Simple Pay: Custom Subscription Price Option Labels

/** * @link https://library.wpcode.com/snippet/e5009459/ */ add_filter( ‘simpay_plan_name_label’, /** * @param string $label Plan label. * @param \Stripe\Plan $plan Stripe Plan. * @return string */ function( $label, $plan ) { return sprintf( ‘%1$s %2$s %3$s every %4$s %5$s(s)’, $plan->name, simpay_format_currency( simpay_convert_amount_to_dollars(…Continue reading