Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe integration #3018

Merged
merged 152 commits into from Sep 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
91b3997
stripe integration: using managed accounts
Jul 19, 2017
0899028
stripe integration: store shipping address when paying with stripe
Jul 19, 2017
eec44fa
stripe integration: reject booking more than 90 days; handle creation…
Jul 19, 2017
5bd8e87
stripe integration: fix check for booking date; optionally hide store…
Jul 19, 2017
76ef6e7
stripe integration: allow transfers when balance transaction currency…
Jul 19, 2017
0da3ae1
stripe integration: allow to update address and edit bank account
Jul 19, 2017
ee3a943
stripe integration: add feature flag; code cleanup - remove unnecessa…
Jul 19, 2017
d8d414e
stripe integration: combined stripe/paypal payment preferences
Jul 19, 2017
2bc1306
stripe integration: removed admin/stripe_preferences, cut admin/paypa…
Jul 19, 2017
6202a26
stripe integration: remove fee notice from buyer email
Jul 19, 2017
8d225cc
stripe integration: fix left admin nav and payment connection view
Jul 19, 2017
e3ad863
stripe integration: code cleanup - remove stripe_fee from view
Jul 19, 2017
fc7e5e5
stripe integration: place checkout with paypal under stripe
Jul 19, 2017
03f8091
stripe integration: popups about stripe and paypal fees
Jul 19, 2017
2ab683d
stripe integration: connect paypal moved to payment preferences path
Jul 19, 2017
e4763a3
stripe integration: single payment settings controller for stripe and…
Jul 19, 2017
e2cf672
stripe integration: fix changing marketplace currency; fix :stripe fe…
Jul 19, 2017
b804621
stripe integration: fix description in charges; fix some paypal specs
Jul 19, 2017
128c655
stripe integration: reduce rubocop warnings, fix paypal connect typo
Jul 19, 2017
9df9f5b
stripe integration: update address, fix verification requirements
Jul 19, 2017
e3cc932
stripe integration: added cucumber integration test features/stripe/s…
Jul 19, 2017
6dc9598
stripe integration: provision also :stripe payment settings for trial…
Jul 19, 2017
ec6dd4b
stripe integration: fix rubocop warnings
Jul 19, 2017
3e82cc9
stripe integration: fake stripe integration for testing
valdis Jul 20, 2017
0f03d01
stripe integration: fix tests
valdis Jul 25, 2017
bd07bdf
stripe integration: fixed stripe api key registration
valdis Jul 26, 2017
e828ea1
stripe integration: fix paypal and stripe can be both active
valdis Jul 26, 2017
4c3186e
stripe integration: proper date parsing in stripe account form
Jul 27, 2017
dccf138
Merge branch 'stripe-integration-fixes' into 'stripe-integration'
valdis Jul 27, 2017
abb3c22
Stripe integration: honor rubocop
valdis Jul 27, 2017
63da8bb
stripe integration: do not store ssn_last_4 and personal_id_number in…
Jul 28, 2017
843c75b
stripe integration: remove unused fields from stripe_accounts table
Jul 28, 2017
9cf8c06
Merge branch 'stripe-integration-fixes' of git.ithouse.lv:sharetribe/…
valdis Jul 28, 2017
c287324
stripe integration: fix bank account number form; for testing use US,…
Jul 28, 2017
98e24f3
stripe integration: allow stripe cucumber feature to run with real ap…
Jul 28, 2017
a190afb
stripe integration: update account creation to use new api - type=cus…
Jul 28, 2017
b2b2f65
stripe integration: omit empty routing number, fix check for verifica…
Jul 28, 2017
f77cf47
stripe integration: stub fake_stripe post /accounts/:id/external_acco…
Jul 28, 2017
2536647
stripe integration: fix some typos in i18n texts
Jul 30, 2017
0c9fc84
stripe integration: squash migrations
Aug 1, 2017
3acbade
maps.googleapis.com - implicit protocol instead of https to avoid Pha…
Aug 2, 2017
0ab8bc0
stripe integration: implement destination charges, not storing bank a…
Aug 2, 2017
ce20463
stripe integration: store transaction and person ids in metadata
Aug 2, 2017
cb0bef6
stripe integration: on listing page show only configured and enabled …
Aug 4, 2017
fcb2ee1
chore: reduce random test failures
valdis Aug 12, 2017
afd4f14
stripe integration: changed admin ui to connect stripe and paypal
Aug 14, 2017
db4bda1
stripe integration: using named parameters, added sharetribe_ prefix …
Aug 14, 2017
e1f2980
stripe integration: added links describing payment modes
Aug 14, 2017
4d02584
stripe integration: avoid storing personal info in database, retrieve…
Aug 14, 2017
fa58722
chore: reduce random test failures
valdis Aug 15, 2017
b32a836
chore: add migration changes
valdis Aug 15, 2017
a4b8245
Merge pull request #3026 from sharetribe/stripe-destination-charges
valdis Aug 15, 2017
71f72fa
Merge pull request #3031 from sharetribe/stripe-new-admin-ui
valdis Aug 16, 2017
e656631
stripe integration: updated ui for providers connecting paypal or stripe
Aug 15, 2017
dd27e3e
stripe integration: adjust checkout UI
Aug 16, 2017
c29320b
stripe integration: combined payment processing fee popup with info a…
Aug 16, 2017
2486b34
stripe integration: payment processing fee popup when accepting order
Aug 16, 2017
a65ef0d
stripe integration: adjust transaction email to seller
Aug 16, 2017
837a278
stripe integration: filter sensitive data from logs
Aug 17, 2017
9e15104
Merge pull request #3033 from sharetribe/stripe-checkout-ui-fixes
valdis Aug 18, 2017
246e75f
stripe integration: updated ui for providers connecting paypal or stripe
Aug 15, 2017
1192081
stripe integration: updated shipping address ui on checkout
Aug 17, 2017
5e145e2
stripe integration: updated ui for providers connecting paypal or stripe
Aug 15, 2017
52db598
stripe integration: reduce stripe expiration period to 6 days
Aug 16, 2017
cd1bc46
stripe integration: extracted duplicated code in payment_setup_status…
Aug 16, 2017
00a191b
stripe integration: added note about stripe_feature_enabled? implemen…
Aug 16, 2017
6f067fc
chore: reduce random test failures
valdis Aug 16, 2017
a4712b8
stripe integration: added migration to provision stripe payment_setti…
Aug 17, 2017
a4b40a2
stripe integration: country-dependent link to stripe terms of service
Aug 17, 2017
494f1f0
stripe integration: fix api key names and order for connected
Aug 16, 2017
df55189
Stripe: hide stripe and paypal comparison if only one is available
valdis Aug 17, 2017
924b6fe
stripe integration: update texts and alignment in admin settings
Aug 21, 2017
b5d5731
stripe integration: show transaction fee form after connection
Aug 21, 2017
e7d30c3
stripe integration: fix typos and update texts for admin ui
Aug 22, 2017
a9aa9dc
stripe integration: fix link pointer cursor for fee popup
Aug 22, 2017
9c44b73
stripe integration: updated stripe and paypal feature tests after set…
Aug 22, 2017
568e80c
stripe integration: fix commission calculation :direct mode when gate…
Aug 22, 2017
cc8650a
stripe integration: rewrite misleading error message about gateway setup
Aug 22, 2017
e45d729
stripe integration: pre-populate "Minimum transaction size" based on …
Aug 22, 2017
15c0468
stripe integration: update preauthorized email text
Aug 23, 2017
1be9079
stripe integration: allow different commissions for stripe and paypal
Aug 23, 2017
67d2584
stripe integration: update "Getting Started Guide" step 5 texts
Aug 23, 2017
5444d80
stripe integration: updated admin ui texts
Aug 23, 2017
a224e9b
stripe integration: redirect admin/paypal_preferences to admin/paymen…
Aug 23, 2017
969f6b6
stripe integration: fix code style for npm lint in OnboardingGuide/Gu…
Aug 23, 2017
bc164a6
stripe integration: updated rules to check valid payment gateways for…
Aug 23, 2017
1bebc4b
Merge pull request #3042 from sharetribe/stripe-admin-ui-additional-f…
valdis Aug 24, 2017
1813e58
Merge pull request #3039 from sharetribe/stripe-checkout-shipping-form
valdis Aug 24, 2017
2d17aa8
stripe integration: fix message key for setup error
Aug 25, 2017
fb67231
stripe integration: updated rules with all currencies to check availa…
Aug 25, 2017
834e386
stripe integration: update checks to show warning about missing payme…
Aug 25, 2017
68bd8c0
stripe integration: typo fixed in notice
Aug 25, 2017
aa83b0e
stripe integration: update copy texts for payment fee popup
Aug 25, 2017
bbe9850
stripe integration: store provider email to when registering with str…
Aug 25, 2017
593eeb9
stripe integration: show translated country names in provider account…
Aug 25, 2017
0b9f1ee
stripe integration: rewrite error message about invalid bank account …
Aug 25, 2017
a442dfb
stripe integration: updated layout, texts and error handling for prov…
Aug 25, 2017
c90df04
stripe integration: replaced twitter_cldr with ffi-locale to correctl…
Aug 25, 2017
64c2d78
stripe integration: show translated country name in admin settings
Aug 25, 2017
5543ba7
stripe integration: require bank account currency
Aug 26, 2017
86c313e
stripe integration: fix payouts for :destination payments when transf…
Aug 26, 2017
65235f2
stripe integration: remove cached country_specs - not used anymore
Aug 26, 2017
e800a66
stripe integration: fix rubocop warnings
Aug 28, 2017
117ebd1
Merge pull request #3036 from sharetribe/stripe-integration-comment-f…
valdis Aug 30, 2017
6371833
Merge pull request #3049 from sharetribe/stripe-admin-ui-additional-f…
valdis Aug 30, 2017
3e8a6b3
Merge pull request #3052 from sharetribe/stripe-provider-ui-fixes-and…
valdis Aug 30, 2017
166051c
stripe integration: using sharetribe_transaction_id instead of sharet…
Aug 28, 2017
51c03a6
stripe integration: default 3 days for expiration
Aug 28, 2017
c24707e
stripe integration: update texts and layouts for checkout page
Aug 28, 2017
4c16dc0
stripe integration: show marketplace fee in transaction details
Aug 28, 2017
27221ea
stripe integration: updated checkout shipping address ui
Aug 28, 2017
4bca61f
stripe integration: ui fixes for provider payment settings:
Aug 29, 2017
cad09ea
stripe integration: twitter_cldr to sort translated countries
Aug 30, 2017
157402e
stripe integration: updated country set rules, exception is BRL/BR fo…
Aug 30, 2017
d9ff809
stripe integration: check if payment method is ready to show fee popup
Aug 30, 2017
5a1b36f
stripe integration: add links to new help articles
Aug 30, 2017
2646e40
stripe integration: fixed handling of missing country codes
Aug 30, 2017
f1049f5
stripe integration: use i18n for confirmed text
Aug 30, 2017
40e8810
stripe integration: update help links
Aug 31, 2017
fd97e2a
stripe integration: fix interpolation key in fee notice
Aug 31, 2017
02167c2
stripe integration: fix typos in fee notices
Aug 31, 2017
46ded95
stripe integration: updated shipping address form
Sep 1, 2017
430911c
stripe integration: updated text about paypal on accept
Sep 1, 2017
d6ff1bf
stripe integration: update payment logos
Sep 1, 2017
92823b9
stripe integration: bank account uses default currency by country
Sep 1, 2017
ed27f22
stripe integration: booking date max = 60 days, auto confirm = 90 days
Sep 4, 2017
0282327
stripe integration: support for additional countries
Sep 6, 2017
17bf0cd
stripe integration: additional test regexps
Sep 6, 2017
66781b4
Merge pull request #3059 from sharetribe/stripe-checkout-additional-f…
valdis Sep 8, 2017
4717e09
Merge pull request #3054 from sharetribe/stripe-checkout-additional-f…
valdis Sep 8, 2017
e563729
stripe integration: fix missing article in text
Sep 13, 2017
2d616ac
stripe integration: target=_blank for help article
Sep 13, 2017
c4e1499
stripe integration: keep old ui when stripe feature flag disabled
Sep 13, 2017
5dcdd1d
stripe integration: update paypal feature test when stripe disabled
Sep 14, 2017
a82d847
stripe integration: remove trailing spaces to avoid npm lint error
Sep 14, 2017
0250fa3
stripe integration: removed extra padding in payment settings
Sep 14, 2017
7521605
stripe integration: reset min transaction size only if it is less tha…
Sep 14, 2017
23ec994
stripe integration: not storing CC or customers, removed :direct paym…
Sep 14, 2017
d4b416d
stripe integration: fix padding, remove extra paypal logo on checkout
Sep 14, 2017
933f1c1
mocking google geocoder in feature tests to avoid random failures
Sep 14, 2017
c3c67dd
stripe integration: disable datepicker after stripe_max_booking_date
Sep 18, 2017
0b0c3f6
stripe integration: updated country sets
Sep 18, 2017
6af0a0b
Merge pull request #3070 from sharetribe/stripe-admin-ui-fixes-3
valdis Sep 18, 2017
b381bec
Merge pull request #3069 from sharetribe/stripe-integration-feature-f…
valdis Sep 18, 2017
8245ec5
Merge pull request #3062 from sharetribe/stripe-additional-countries
valdis Sep 18, 2017
8a90dcb
Merge branch 'stripe-integration-dont-store-cards' into stripe-integr…
valdis Sep 18, 2017
7f5ea6f
Merge branch 'stripe-additional-countries' into stripe-integration
valdis Sep 18, 2017
26ba016
Merge branch 'master'
Sep 18, 2017
a6ece08
migrations for test environment
valdis Sep 20, 2017
e34faff
Stripe integration: improved translations
valdis Sep 21, 2017
0629eaa
Stripe integration: fix select layout
valdis Sep 21, 2017
4172486
Stripe integration: don't display missing payment info if payments ha…
valdis Sep 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -44,6 +44,7 @@ coverage/
*.sock
.vagrant
.env
.session.vim

