workarea-usaepay 1.0.21 → 1.0.22

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: f4ba32c1f7f9c78175736c94c6f38e3703687c5e1b28f268005f1100872db839
4
- data.tar.gz: 9cbfc7ab31a84fcbec6c96ee03db6262386ab7402e5ccb2a52ab683580db75b9
3
+ metadata.gz: cd74aabd2817a36fc049cc39de11dccf99bc3c5f454e875bff188ba6f9b025e2
4
+ data.tar.gz: 4884322299c4c860bdd41a15bdc7fde298c17a2491ba148b5a27ae5ae3400900
5
5
  SHA512:
6
- metadata.gz: 9376dfb0e16915fd42602701317bc6d3c1b7af16f0f17b7e80caa0090bade1ae125b4501de930e2a4da7ab371dd6a73719d88dfd4029d5ff82703313bb92f462
7
- data.tar.gz: 301dd90cfd448817e19812d8d894974f739f666fbc8bce6d5d94b37d26804e9b13d7b6d7e4ba4ab317aa4aef413d4b35268adbba3cb0aa1cfd8f62024e2845de
6
+ metadata.gz: 331216b24e79bdf8c3c756e5452642e6701359c25324e30d35ff335ee57348fb9278502e89c1f5497055c9dec0a9538ddc20c3f5c6be8ae95ffb214612db0666
7
+ data.tar.gz: d5d0f182935bd9f05f958818caf8437f8cfd4adcb6d2ef5883ab6be8394e69d37a0539652dce516a19a9eee6d5b59e02ec2a45105076a85dc78d26faf44fdda9
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module Usaepay
3
- VERSION = "1.0.21".freeze
3
+ VERSION = "1.0.22".freeze
4
4
  end
5
5
  end
@@ -2,14 +2,15 @@ module Workarea
2
2
  decorate Payment::Authorize::CreditCardTest, with: :usaepay_transaction do #[8]
3
3
  decorated { include UsaepayTransactionVcrGateway } #[9]
4
4
 
5
- # [10]
6
- #
7
- # def test_foo
8
- # VCR.use_cassette 'credit_card_gateway/foo' do
9
- # super
10
- # end
11
- # end
12
- #
13
- # ...
5
+ def test_complete_sets_the_response_on_the_transaction
6
+ VCR.use_cassette 'credit_card/store_auth' do
7
+ operation = Payment::Authorize::CreditCard.new(tender, transaction)
8
+ operation.complete!
9
+ assert_instance_of(
10
+ ActiveMerchant::Billing::Response,
11
+ transaction.response
12
+ )
13
+ end
14
+ end
14
15
  end
15
16
  end
@@ -0,0 +1,42 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ decorate Admin::PaymentTransactionsSystemTest, with: :murals_your_way do
5
+ def test_viewing_transactions
6
+ Workarea.config.checkout_payment_action = {
7
+ shipping: 'authorize!',
8
+ partial_shipping: 'authorize!',
9
+ no_shipping: 'authorize!'
10
+ }
11
+
12
+ order = create_placed_order(id: 'FOO')
13
+ payment = Payment.find(order.id)
14
+ auth = payment.credit_card.transactions.first
15
+ capture = payment.credit_card.build_transaction(
16
+ action: 'capture',
17
+ amount: auth.amount,
18
+ reference: auth
19
+ )
20
+ capture.complete!
21
+
22
+ visit admin.payment_transactions_path
23
+
24
+ click_button 'Transaction'
25
+ assert(page.has_content?('Authorize (1)'))
26
+ assert(page.has_content?('Capture (1)'))
27
+ click_button 'Transaction' # closes filter dropdown
28
+
29
+ click_button 'Auth Status'
30
+ assert(page.has_content?('Captured (1)'))
31
+
32
+ visit admin.payment_transactions_path
33
+ click_link 'Authorize', match: :first
34
+
35
+ assert(page.has_content?('Transaction'))
36
+ assert(page.has_content?('Credit Card'))
37
+ assert(page.has_content?("#{Money.default_currency.symbol}11.00"))
38
+ assert(page.has_content?('Success'))
39
+ assert(page.has_content?('Capture'))
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,58 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ decorate Storefront::Accounts::CreditCardsSystemTest, with: :murals_your_way do
5
+ def test_managing_credit_cards
6
+ visit storefront.accounts_path
7
+
8
+ click_link t('workarea.storefront.users.add_credit_card')
9
+
10
+ within '#credit_card_form' do
11
+ fill_in 'credit_card[number]', with: '4111111111111111'
12
+ fill_in 'credit_card[first_name]', with: 'Ben'
13
+ fill_in 'credit_card[last_name]', with: 'Crouse'
14
+ select '1', from: 'credit_card[month]'
15
+ select @year, from: 'credit_card[year]'
16
+ fill_in 'credit_card[cvv]', with: '999'
17
+ click_button t('workarea.storefront.forms.save')
18
+ end
19
+
20
+ assert(page.has_content?('Success'))
21
+ assert(page.has_content?('ending in 1111'))
22
+ assert(page.has_content?('1'))
23
+ assert(page.has_content?(@year))
24
+
25
+ click_link t('workarea.storefront.forms.edit')
26
+
27
+ within '#credit_card_form' do
28
+ select '2', from: 'credit_card[month]'
29
+ fill_in 'credit_card[cvv]', with: '999'
30
+ click_button t('workarea.storefront.forms.save')
31
+ end
32
+
33
+ assert(page.has_content?('Success'))
34
+ assert(page.has_content?('ending in 1111'))
35
+ assert(page.has_content?('2'))
36
+ assert(page.has_content?(@year))
37
+
38
+ click_button t('workarea.storefront.forms.delete')
39
+
40
+ assert(page.has_no_content?('ending in 1111'))
41
+
42
+ visit storefront.new_users_credit_card_path
43
+
44
+ within '#credit_card_form' do
45
+ fill_in 'credit_card[number]', with: '401200003333042211'
46
+ fill_in 'credit_card[first_name]', with: 'Ben'
47
+ fill_in 'credit_card[last_name]', with: 'Crouse'
48
+ select '1', from: 'credit_card[month]'
49
+ select @year, from: 'credit_card[year]'
50
+ fill_in 'credit_card[cvv]', with: '999'
51
+ click_button t('workarea.storefront.forms.save')
52
+ end
53
+
54
+ refute(page.has_content?('Success'))
55
+ assert(page.has_content?(I18n.t('workarea.payment.store_credit_card_failure')))
56
+ end
57
+ end
58
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-usaepay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.21
4
+ version: 1.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gunasekaran.Raja
@@ -103,6 +103,8 @@ files:
103
103
  - test/models/workarea/payment/authorize/credit_card_test.decorator
104
104
  - test/models/workarea/payment/credit_card_integration_test.decorator
105
105
  - test/support/workarea/usaepay_transaction_vcr_gateway.rb
106
+ - test/system/workarea/admin/payment_transactions_system_test.decorator
107
+ - test/system/workarea/storefront/account/credit_cards_system_test.decorator
106
108
  - test/teaspoon_env.rb
107
109
  - test/test_helper.rb
108
110
  - workarea-usaepay.gemspec