workarea-usaepay 1.0.21 → 1.0.30

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: 868b271688ac51ed4a75ff587f9a5210e9095cdc7b9f8c7db7ff94b2200bb60e
4
+ data.tar.gz: ff7229d59c5d3cd7f160ed80833d74fd86b1440168c96d341d2d384d23945b44
5
5
  SHA512:
6
- metadata.gz: 9376dfb0e16915fd42602701317bc6d3c1b7af16f0f17b7e80caa0090bade1ae125b4501de930e2a4da7ab371dd6a73719d88dfd4029d5ff82703313bb92f462
7
- data.tar.gz: 301dd90cfd448817e19812d8d894974f739f666fbc8bce6d5d94b37d26804e9b13d7b6d7e4ba4ab317aa4aef413d4b35268adbba3cb0aa1cfd8f62024e2845de
6
+ metadata.gz: a7aef9df7848bce447fbdbc32d1a632e82d3d6ec92fc9d244e871bbb717fdf2199da0d004399e82667215c4d292d70242e6018412f7db0a55767050a9ec12b8a
7
+ data.tar.gz: d53368d878e5ee9c59f5c9e901eeaa122537e705dd86423aafe4633034e268e26805983c71182deafd42906e26ea0244987fb969f27a12843bd86c10b6876c3e
@@ -29,15 +29,9 @@ module Workarea
29
29
 
30
30
  def self.auto_initialize_gateway
31
31
  if credentials.present?
32
- # if ENV['HTTP_PROXY'].present?
33
- # uri = URI.parse(ENV['HTTP_PROXY'])
34
- # Workarea::UsaEpay::Gateway.proxy_address = uri.host
35
- # Workarea::UsaEpay::Gateway.proxy_port = uri.port
36
- # end
37
-
38
32
  self.gateway = ActiveMerchant::Billing::UsaEpayCustom.new credentials
39
33
  else
40
- self.gateway = ActiveMerchant::Billing::BogusCreditCardGateway.new
34
+ self.gateway = ActiveMerchant::Billing::BogusGateway.new
41
35
  end
42
36
  end
