Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Apply Payment Failed tags when a charge fails in Stripe.
- *
- * @since 3.37.13
- *
- * @param \Stripe\Event $event Stripe webhook event.
- * @param \Stripe\Charge $charge Stripe Charge.
- */
- public function charge_failed( $event, $charge ) {
- $settings = get_post_meta( $charge->metadata->simpay_form_id, 'wpf_settings_simple_pay', true );
- if ( empty( $settings ) || false == $settings['enable'] || empty( $settings['apply_tags_payment_failed'] ) ) {
- return;
- }
- $user = get_user_by( 'email', $charge->customer->email );
- wp_fusion()->user->apply_tags( $settings['apply_tags_payment_failed'], $user->ID );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement