#krishna1433-multiple-ACH
1 messages · Page 1 of 1 (latest)
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
Hi @dense kite just reminding
Yes, apologies. Thanks for the reminder. Will get back to this soon.
Do you have the request ID from when this happened (req_123)?
Sure just a sec
looking
your approach replaces the existing bank acct
you want this API request to add but not replace: https://stripe.com/docs/api/customer_bank_accounts/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.