43
37
  end
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module Usaepay
3
- VERSION = "1.0.21".freeze
3
+ VERSION = "1.0.30".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
@@ -0,0 +1,64 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ decorate Storefront::CreditCardsSystemTest, with: :murals_your_way do
5
+ def test_managing_credit_cards
6
+ visit storefront.login_path
7
+
8
+ within '#login_form' do
9
+ fill_in 'email', with: 'bcrouse@workarea.com'
10
+ fill_in 'password', with: 'W3bl1nc!'
11
+ click_button t('workarea.storefront.users.login')
12
+ end
13
+
14
+ visit storefront.new_users_credit_card_path
15
+
16
+ within '#credit_card_form' do
17
+ fill_in 'credit_card[number]', with: '4111111111111111'
18
+ fill_in 'credit_card[first_name]', with: 'Ben'
19
+ fill_in 'credit_card[last_name]', with: 'Crouse'
20
+ select '1', from: 'credit_card[month]'
21
+ select @year, from: 'credit_card[year]'
22
+ fill_in 'credit_card[cvv]', with: '999'
23
+ click_button t('workarea.storefront.forms.save')
24
+ end
25
+
26
+ assert(page.has_content?('Success'))
27
+ assert(page.has_content?('ending in 1111'))
28
+ assert(page.has_content?('1'))
29
+ assert(page.has_content?(@year))
30
+
31
+ click_link t('workarea.storefront.forms.edit')
32
+
33
+ within '#credit_card_form' do
34
+ select '2', from: 'credit_card[month]'
35
+ fill_in 'credit_card[cvv]', with: '999'
36
+ click_button t('workarea.storefront.forms.save')
37
+ end
38
+
39
+ assert(page.has_content?('Success'))
40
+ assert(page.has_content?('ending in 1111'))
41
+ assert(page.has_content?('2'))
42
+ assert(page.has_content?(@year))
43
+
44
+ click_button t('workarea.storefront.forms.delete')
45
+
46
+ assert(page.has_no_content?('ending in 1111'))
47
+
48
+ visit storefront.new_users_credit_card_path
49
+
50
+ within '#credit_card_form' do
51
+ fill_in 'credit_card[number]', with: '40120000333304'
52
+ fill_in 'credit_card[first_name]', with: 'Ben'
53
+ fill_in 'credit_card[last_name]', with: 'Crouse'
54
+ select '1', from: 'credit_card[month]'
55
+ select @year, from: 'credit_card[year]'
56
+ fill_in 'credit_card[cvv]', with: '999'
57
+ click_button t('workarea.storefront.forms.save')
58
+ end
59
+
60
+ refute(page.has_content?('Success'))
61
+ assert(page.has_content?(I18n.t('workarea.payment.store_credit_card_failure')))
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,64 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ decorate Storefront::DownloadSystemTest, with: :murals_your_way do
5
+ def test_checking_out_with_downloadable_product
6
+ setup_checkout_specs
7
+
8
+ Order.first.items.delete_all
9
+
10
+ product = create_product(
11
+ name: 'Digital Product',
12
+ variants: [
13
+ { sku: 'SKU1', regular: 10.to_m, tax_code: '001' },
14
+ { sku: 'SKU2', regular: 15.to_m, tax_code: '001' }
15
+ ]
16
+ )
17
+
18
+ create_fulfillment_sku(id: 'SKU1', policy: :download, file: product_image_file)
19
+ create_fulfillment_sku(id: 'SKU2', policy: :download, file: product_image_file)
20
+
21
+ visit storefront.product_path(product)
22
+
23
+ within '.product-details__add-to-cart-form' do
24
+ select product.skus.first, from: 'sku'
25
+ click_button t('workarea.storefront.products.add_to_cart')
26
+ end
27
+
28
+ assert(page.has_content?('Success'))
29
+
30
+ start_guest_checkout
31
+
32
+ assert_current_path(storefront.checkout_addresses_path)
33
+
34
+ fill_in_email
35
+ fill_in_billing_address
36
+ click_button t('workarea.storefront.checkouts.continue_to_payment')
37
+
38
+ assert_current_path(storefront.checkout_payment_path)
39
+ assert(page.has_content?('Success'))
40
+
41
+ fill_in_credit_card
42
+ click_button t('workarea.storefront.checkouts.place_order')
43
+
44
+ assert_current_path(storefront.checkout_confirmation_path)
45
+ assert(page.has_content?('Success'))
46
+ assert(page.has_content?(t('workarea.storefront.flash_messages.order_placed')))
47
+ assert(page.has_content?(Order.first.id))
48
+
49
+ assert(page.has_content?('1019 S. 47th St.'))
50
+ assert(page.has_content?('Philadelphia'))
51
+ assert(page.has_content?('PA'))
52
+ assert(page.has_content?('19143'))
53
+
54
+ assert(page.has_content?('Visa'))
55
+ assert(page.has_content?('1111'))
56
+
57
+ assert(page.has_content?('Digital Product'))
58
+ assert(page.has_content?('10.00'))
59
+ assert(page.has_content?('0.70'))
60
+ assert(page.has_content?('10.70'))
61
+ assert(page.has_content?(t('workarea.storefront.orders.download')))
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ decorate Storefront::GuestCheckoutSystemTest, with: :murals_your_way do
5
+ def test_creating_an_account
6
+ assert_current_path(storefront.checkout_addresses_path)
7
+ fill_in_email
8
+ fill_in_shipping_address
9
+ uncheck 'same_as_shipping'
10
+ fill_in_billing_address
11
+ click_button t('workarea.storefront.checkouts.continue_to_shipping')
12
+
13
+ assert_current_path(storefront.checkout_shipping_path)
14
+ assert(page.has_content?('Success'))
15
+ click_button t('workarea.storefront.checkouts.continue_to_payment')
16
+
17
+ assert_current_path(storefront.checkout_payment_path)
18
+ assert(page.has_content?('Success'))
19
+ fill_in_credit_card
20
+ click_button t('workarea.storefront.checkouts.place_order')
21
+
22
+ assert_current_path(storefront.checkout_confirmation_path)
23
+ fill_in 'password', with: 'W3bl1nc!'
24
+ check 'email_signup'
25
+ click_button t('workarea.storefront.users.create_account')
26
+
27
+ assert_current_path(storefront.users_account_path)
28
+
29
+ assert(page.has_content?('Success'))
30
+ assert(page.has_content?('Ben'))
31
+ assert(page.has_content?('Crouse'))
32
+ assert(page.has_content?(Order.first.id))
33
+ assert(page.has_content?('22 S. 3rd St.'))
34
+ assert(page.has_content?('1019 S. 47th St.'))
35
+ assert(page.has_content?('1111'))
36
+ end
37
+ end
38
+ 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.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gunasekaran.Raja
@@ -103,6 +103,11 @@ 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/accounts/credit_cards_system_test.decorator
108
+ - test/system/workarea/storefront/credit_cards_system_test.decorator
109
+ - test/system/workarea/storefront/download_system_test.decorator
110
+ - test/system/workarea/storefront/guest_checkout_system_test.decorator
106
111
  - test/teaspoon_env.rb
107
112
  - test/test_helper.rb
108
113
  - workarea-usaepay.gemspec