solidus_culqi 0.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +25 -36
  3. data/.travis.yml +10 -17
  4. data/Gemfile +8 -2
  5. data/Rakefile +2 -0
  6. data/app/models/concerns/solidus_culqi/inject_installments_concern.rb +3 -1
  7. data/app/models/concerns/solidus_culqi/permitted_attributes_concern.rb +2 -0
  8. data/app/models/payment_decorator.rb +5 -1
  9. data/app/models/permitted_attributes_decorator.rb +5 -1
  10. data/app/models/solidus/gateway/culqi_gateway.rb +18 -11
  11. data/bin/geckodriver +28 -0
  12. data/config/routes.rb +2 -0
  13. data/db/migrate/20170919145201_add_installments_to_orders.rb +2 -0
  14. data/lib/generators/solidus_culqi/install/install_generator.rb +2 -0
  15. data/lib/solidus_culqi.rb +2 -1
  16. data/lib/solidus_culqi/engine.rb +3 -1
  17. data/lib/solidus_culqi/factories.rb +3 -1
  18. data/lib/solidus_culqi/support.rb +2 -0
  19. data/lib/solidus_culqi/version.rb +3 -1
  20. data/solidus_culqi.gemspec +7 -7
  21. data/spec/models/culqi_gateway_spec.rb +11 -0
  22. data/spec/spec_helper.rb +5 -31
  23. metadata +11 -79
  24. data/app/views/spree/checkout/existing_payment/_culqi.html.erb +0 -3
  25. data/app/views/spree/checkout/payment/_culqi.html.erb +0 -79
  26. data/lib/solidus_culqi/gateway.rb +0 -29
  27. data/spec/cassettes/Culqi_checkout/with_logged_user/store_card_in_wallet.yml +0 -206
  28. data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/capture_payment.yml +0 -207
  29. data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/process_order.yml +0 -156
  30. data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/voids_a_payment.yml +0 -207
  31. data/spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/can_process_a_valid_payment.yml +0 -156
  32. data/spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/refunds_a_payment.yml +0 -207
  33. data/spec/features/culqi_checkout_autocapture_spec.rb +0 -77
  34. data/spec/features/culqi_checkout_spec.rb +0 -94
  35. data/spec/models/culqi_gateway.rb +0 -16
  36. data/spec/support/culqi_helper.rb +0 -51
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Solidus::Gateway::CulqiGateway, type: :model do
4
- let!(:gateway) { described_class.new }
5
-
6
- context new_gateway: true do
7
- it { gateway.respond_to?(:partial_name) }
8
- it { expect(gateway.partial_name).to eq('culqi') }
9
- it { expect(gateway.gateway_class).to eq(Solidus::Gateway::CulqiGateway) }
10
- end
11
-
12
- context old_gateway: true do
13
- it { expect(gateway.method_type).to eq('culqi') }
14
- it { expect(gateway.provider_class).to eq(Solidus::Gateway::CulqiGateway) }
15
- end
16
- end
@@ -1,51 +0,0 @@
1
- require "spec_helper"
2
-
3
- module CulqiHelper
4
- def setup_culqi_gateway
5
- Solidus::Gateway::CulqiGateway.create!(
6
- name: "Culqi",
7
- preferred_secret_key: "sk_test_SpwICNI4YT0OSLHY",
8
- preferred_public_key: "pk_test_CaY0noGVG8ohIj4P"
9
- )
10
- end
11
-
12
- def checkout_until_payment(product, user = nil)
13
- visit spree.product_path(product)
14
- click_button "Add To Cart"
15
-
16
- expect(page).to have_current_path("/cart")
17
- click_button "Checkout"
18
-
19
- # Address
20
- if user
21
- expect(page).to have_current_path("/checkout/address")
22
- else
23
- within("#guest_checkout") do
24
- find('#order_email')
25
- fill_in "Email", with: "han@example.com"
26
- click_button "Continue"
27
- end
28
- expect(page).to have_current_path("/checkout")
29
- end
30
-
31
- country = Spree::Country.first
32
- within("#billing") do
33
- fill_in "First Name", with: "Han"
34
- fill_in "Last Name", with: "Solo"
35
- fill_in "Street Address", with: "YT-1300"
36
- fill_in "City", with: "Mos Eisley"
37
- select "United States of America", from: "Country"
38
- select country.states.first, from: "order_bill_address_attributes_state_id"
39
- fill_in "Zip", with: "12010"
40
- fill_in "Phone", with: "(555) 555-5555"
41
- end
42
- click_on "Save and Continue"
43
-
44
- # Delivery
45
- expect(page).to have_current_path("/checkout/delivery")
46
- # expect(page).to have_content("UPS Ground")
47
- click_on "Save and Continue"
48
-
49
- expect(page).to have_current_path("/checkout/payment")
50
- end
51
- end