solidus_culqi 0.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +25 -36
- data/.travis.yml +10 -17
- data/Gemfile +8 -2
- data/Rakefile +2 -0
- data/app/models/concerns/solidus_culqi/inject_installments_concern.rb +3 -1
- data/app/models/concerns/solidus_culqi/permitted_attributes_concern.rb +2 -0
- data/app/models/payment_decorator.rb +5 -1
- data/app/models/permitted_attributes_decorator.rb +5 -1
- data/app/models/solidus/gateway/culqi_gateway.rb +18 -11
- data/bin/geckodriver +28 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20170919145201_add_installments_to_orders.rb +2 -0
- data/lib/generators/solidus_culqi/install/install_generator.rb +2 -0
- data/lib/solidus_culqi.rb +2 -1
- data/lib/solidus_culqi/engine.rb +3 -1
- data/lib/solidus_culqi/factories.rb +3 -1
- data/lib/solidus_culqi/support.rb +2 -0
- data/lib/solidus_culqi/version.rb +3 -1
- data/solidus_culqi.gemspec +7 -7
- data/spec/models/culqi_gateway_spec.rb +11 -0
- data/spec/spec_helper.rb +5 -31
- metadata +11 -79
- data/app/views/spree/checkout/existing_payment/_culqi.html.erb +0 -3
- data/app/views/spree/checkout/payment/_culqi.html.erb +0 -79
- data/lib/solidus_culqi/gateway.rb +0 -29
- data/spec/cassettes/Culqi_checkout/with_logged_user/store_card_in_wallet.yml +0 -206
- data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/capture_payment.yml +0 -207
- data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/process_order.yml +0 -156
- data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/voids_a_payment.yml +0 -207
- data/spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/can_process_a_valid_payment.yml +0 -156
- data/spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/refunds_a_payment.yml +0 -207
- data/spec/features/culqi_checkout_autocapture_spec.rb +0 -77
- data/spec/features/culqi_checkout_spec.rb +0 -94
- data/spec/models/culqi_gateway.rb +0 -16
- 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
|