WordPress.org

Support

Support » Plugins and Hacks » Failed Charges

Failed Charges

  • Hello Noel and the rest of the Wp-Stripe Community,

    Have any of you had an issue with Failed charges?

    We have an implementation of WP-STRIPE which works great for most cards. It processes payments when the customer enters proper information and rejects their card when they enter something bogus.

    But, with one of our customers, he keeps getting “failed” messages when he processes his card. The STRIPE response handler still returns ok…but it never charges his card.

    As you can imagine, we lose a lot of money everytime our customers card fails but still takes him past the payment form (to the receipt page).

    Please help us solve this issue. Here is some code:

    function stripeResponseHandler(status, response) {
            if (response.error) {
    
                $('.stripe-submit-button').prop("disabled", false).css("opacity","1.0");
                $(".payment-errors").show().html(response.error.message);
    
            } else {
    
                var form$ = $("#wp-stripe-payment-form");
    			var otherform$ = $("#checkout_form");
                var token = response['id'];
                form$.append("<input type='hidden' name='stripeToken' value='" + token + "' />");
    
                var newStripeForm = form$.serialize();
    
                $.ajax({
                    type : "post",
                    dataType : "json",
                    url : ajaxurl,
                    data : newStripeForm,
                    success: function(response) {
    
                        $('.wp-stripe-details').prepend(response);
                        $('.stripe-submit-button').prop("disabled", false).css("opacity","1.0");
    					otherform$.submit();
    					resetStripeForm();
    
                    }
    
                });
    
            }
        }

    We need otherform$ to be submitted only for successful charges. But for some reason a “failed” card actually goes past the “response.error” if statement and submits the otherform$.

    http://wordpress.org/extend/plugins/wp-stripe/

  • The topic ‘Failed Charges’ is closed to new replies.