#krishna1433-multiple-ACH

1 messages · Page 1 of 1 (latest)

dense kite
#

What call did you make to update the customer when you saw this happen?

nimble panther
#
                account_holder_name: nameInput.value,
                account_holder_type: accountholderType.value,
                currency: 'USD',
                country: 'US',
                account_number: accountInput.value,
                routing_number: routingInput.value,
            }).then(function (resp) {
                if (resp.token != null) {
                    CreateCustomer(resp.token.id);
                }
                if (resp.error != null) {
                    showError()
                }
            })```
#

this is CreateCustomer

        $.ajax({
            type: "POST",
            url: "/Payment/CreateCustomerWithBankAccount",
            data: { "bankAccountToken": bankAccountToken, "paymentViewModel": paymentViewModel }
        }).done(
            window.onload = function () {
                $(".success-msg-box").show();
                $(".loader").hide();
                $("#lblSuccess").html('Bank Account Submitted for Verification. Payment will be processed after account is verified.');
                setTimeout(function () {
                    $(".success-msg-box").hide();
                    $("#submit-cancel").hide();
                    window.location.href = "/Payment/SearchPaymentDetails?PolicyLocator=" + paymentViewModel.policyLocator
                }, 8000);
            }).fail(
                window.onload = function () {
                    $(".alert-msg-box").show();
                    $(".loader").hide();
                    $("#bank-account-details").trigger('reset');
                    $("#lblError").html('Bank Account Submisson for Verification Failed. Please try again.');
                    setTimeout(function () {
                        $(".alert-msg-box").hide();
                    }, 8000)
                }
            )
        }```
#

on server

                {
                    var customerUpdateOptions = new CustomerUpdateOptions()
                    {
                        Source = bankAccountToken
                    };
                    customer = customerService.Update(paymentViewModel.CustomerId, customerUpdateOptions);
                }
                else
                {
                    var customerCreateOptions = new CustomerCreateOptions
                    {
                        Name = paymentViewModel.Name,
                        Email = paymentViewModel.Email,
                        Phone = paymentViewModel.PhoneNo,
                        Source = bankAccountToken,
                        Metadata = new Dictionary<string, string>()
                        {
                            { "PaymentScheduleName", paymentViewModel.PaymentScheduleName},
                            { "PolicyholderLocator", paymentViewModel.PolicyholderLocator},
                            { "SelectedPaymentMethodId", paymentViewModel.SelectedPaymentMethodId},
                            { "InvoiceNumber", paymentViewModel.InvoiceDetails[0].InvoiceLocator },
                            { "PolicyNumber", paymentViewModel.PolicyLocator },
                            { "wfif", workflowTable.WorkflowID }
                        }
                    };
                    customer = customerService.Create(customerCreateOptions);
                }```
#

since I already have customerid it should update the source

#

I mean add the source

nimble panther
#

Hi @dense kite just reminding

dense kite
#

Yes, apologies. Thanks for the reminder. Will get back to this soon.

#

Do you have the request ID from when this happened (req_123)?

nimble panther
#

Sure just a sec

nimble panther
#

req_JMPnxtOnxgFfJ2

#

apologies for delay

odd salmon
#

looking