Skip to content

Commit

Permalink
Move billing info first/last name into credit card only dom. #74
Browse files Browse the repository at this point in the history
  The PayPal API gives us first/last so no point in requiring it.
  Unfortunately can't say the same for address, which is needed for
  sales tax.
  • Loading branch information
em committed Aug 13, 2013
1 parent 2261374 commit e7453e3
Show file tree
Hide file tree
Showing 11 changed files with 11,567 additions and 21 deletions.
12 changes: 6 additions & 6 deletions build/recurly.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/recurly.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#Recurly.js CHANGELOG

##Version 2.2.3 (Aug 13, 2013)
- Fix an issue where first/last name show up for PayPal when distinguishContactFromBillingInfo is true

##Version 2.2.2 (June 6, 2013)
- Fix bug in PayPal integration.
- Fix a bug where a coupon specified by initial prefilled values would not get applied to the subscription.
Expand Down
1 change: 1 addition & 0 deletions examples/subscribe.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
planCode: 'simpleplan',
distinguishContactFromBillingInfo: true,
collectCompany: true,
collectContact: false,
termsOfServiceURL: 'http://example.com/tos',
acceptPaypal: true,
acceptedCards: ['mastercard',
Expand Down
14 changes: 7 additions & 7 deletions src/dom/billing_info_fields.jade
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
input(type="radio", name="payment_method", value="paypal")
.logo

.field.first_name
.placeholder First Name
input(type="text")
.credit_card
.field.first_name
.placeholder First Name
input(type="text")

.field.last_name
.placeholder Last Name
input(type="text")
.field.last_name
.placeholder Last Name
input(type="text")

.credit_card
.card_cvv
.field.card_number
.placeholder Credit Card Number
Expand Down
6 changes: 3 additions & 3 deletions src/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,10 @@ function pullBillingInfoFields($form, billingInfo, options, pull) {

billingInfo.paymentMethod = pull.field($form, '.payment_method');

billingInfo.firstName = pull.field($form, '.billing_info .first_name', V(R.isNotEmpty));
billingInfo.lastName = pull.field($form, '.billing_info .last_name', V(R.isNotEmpty));

if(billingInfo.paymentMethod !== 'paypal') {
billingInfo.firstName = pull.field($form, '.billing_info .first_name', V(R.isNotEmpty));
billingInfo.lastName = pull.field($form, '.billing_info .last_name', V(R.isNotEmpty));

billingInfo.number = pull.field($form, '.card_number', V(R.isNotEmpty), V(R.isValidCC));
billingInfo.cvv = pull.field($form, '.cvv', V(R.isNotEmpty), V(R.isValidCVV));
billingInfo.month = pull.field($form, '.month');
Expand Down
6 changes: 3 additions & 3 deletions test/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
<script src="http://code.jquery.com/jquery-1.10.0.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>
<link rel="stylesheet" href="support/qunit.css" type="text/css" media="screen" />
<script src="support/jquery-1.10.0.js"></script>
<script type="text/javascript" src="support/qunit.js"></script>
<script type="text/javascript" src="../build/recurly.js"></script>

<script>
Expand Down
Loading

0 comments on commit e7453e3

Please sign in to comment.