# React on Rails
npm-debug.log*
Expand Down
1 change: 1 addition & 0 deletions .rubocop_todo.yml
Expand Up @@ -95,6 +95,7 @@ Layout/EmptyLineAfterMagicComment:
- 'app/view_utils/icon_map.rb'
- 'app/view_utils/intercom_helper.rb'
- 'features/support/feature_tests/action/paypal.rb'
- 'features/support/feature_tests/action/stripe.rb'
- 'spec/controllers/listings_controller_spec.rb'
- 'spec/models/community_spec.rb'
- 'spec/services/feature_flag_service/api/features_spec.rb'
Expand Down
5 changes: 5 additions & 0 deletions Gemfile
Expand Up @@ -70,6 +70,7 @@ gem 'stringex', '~> 2.7.1'
gem 'paypal-sdk-permissions', '~> 1.96.4'
gem 'paypal-sdk-merchant', '~> 1.116.0'
gem 'airbrake', '~> 6.1.2'
gem 'stripe', '~> 3.0.0'

gem 'jwt', '~> 1.5.6'

Expand Down Expand Up @@ -144,6 +145,8 @@ group :test do

# required for CircleCI automatic test balancing
gem 'rspec_junit_formatter'

gem 'fake_stripe'
end

group :development, :test do
Expand All @@ -164,3 +167,5 @@ gem 'transit-ruby', '~> 0.8.1'
gem 'redcarpet', '~> 3.4.0'

