workarea-stripe 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 596907c9a6f4145170a89081d483847c24a887fde0205fc220f6f486b0380b9a
4
- data.tar.gz: d5d665bca919e45c31be1e5e81c913cada79e97f47cf48392d35080bf55cb49d
3
+ metadata.gz: cd29764a459c7d4f9532363e3e62359a8a12fed89510e74e379dd7b69218d340
4
+ data.tar.gz: 613eb162eb6fa2ed29550dd4c7860a0172a5792d9a9e1cd01b7be8b8e01726db
5
5
  SHA512:
6
- metadata.gz: 307a8647ac8a4530a7d5bedf16905f5018a00681372e42545056afcf118e51fa090e97226c6ca71acc83fb4b0bb0bc1263053787220ba918598e9321671d1997
7
- data.tar.gz: baa5fc1dd1e49fda591486c0da7a4cef2b50a1ac4e73523f8ad8cfafb7be4d804022c3f297a9c9b9895a31309aa0c4a96364cec543e725c10600dde6e63e3920
6
+ metadata.gz: f59a0dbfa719242fa226214ac8a57b51b86600854130b207977dc3413a64b0afb630a60fcd21473b200966e0d5b5de153d7b34b000d09dc3e8149e9e0f1e4110
7
+ data.tar.gz: e4b9d070a3900730e22de2acd0c79ab32db42e05991e0a2f26484ffeec7030492387a19d32193812dc03e977cf73077ede35b5e9c57bf85d5aed1783a416f33a
File without changes
@@ -0,0 +1,57 @@
1
+ name: CI
2
+ on: [push]
3
+
4
+ jobs:
5
+ static_analysis:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v1
9
+ - uses: workarea-commerce/ci/bundler-audit@v1
10
+ - uses: workarea-commerce/ci/rubocop@v1
11
+ - uses: workarea-commerce/ci/eslint@v1
12
+ with:
13
+ args: '**/*.js'
14
+
15
+ admin_tests:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v1
19
+ - uses: actions/setup-ruby@v1
20
+ with:
21
+ ruby-version: 2.6.x
22
+ - uses: workarea-commerce/ci/test@v1
23
+ with:
24
+ command: bin/rails app:workarea:test:admin
25
+
26
+ core_tests:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v1
30
+ - uses: actions/setup-ruby@v1
31
+ with:
32
+ ruby-version: 2.6.x
33
+ - uses: workarea-commerce/ci/test@v1
34
+ with:
35
+ command: bin/rails app:workarea:test:core
36
+
37
+ storefront_tests:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v1
41
+ - uses: actions/setup-ruby@v1
42
+ with:
43
+ ruby-version: 2.6.x
44
+ - uses: workarea-commerce/ci/test@v1
45
+ with:
46
+ command: bin/rails app:workarea:test:storefront
47
+
48
+ plugins_tests:
49
+ runs-on: ubuntu-latest
50
+ steps:
51
+ - uses: actions/checkout@v1
52
+ - uses: actions/setup-ruby@v1
53
+ with:
54
+ ruby-version: 2.6.x
55
+ - uses: workarea-commerce/ci/test@v1
56
+ with:
57
+ command: bin/rails app:workarea:test:plugins
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ log/*.log
17
17
  test/dummy/log/*.log
18
18
  test/dummy/db/*.sqlite3
19
19
  test/dummy/db/*.sqlite3-journal
20
+ .rubocop-http*
@@ -0,0 +1,3 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/workarea-commerce/workarea/master/.rubocop.yml
3
+
@@ -1,3 +1,20 @@
1
+ Workarea Stripe 1.1.0 (2019-11-26)
2
+ --------------------------------------------------------------------------------
3
+
4
+ * Remove decorator for test that was removed in base
5
+
6
+ Ben Crouse
7
+
8
+ * Update credit card issuer validation to allow strip tokens
9
+
10
+ Jeff Yucis
11
+
12
+ * Update README
13
+
14
+ Matt Duffy
15
+
16
+
17
+
1
18
  Workarea Stripe 1.0.0 (2019-08-21)
2
19
  --------------------------------------------------------------------------------
3
20
 
data/Gemfile CHANGED
@@ -1,8 +1,6 @@
1
1
  source 'https://rubygems.org'
2
- git_source(:github) { |repo| "git@github.com:#{repo}.git" }
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
3
 
4
4
  gemspec
5
5
 
6
- gem 'workarea'
7
-
8
- gem 'byebug'
6
+ gem 'workarea', github: 'workarea-commerce/workarea'
data/README.md CHANGED
@@ -3,14 +3,28 @@ Workarea Stripe
3
3
 
4
4
  Stripe plugin for the Workarea platform.
5
5
 
6
+ Getting Started
7
+ --------------------------------------------------------------------------------
8
+
9
+ Add the gem to your application's Gemfile:
10
+
11
+ ```ruby
12
+ # ...
13
+ gem 'workarea-stripe'
14
+ # ...
15
+ ```
16
+
17
+ Update your application's bundle.
18
+
19
+ ```bash
20
+ cd path/to/application
21
+ bundle
22
+ ```
23
+
6
24
  Configuration
7
25
  --------------------------------------------------------------------------------
8
26
 
9
- To configure the stripe plugin you will need both a public and secret key from stripe.
10
- Setting up a stripe sandbox for development is very easy, just create an account
11
- at <https://dashboard.stripe.com/register>.
12
- Once you have an account visit <https://dashboard.stripe.com/account/apikeys> to
13
- access your keys.
27
+ To configure the stripe plugin you will need both a public and secret key from stripe. Setting up a stripe sandbox for development is very easy, just create an account at <https://dashboard.stripe.com/register>. Once you have an account visit <https://dashboard.stripe.com/account/apikeys> to access your keys.
14
28
 
15
29
  Add the following configuration to your app secrets
16
30
 
@@ -42,49 +56,12 @@ example:
42
56
 
43
57
  See the checkouts/payment.html.haml view in this plugin for reference.
44
58
 
45
- Getting Started
46
- --------------------------------------------------------------------------------
47
-
48
- This gem contains a rails engine that must be mounted onto a host Rails application.
49
-
50
- To access Workarea gems and source code, you must be an employee of WebLinc or a licensed retailer or partner.
51
-
52
- Workarea gems are hosted privately at https://gems.weblinc.com/.
53
- You must have individual or team credentials to install gems from this server. Add your gems server credentials to Bundler:
54
-
55
- bundle config gems.weblinc.com my_username:my_password
56
-
57
- Or set the appropriate environment variable in a shell startup file:
58
-
59
- export BUNDLE_GEMS__WEBLINC__COM='my_username:my_password'
60
-
61
- Then add the gem to your application's Gemfile specifying the source:
62
-
63
- # ...
64
- gem 'workarea-stripe', source: 'https://gems.weblinc.com'
65
- # ...
66
-
67
- Or use a source block:
68
-
69
- # ...
70
- source 'https://gems.weblinc.com' do
71
- gem 'workarea-stripe'
72
- end
73
- # ...
74
-
75
- Update your application's bundle.
76
-
77
- cd path/to/application
78
- bundle
79
-
80
- Workarea Platform Documentation
59
+ Workarea Commerce Documentation
81
60
  --------------------------------------------------------------------------------
82
61
 
83
- See [http://developer.weblinc.com](http://developer.weblinc.com) for Workarea platform documentation.
62
+ See [https://developer.workarea.com](https://developer.workarea.com) for Workarea Commerce documentation.
84
63
 
85
- Copyright & Licensing
64
+ License
86
65
  --------------------------------------------------------------------------------
87
66
 
88
- Copyright WebLinc 2018. All rights reserved.
89
-
90
- For licensing, contact sales@workarea.com.
67
+ Workarea Stripe is released under the [Business Software License](LICENSE)
data/Rakefile CHANGED
@@ -34,10 +34,10 @@ desc "Release version #{Workarea::Stripe::VERSION} of the gem"
34
34
  task :release do
35
35
  host = "https://#{ENV['BUNDLE_GEMS__WEBLINC__COM']}@gems.weblinc.com"
36
36
 
37
- #Rake::Task['workarea:changelog'].execute
38
- #system 'git add CHANGELOG.md'
39
- #system 'git commit -m "Update CHANGELOG"'
40
- #system 'git push origin HEAD'
37
+ Rake::Task['workarea:changelog'].execute
38
+ system 'git add CHANGELOG.md'
39
+ system 'git commit -m "Update CHANGELOG"'
40
+ system 'git push origin HEAD'
41
41
 
42
42
  system "git tag -a v#{Workarea::Stripe::VERSION} -m 'Tagging #{Workarea::Stripe::VERSION}'"
43
43
  system 'git push --tags'
@@ -23,5 +23,10 @@ module Workarea
23
23
  end
24
24
  end
25
25
  end
26
+
27
+ def issuer_accepted
28
+ return if stripe?
29
+ super
30
+ end
26
31
  end
27
32
  end
@@ -17,7 +17,7 @@ module ActiveMerchant
17
17
  def store(paysource, options = {})
18
18
  case normalize(paysource)
19
19
  when /1$/, /^tok/, ""
20
- Response.new(true, SUCCESS_MESSAGE, { "id" => "cus_5678", "sources" => { "data" => [{ "id" => 'card_1111', "last4" => '1111', "exp_month" => "1", "exp_year" => "2020", "brand" => "Visa" }] } }, test: true)
20
+ Response.new(true, SUCCESS_MESSAGE, { "id" => "cus_5678", "sources" => { "data" => [{ "id" => 'card_1111', "last4" => '1111', "exp_month" => "1", "exp_year" => "2020", "brand" => "Test Card" }] } }, test: true)
21
21
  when /2$/
22
22
  Response.new(false, FAILURE_MESSAGE, { billingid: nil, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
23
23
  else
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module Stripe
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -0,0 +1,61 @@
1
+ module Workarea
2
+ decorate Storefront::DownloadSystemTest, with: :stripe do
3
+ def test_checking_out_with_downloadable_product
4
+ setup_checkout_specs
5
+
6
+ Order.first.items.delete_all
7
+
8
+ product = create_product(
9
+ name: 'Digital Product',
10
+ variants: [
11
+ { sku: 'SKU1', regular: 10.to_m, tax_code: '001' },
12
+ { sku: 'SKU2', regular: 15.to_m, tax_code: '001' }
13
+ ]
14
+ )
15
+
16
+ create_fulfillment_sku(id: 'SKU1', policy: :download, file: product_image_file)
17
+ create_fulfillment_sku(id: 'SKU2', policy: :download, file: product_image_file)
18
+
19
+ visit storefront.product_path(product)
20
+
21
+ within '.product-details__add-to-cart-form' do
22
+ select product.skus.first, from: 'sku'
23
+ click_button t('workarea.storefront.products.add_to_cart')
24
+ end
25
+
26
+ assert(page.has_content?('Success'))
27
+
28
+ start_guest_checkout
29
+
30
+ assert_current_path(storefront.checkout_addresses_path)
31
+
32
+ fill_in_email
33
+ fill_in_billing_address
34
+ click_button t('workarea.storefront.checkouts.continue_to_payment')
35
+
36
+ assert_current_path(storefront.checkout_payment_path)
37
+ assert(page.has_content?('Success'))
38
+
39
+ fill_in_credit_card
40
+ click_button t('workarea.storefront.checkouts.place_order')
41
+
42
+ assert_current_path(storefront.checkout_confirmation_path)
43
+ assert(page.has_content?('Success'))
44
+ assert(page.has_content?(t('workarea.storefront.flash_messages.order_placed')))
45
+ assert(page.has_content?(Order.first.id))
46
+
47
+ assert(page.has_content?('1019 S. 47th St.'))
48
+ assert(page.has_content?('Philadelphia'))
49
+ assert(page.has_content?('PA'))
50
+ assert(page.has_content?('19143'))
51
+
52
+ assert(page.has_content?('Test Card'))
53
+
54
+ assert(page.has_content?('Digital Product'))
55
+ assert(page.has_content?('$10.00'))
56
+ assert(page.has_content?('$0.70'))
57
+ assert(page.has_content?('$10.70'))
58
+ assert(page.has_content?(t('workarea.storefront.orders.download')))
59
+ end
60
+ end
61
+ end
@@ -92,7 +92,7 @@ decorate Workarea::Storefront::GuestCheckoutSystemTest, with: :stripe do
92
92
  assert(page.has_content?('PA'))
93
93
  assert(page.has_content?('19143'))
94
94
 
95
- assert(page.has_content?('Visa'))
95
+ assert(page.has_content?('Test Card'))
96
96
 
97
97
  assert(page.has_content?(instruction))
98
98
 
@@ -79,7 +79,7 @@ module Workarea
79
79
  assert(page.has_content?('PA'))
80
80
  assert(page.has_content?('19143'))
81
81
 
82
- assert(page.has_content?('Visa'))
82
+ assert(page.has_content?('Test Card'))
83
83
  assert(page.has_content?('1111'))
84
84
 
85
85
  assert(page.has_content?(instruction))
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.license = 'Business Software License'
19
19
 
20
- s.add_dependency 'workarea', '~> 3.x', '>= 3.2.0'
20
+ s.add_dependency 'workarea', '>= 3.5.x'
21
21
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Yucis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-21 00:00:00.000000000 Z
11
+ date: 2019-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 3.x
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 3.2.0
19
+ version: 3.5.x
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: 3.x
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
- version: 3.2.0
26
+ version: 3.5.x
33
27
  description: Stripe payment processor integration for the Workarea Commerce Platform
34
28
  email:
35
29
  - jyucis@weblinc.com
@@ -38,11 +32,13 @@ extensions: []
38
32
  extra_rdoc_files: []
39
33
  files:
40
34
  - ".editorconfig"
41
- - ".eslintrc"
35
+ - ".eslintrc.json"
42
36
  - ".github/ISSUE_TEMPLATE/bug_report.md"
43
37
  - ".github/ISSUE_TEMPLATE/documentation-request.md"
44
38
  - ".github/ISSUE_TEMPLATE/feature_request.md"
39
+ - ".github/workflows/ci.yml"
45
40
  - ".gitignore"
41
+ - ".rubocop.yml"
46
42
  - CHANGELOG.md
47
43
  - CODE_OF_CONDUCT.md
48
44
  - CONTRIBUTING.md
@@ -136,7 +132,7 @@ files:
136
132
  - test/support/stripe_public_key.rb
137
133
  - test/system/workarea/storefront/analytics_system_test.decorator
138
134
  - test/system/workarea/storefront/credit_cards_system_test.decorator
139
- - test/system/workarea/storefront/digital_products_system_test.decorator
135
+ - test/system/workarea/storefront/download_system_test.decorator
140
136
  - test/system/workarea/storefront/guest_checkout_system_test.decorator
141
137
  - test/system/workarea/storefront/logged_in_checkout_system_test.decorator
142
138
  - test/system/workarea/storefront/no_js_system_test.decorator
@@ -164,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
160
  - !ruby/object:Gem::Version
165
161
  version: '0'
166
162
  requirements: []
167
- rubygems_version: 3.0.4
163
+ rubygems_version: 3.0.6
168
164
  signing_key:
169
165
  specification_version: 4
170
166
  summary: Stripe payment processor integration for the Workarea Commerce Platform
@@ -1,67 +0,0 @@
1
- decorate Workarea::Storefront::DigitalProductsSystemTest, with: :stripe do
2
- def fill_in_credit_card
3
- page.driver.browser.switch_to.frame "stripe-payment-frame"
4
-
5
- find('input[name="cardnumber"]').set('4111111111111111')
6
- find('input[name="exp-date"]').set('12/21')
7
- find('input[name="cvc"]').set('999')
8
- find('input[name="postal"]').set('19143')
9
-
10
- page.driver.browser.switch_to.default_content
11
- end
12
-
13
-
14
- def test_checking_out_with_a_digital_product
15
- setup_checkout_specs
16
-
17
- Workarea::Order.first.items.delete_all
18
-
19
- product = create_product(
20
- name: 'Digital Product',
21
- digital: true,
22
- variants: [
23
- { sku: 'SKU1', regular: 10.to_m },
24
- { sku: 'SKU2', regular: 15.to_m },
25
- { sku: 'SKU3', regular: 25.to_m }
26
- ]
27
- )
28
-
29
- visit storefront.product_path(product)
30
-
31
- within '.product-details__add-to-cart-form' do
32
- select product.skus.first, from: 'sku'
33
- click_button t('workarea.storefront.products.add_to_cart')
34
- end
35
-
36
- assert(page.has_content?('Success'))
37
-
38
- start_guest_checkout
39
-
40
- assert_current_path(storefront.checkout_addresses_path)
41
-
42
- fill_in_email
43
- fill_in_billing_address
44
- click_button t('workarea.storefront.checkouts.continue_to_payment')
45
-
46
- assert_current_path(storefront.checkout_payment_path)
47
- assert(page.has_content?('Success'))
48
-
49
- fill_in_credit_card
50
- click_button t('workarea.storefront.checkouts.place_order')
51
-
52
- assert_current_path(storefront.checkout_confirmation_path)
53
- assert(page.has_content?('Success'))
54
- assert(page.has_content?(t('workarea.storefront.flash_messages.order_placed')))
55
- assert(page.has_content?(Workarea::Order.first.id))
56
-
57
- assert(page.has_content?('1019 S. 47th St.'))
58
- assert(page.has_content?('Philadelphia'))
59
- assert(page.has_content?('PA'))
60
- assert(page.has_content?('19143'))
61
-
62
- assert(page.has_content?('Visa'))
63
-
64
- assert(page.has_content?('Digital Product'))
65
- assert(page.has_content?('$10.00'))
66
- end
67
- end