如何将银行帐户信息发送到条纹连接帐户

时间:2019-12-05 05:37:13

标签: javascript php stripe-payments

我想将银行帐户信息和客户信息发送到stripe connect accounts

,但无法发送。提交表单后,它在以下错误处回复并仅发送/v1/token

Fatal error: Uncaught (Status 400) (Request req_0xP7zQ9ORbJm2l) This bank account is not a 
valid source for payments. 
Only valid sources can be attached to a customer. 
You can validate a bank account at creation time by passing the parameter usage='source'. 
The particular issue is: You cannot charge or add SEPA bank accounts to customers. 
thrown in---

下面是我的代码:

    function cardValidation () {
        var valid = true;
        var account_holder_type = $('#account_holder_type').val();
        var account_holder_name = $('#account_holder_name').val();
        var routing_number = $('#routing_number').val();
        var account_number = $('#account_number').val();
        var email = $('#email').val();


        $("#error-message").html("").hide();

        return valid;
    }
    Stripe.setPublishableKey("<?php echo STRIPE_PUBLISHABLE_KEY; ?>");
    function stripeResponseHandler(status, response) {
        if (response.error) {
            //enable the submit button
            $("#submit-btn").show();
            $( "#loader" ).css("display", "none");
            //display the errors on the form
            $("#error-message").html(response.error.message).show();
        } else {
            //get token id
            var token = response['id'];
            //insert the token into the form
            $("#frmStripePayment").append("<input type='hidden' name='token' value='" + token + "' />");
            //submit form to the server
            $("#frmStripePayment").submit();
        }
    }
    function stripePay(e) {
        e.preventDefault();
        var valid = cardValidation();

        if(valid == true) {
            $("#submit-btn").hide();
            $( "#loader" ).css("display", "inline-block");

           Stripe.bankAccount.createToken({
                country: $('#country').val(),
                currency: $('#currency').val(),
                routing_number: $('#routing_number').val(),
                account_number: $('#account_number').val(),
                account_holder_name: $('#account_holder_name').val(),
                account_holder_type: $('#account_holder_type').val()
            }, stripeResponseHandler);


            return false;
        }
    }

我的上述代码是否有任何问题。还是有人建议一些有关条带连接的教程?

0 个答案:

没有答案