gem 'intercom'

gem 'twitter_cldr'
31 changes: 31 additions & 0 deletions Gemfile.lock
Expand Up @@ -94,6 +94,7 @@ GEM
builder (3.2.3)
byebug (9.0.6)
callsite (0.0.11)
camertron-eprun (1.1.1)
capybara (2.6.2)
addressable
mime-types (>= 1.16)
Expand All @@ -104,6 +105,7 @@ GEM
childprocess (0.7.0)
ffi (~> 1.0, >= 1.0.11)
chunky_png (1.3.8)
cldr-plurals-runtime-rb (1.0.1)
climate_control (0.2.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
Expand Down Expand Up @@ -139,6 +141,8 @@ GEM
money (~> 6.7)
sixarm_ruby_unaccent (~> 1.1)
unicode_utils (~> 1.4)
crack (0.4.3)
safe_yaml (~> 1.0.0)
css_parser (1.5.0)
addressable
cucumber (2.4.0)
Expand Down Expand Up @@ -193,6 +197,10 @@ GEM
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
railties (>= 3.0.0)
fake_stripe (0.0.12)
capybara
sinatra
webmock
faraday (0.11.0)
multipart-post (>= 1.2, < 3)
faraday-encoding (0.0.4)
Expand Down Expand Up @@ -227,6 +235,7 @@ GEM
haml (5.0.1)
temple (>= 0.8.0)
tilt
hashdiff (0.3.4)
hashie (3.5.5)
hiredis (0.6.1)
htmlentities (4.3.4)
Expand Down Expand Up @@ -297,6 +306,7 @@ GEM
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
mustermann (1.0.0)
mysql2 (0.4.6)
nenv (0.3.0)
netrc (0.11.0)
Expand Down Expand Up @@ -364,6 +374,8 @@ GEM
rack
rack-contrib (1.2.0)
rack (>= 0.9.1)
rack-protection (2.0.0)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (5.1.1)
Expand Down Expand Up @@ -462,6 +474,7 @@ GEM
ruby-progressbar (1.8.1)
ruby_dep (1.5.0)
rubyzip (1.2.1)
safe_yaml (1.0.4)
sass (3.4.24)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
Expand All @@ -474,6 +487,11 @@ GEM
rubyzip (~> 1.0)
websocket (~> 1.0)
shellany (0.0.1)
sinatra (2.0.0)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.0)
tilt (~> 2.0)
sitemap_generator (5.3.1)
builder (~> 3.0)
sixarm_ruby_unaccent (1.1.1)
Expand All @@ -487,6 +505,8 @@ GEM
sprockets (>= 3.0.0)
statesman (2.0.1)
stringex (2.7.1)
stripe (3.0.0)
faraday (~> 0.9)
temple (0.8.0)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
Expand All @@ -508,6 +528,10 @@ GEM
oj (~> 2.18)
trollop (2.1.2)
truncate_html (0.9.3)
twitter_cldr (4.4.1)
camertron-eprun
cldr-plurals-runtime-rb (~> 1.0)
tzinfo
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.2.0)
Expand All @@ -529,6 +553,10 @@ GEM
multi_json
multipart-post (~> 2.0)
trollop (~> 2.0)
webmock (3.0.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket (1.2.4)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
Expand Down Expand Up @@ -569,6 +597,7 @@ DEPENDENCIES
dynamic_form (~> 1.1.4)
email_spec (~> 2.1.1)
factory_girl_rails (~> 4.8.0)
fake_stripe
faraday (~> 0.11.0)
faraday-encoding (~> 0.0.4)
faraday_middleware (~> 0.11.0)
Expand Down Expand Up @@ -623,12 +652,14 @@ DEPENDENCIES
sitemap_generator (~> 5.3.1)
statesman (~> 2.0.1)
stringex (~> 2.7.1)
stripe (~> 3.0.0)
therubyracer (~> 0.12.3)
thinking-sphinx (~> 3.3.0)
timecop (~> 0.8.1)
transit-ruby (~> 0.8.1)
truncate_html (~> 0.9.3)
ts-delayed-delta!
twitter_cldr
uglifier (~> 3.2.0)
uuidtools (~> 2.1.5)
web-console (~> 3.5.1)
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/checkout_with_paypal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/powered_by_stripe.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/stripe_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions app/assets/javascripts/admin/payment_preferences.js
@@ -0,0 +1,54 @@
window.ST = window.ST || {};

(function(module) {

var initPaymentTabs = function(min_price, fee_error_message) {
$(".tab-link").click(function(){
$(".tab-link").removeClass("active");
$(this).addClass("active");
$(".tab-content").hide();
$("#"+$(this).data('tab')).show();
return false;
});

$("#config_paypal_toggle").click(function(){
$(".connect-row").hide();
$(".payment-tabs").show();
$(".tab-link.paypal").click();
return false;
});

$("#config_stripe_toggle").click(function(){
$(".connect-row").hide();
$(".payment-tabs").show();
$(".tab-link.stripe").click();
return false;
});

$("#transaction_preferences_form_paypal, #transaction_preferences_form_stripe").each(function() {
$(this).validate({
errorPlacement: function(error, element) {
error.appendTo(element.parent());
},
rules: {
"payment_preferences_form[commission_from_seller]": {
required: true,
number_min: 0,
number_max: 100,
number_no_decimals: true
},
"payment_preferences_form[minimum_transaction_fee]": {
required: true,
number_max: min_price,
number_min: 0,
}
},
messages: {
"payment_preferences_form[minimum_transaction_fee]": fee_error_message
}
});
})
};
module.initPaymentTabs = initPaymentTabs;

})(window.ST);
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Expand Up @@ -72,6 +72,7 @@
//= require admin/listing_shapes
//= require admin/settings.js
//= require admin/emails.js
//= require admin/payment_preferences.js
//= require payment_math
//= require dropdown
//= require jquery.nouislider
Expand All @@ -90,4 +91,5 @@
//= require listing_form
//= require radio_buttons
//= require new_layout
//= require stripe_form
//= require_self
14 changes: 14 additions & 0 deletions app/assets/javascripts/kassi.js
Expand Up @@ -904,3 +904,17 @@ function enableSamePageScroll() {
return [];
}
}

