solidus_culqi 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.travis.yml +2 -2
- data/Gemfile +6 -5
- data/README.md +7 -0
- data/app/models/solidus/gateway/culqi_gateway.rb +63 -19
- data/app/views/spree/checkout/existing_payment/_culqi.html.erb +3 -0
- data/db/migrate/20170919145201_add_installments_to_orders.rb +1 -1
- data/lib/solidus_culqi/gateway.rb +29 -0
- data/lib/solidus_culqi/support.rb +7 -0
- data/lib/solidus_culqi/version.rb +1 -1
- data/lib/solidus_culqi.rb +2 -0
- data/solidus_culqi.gemspec +2 -0
- data/spec/cassettes/Culqi_checkout/with_logged_user/store_card_in_wallet.yml +206 -0
- data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/capture_payment.yml +207 -0
- data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/process_order.yml +156 -0
- data/spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/voids_a_payment.yml +207 -0
- data/spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/can_process_a_valid_payment.yml +156 -0
- data/spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/refunds_a_payment.yml +207 -0
- data/spec/features/culqi_checkout_autocapture_spec.rb +8 -8
- data/spec/features/culqi_checkout_spec.rb +71 -27
- data/spec/models/culqi_gateway.rb +16 -0
- data/spec/spec_helper.rb +16 -1
- data/spec/support/culqi_helper.rb +14 -6
- metadata +40 -2
@@ -9,16 +9,24 @@ module CulqiHelper
|
|
9
9
|
)
|
10
10
|
end
|
11
11
|
|
12
|
-
def checkout_until_payment
|
12
|
+
def checkout_until_payment(product, user = nil)
|
13
13
|
visit spree.product_path(product)
|
14
14
|
click_button "Add To Cart"
|
15
15
|
|
16
|
-
|
16
|
+
expect(page).to have_current_path("/cart")
|
17
17
|
click_button "Checkout"
|
18
18
|
|
19
19
|
# Address
|
20
|
-
|
21
|
-
|
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
|
22
30
|
|
23
31
|
country = Spree::Country.first
|
24
32
|
within("#billing") do
|
@@ -34,10 +42,10 @@ module CulqiHelper
|
|
34
42
|
click_on "Save and Continue"
|
35
43
|
|
36
44
|
# Delivery
|
37
|
-
|
45
|
+
expect(page).to have_current_path("/checkout/delivery")
|
38
46
|
# expect(page).to have_content("UPS Ground")
|
39
47
|
click_on "Save and Continue"
|
40
48
|
|
41
|
-
|
49
|
+
expect(page).to have_current_path("/checkout/payment")
|
42
50
|
end
|
43
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_culqi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- César Carruitero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -178,6 +178,34 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: vcr
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: webmock
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
181
209
|
description: Adds solidus support for Culqi Gateway
|
182
210
|
email: ccarruitero@protonmail.com
|
183
211
|
executables: []
|
@@ -197,6 +225,7 @@ files:
|
|
197
225
|
- app/models/payment_decorator.rb
|
198
226
|
- app/models/permitted_attributes_decorator.rb
|
199
227
|
- app/models/solidus/gateway/culqi_gateway.rb
|
228
|
+
- app/views/spree/checkout/existing_payment/_culqi.html.erb
|
200
229
|
- app/views/spree/checkout/payment/_culqi.html.erb
|
201
230
|
- bin/rails
|
202
231
|
- config/locales/en.yml
|
@@ -206,10 +235,19 @@ files:
|
|
206
235
|
- lib/solidus_culqi.rb
|
207
236
|
- lib/solidus_culqi/engine.rb
|
208
237
|
- lib/solidus_culqi/factories.rb
|
238
|
+
- lib/solidus_culqi/gateway.rb
|
239
|
+
- lib/solidus_culqi/support.rb
|
209
240
|
- lib/solidus_culqi/version.rb
|
210
241
|
- solidus_culqi.gemspec
|
242
|
+
- spec/cassettes/Culqi_checkout/with_logged_user/store_card_in_wallet.yml
|
243
|
+
- spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/capture_payment.yml
|
244
|
+
- spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/process_order.yml
|
245
|
+
- spec/cassettes/Culqi_checkout/with_unlogged_user/with_process_checkout/voids_a_payment.yml
|
246
|
+
- spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/can_process_a_valid_payment.yml
|
247
|
+
- spec/cassettes/Culqi_checkout_autocapture/with_valid_credit_card/refunds_a_payment.yml
|
211
248
|
- spec/features/culqi_checkout_autocapture_spec.rb
|
212
249
|
- spec/features/culqi_checkout_spec.rb
|
250
|
+
- spec/models/culqi_gateway.rb
|
213
251
|
- spec/spec_helper.rb
|
214
252
|
- spec/support/culqi_helper.rb
|
215
253
|
homepage: https://github.com/ccarruitero/solidus_culqi
|