WP Simple Pay: Set a Per-Form Custom Amount Programmatically

/** * @link https://library.wpcode.com/snippet/7oq8llow/ * * @param \SimplePay\Core\PaymentForm\PriceOption[] $price_options Payment form price options. * @param \SimplePay\Core\Abstracts\Form $form Payment form. * @return \SimplePay\Core\PaymentForm\PriceOption[] */ add_filter( ‘simpay_get_payment_form_price_options’, function( $price_options, $form ) { // BEGIN UPDATES. $form_id = 150; // Payment form ID.…Continue reading

WP Simple Pay: Translate Stripe Error Messages

/** * @link https://library.wpcode.com/snippet/rov9rl2l/ */ add_filter( ‘simpay_get_localized_error_list’, /** * @param array $messages Stripe error messages. Keyed by error code. * @return array */ function( $messages ) { // https://stripe.com/docs/error-codes#coupon-expired $messages[‘coupon_expired’] = ‘The coupon has expired and is no longer valid’;…Continue reading

WP Simple Pay: Use Payment Form Description as Payment Description

/** * @link https://library.wpcode.com/editor/ro8wd9ow/ */ add_filter( ‘simpay_get_paymentintent_args_from_payment_form_request’, /** * @param array $args Payment Intent arguments. * @param \SimplePay\Core\Abstracts\Form $form Form instance. */ function( $args, $form ) { $args[‘description’] = $form->item_description; return $args; }, 10, 2 );Continue reading

Update Single Event 1.3

// Create admin menu for ‘Update Single Event’ if (!function_exists(‘custom_single_event_button_menu’)) { add_action(‘admin_menu’, ‘custom_single_event_button_menu’); function custom_single_event_button_menu() { add_menu_page(‘Update Single Event’, ‘Update Single Event’, ‘manage_options’, ‘update_single_event’, ‘update_single_event_manual_trigger’, ”, 98); } } // Display admin menu content for ‘Update Single Event’ if (!function_exists(‘update_single_event_manual_trigger’))…Continue reading