function autoSetMinimalPriceFromCountry() {
var _minimal_commissions = {USD: 50, AUD: 50, BRL: 50, GBP: 50, CAD: 50, CZK: 1500, DKK: 500, EUR: 50, HKD: 500, HUF: 10000, ILS: 200, JPY: 50, MXN: 500, MYR: 200, TWD: 1500, NZD: 50, NOK: 500, PHP: 2000, PLN: 200, RUB: 1500, SGD: 100, SEK: 500, CHF: 100, THB: 1500, TRY: 150};
var _min_price = $("#payment_preferences_form_minimum_listing_price");
$("#payment_preferences_form_marketplace_currency").change(function(){
var currency = $(this).val();
var min_tx = _minimal_commissions[currency] / 100;
var cur_tx = parseFloat(_min_price.val());
if(isNaN(cur_tx) || min_tx > cur_tx) {
_min_price.val(min_tx.toFixed(2))
}
_min_price.next(".paypal-preferences-currency-label").text(currency);
}).trigger('change');
}
8 changes: 4 additions & 4 deletions app/assets/javascripts/paypal_account_settings.js
Expand Up @@ -29,7 +29,7 @@ window.ST = window.ST || {};

module.initializePayPalPreferencesForm = function(formId, commissionRange) {
var $form = $('#' + formId);
var $currency = $form.find('#paypal_preferences_form_marketplace_currency');
var $currency = $form.find('#payment_preferences_form_marketplace_currency');
var $currencyLabels = $form.find('.paypal-preferences-currency-label');
var $warning = $form.find('.paypal-currency-change-warning-text');

Expand All @@ -43,16 +43,16 @@ window.ST = window.ST || {};
error.appendTo(element.parent());
},
rules: {
"paypal_preferences_form[commission_from_seller]": {
"payment_preferences_form[commission_from_seller]": {
required: true,
number_min: commissionRange[0],
number_max: commissionRange[1],
number_no_decimals: true
},
"paypal_preferences_form[minimum_listing_price]": {
"payment_preferences_form[minimum_listing_price]": {
required: true
},
"paypal_preferences_form[minimum_transaction_fee]": {
"payment_preferences_form[minimum_transaction_fee]": {
required: true,
number_min: 0
}
Expand Down