Skip to content

Commit

Permalink
set account holder type
Browse files Browse the repository at this point in the history
  • Loading branch information
jdungan committed Oct 21, 2016
1 parent 6bd9e55 commit e10d8dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions payments/templates/bank_account_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
{% csrf_token %}
<input type="hidden" data-stripe="country" value="US">
<input type="hidden" data-stripe="currency" value="USD">
<input type="hidden" id="account_holder_type" data-stripe="account_holder_type" value="individual">

<div class="form-group">
<label for="name">Name on the account</label>
<input type="text" class="form-control" data-stripe="account_holder_name" autocomplete="off" value="{{ STRIPE_DEBUG.bank.name}}" maxlength="16" />
Expand All @@ -12,10 +14,10 @@
<label for="acct-number">Account Number</label>
<input type="text" class="form-control" data-stripe="account_number" autocomplete="off" value="{{ STRIPE_DEBUG.bank.account_number}}" maxlength="16" />
<div >
<label>Acount Type</label>
<input type="radio" name="account_holder_type" data-stripe="account_holder_type" value="individual" id="individual" required checked="checked">
<label>Account Type</label>
<input type="radio" name="form_holder_type" value="individual" id="individual" required checked="checked">
<label for="individual">Individual</label>
<input type="radio" name="account_holder_type" data-stripe="account_holder_type" value="company" id="company">
<input type="radio" name="form_holder_type" value="company" id="company">
<label for="company">Company</label>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions static/js/stripe-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ $(window).load(function () {

$('#stripe-submit').click(function (e) {
e.preventDefault();

// add account_holder_type for bank account and identity forms
let holder_type = $("input[name=form_holder_type]:checked").val()
if (holder_type) {
$('#account_holder_type').val(holder_type)
}
$('#stripe-submit').text('Encrypting ... ');
Stripe[account_type].createToken($form, handleResponse);
});
Expand Down

0 comments on commit e10d8dd

Please sign in to comment.