solidus_stripe 3.2.1 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +5 -0
- data/.gem_release.yml +1 -1
- data/.github/stale.yml +4 -4
- data/.github_changelog_generator +2 -0
- data/.gitignore +4 -2
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +121 -3
- data/Gemfile +10 -9
- data/LICENSE +2 -1
- data/README.md +77 -54
- data/Rakefile +1 -1
- data/app/assets/javascripts/spree/frontend/solidus_stripe/stripe-cart-page-checkout.js +43 -9
- data/app/assets/javascripts/spree/frontend/solidus_stripe/stripe-payment-intents.js +2 -2
- data/app/assets/javascripts/spree/frontend/solidus_stripe/stripe-payment-request-button-shared.js +58 -21
- data/app/controllers/solidus_stripe/intents_controller.rb +23 -18
- data/app/controllers/solidus_stripe/payment_request_controller.rb +11 -1
- data/app/decorators/models/spree/refund_decorator.rb +9 -0
- data/app/models/solidus_stripe/address_from_params_service.rb +25 -10
- data/app/models/solidus_stripe/create_intents_payment_service.rb +114 -0
- data/app/models/spree/payment_method/stripe_credit_card.rb +38 -1
- data/bin/r +13 -0
- data/bin/rails +4 -12
- data/bin/rails-engine +13 -0
- data/bin/rails-sandbox +16 -0
- data/bin/rake +7 -0
- data/bin/sandbox +86 -0
- data/bin/sandbox_rails +18 -0
- data/bin/setup +1 -1
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +4 -1
- data/lib/generators/solidus_stripe/install/install_generator.rb +4 -4
- data/lib/solidus_stripe/configuration.rb +21 -0
- data/lib/solidus_stripe/engine.rb +5 -16
- data/lib/solidus_stripe/testing_support/card_input_helper.rb +34 -0
- data/lib/solidus_stripe/testing_support/factories.rb +4 -0
- data/lib/solidus_stripe/version.rb +1 -1
- data/lib/solidus_stripe.rb +5 -5
- data/lib/views/frontend/spree/checkout/payment/v2/_javascript.html.erb +1 -1
- data/lib/views/frontend/spree/checkout/payment/v3/_form_elements.html.erb +2 -2
- data/solidus_stripe.gemspec +34 -37
- data/spec/features/stripe_checkout_spec.rb +118 -147
- data/spec/models/solidus_stripe/address_from_params_service_spec.rb +35 -10
- data/spec/models/solidus_stripe/create_intents_payment_service_spec.rb +127 -0
- data/spec/models/spree/payment_method/stripe_credit_card_spec.rb +73 -1
- data/spec/requests/payment_requests_spec.rb +152 -0
- data/spec/spec_helper.rb +17 -3
- data/spec/support/solidus_address_helper.rb +2 -2
- metadata +39 -24
- data/LICENSE.md +0 -26
- data/app/models/solidus_stripe/create_intents_order_service.rb +0 -70
@@ -14,7 +14,8 @@ RSpec.describe SolidusStripe::AddressFromParamsService do
|
|
14
14
|
recipient: 'Clark Kent',
|
15
15
|
city: 'Metropolis',
|
16
16
|
postalCode: '12345',
|
17
|
-
addressLine: [ '12, Lincoln Rd']
|
17
|
+
addressLine: [ '12, Lincoln Rd'],
|
18
|
+
phone: '555-555-0199'
|
18
19
|
}
|
19
20
|
end
|
20
21
|
|
@@ -33,14 +34,26 @@ RSpec.describe SolidusStripe::AddressFromParamsService do
|
|
33
34
|
|
34
35
|
context "when the user has an address compatible with the params" do
|
35
36
|
before do
|
36
|
-
|
37
|
-
|
37
|
+
name_attributes = if SolidusSupport.combined_first_and_last_name_in_address?
|
38
|
+
{
|
39
|
+
name: 'Clark Kent'
|
40
|
+
}
|
41
|
+
else
|
42
|
+
{
|
43
|
+
firstname: 'Clark',
|
44
|
+
lastname: 'Kent',
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
address_attributes = {
|
49
|
+
city: params[:city],
|
38
50
|
zipcode: params[:postalCode],
|
39
|
-
firstname: 'Clark',
|
40
|
-
lastname: 'Kent',
|
41
51
|
address1: params[:addressLine].first,
|
42
|
-
address2: nil
|
43
|
-
|
52
|
+
address2: nil,
|
53
|
+
phone: '555-555-0199',
|
54
|
+
}.merge!(name_attributes)
|
55
|
+
|
56
|
+
user.addresses << create(:address, address_attributes)
|
44
57
|
end
|
45
58
|
|
46
59
|
it "returns an existing user's address" do
|
@@ -50,11 +63,23 @@ RSpec.describe SolidusStripe::AddressFromParamsService do
|
|
50
63
|
|
51
64
|
context "when no user's address is compatible with the params" do
|
52
65
|
before do
|
53
|
-
user.addresses << create(:address)
|
66
|
+
user.addresses << create(:address, state: state)
|
54
67
|
end
|
55
68
|
|
56
|
-
it "returns a non-persisted address
|
57
|
-
|
69
|
+
it "returns a non-persisted valid address" do
|
70
|
+
aggregate_failures do
|
71
|
+
expect(subject).to be_new_record
|
72
|
+
expect(subject).to be_valid
|
73
|
+
expect(subject.state).to eq state
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context "when the region is the state name" do
|
78
|
+
before { params[:region] = state.name }
|
79
|
+
|
80
|
+
it "still can set the address state attribute" do
|
81
|
+
expect(subject.state).to eq state
|
82
|
+
end
|
58
83
|
end
|
59
84
|
end
|
60
85
|
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe SolidusStripe::CreateIntentsPaymentService do
|
6
|
+
let(:service) { described_class.new(intent_id, stripe, controller) }
|
7
|
+
|
8
|
+
let(:stripe) {
|
9
|
+
Spree::PaymentMethod::StripeCreditCard.create!(
|
10
|
+
name: "Stripe",
|
11
|
+
preferred_secret_key: "sk_test_VCZnDv3GLU15TRvn8i2EsaAN",
|
12
|
+
preferred_publishable_key: "pk_test_Cuf0PNtiAkkMpTVC2gwYDMIg",
|
13
|
+
preferred_v3_elements: false,
|
14
|
+
preferred_v3_intents: true
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
let(:order) { create :order, state: :payment, total: 19.99 }
|
19
|
+
|
20
|
+
let(:intent_id) { "pi_123123ABC" }
|
21
|
+
let(:controller) { double(current_order: order.reload, params: params, request: spy) }
|
22
|
+
|
23
|
+
let(:params) do
|
24
|
+
{
|
25
|
+
spree_payment_method_id: stripe.id,
|
26
|
+
stripe_payment_intent_id: intent_id,
|
27
|
+
form_data: {
|
28
|
+
addressLine: ["31 Cotton Rd"],
|
29
|
+
city: "San Diego",
|
30
|
+
country: "US",
|
31
|
+
phone: "+188836412312",
|
32
|
+
postalCode: "12345",
|
33
|
+
recipient: "James Edwards",
|
34
|
+
region: "CA"
|
35
|
+
}
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
let(:intent) do
|
40
|
+
double(params: {
|
41
|
+
"id" => intent_id,
|
42
|
+
"charges" => {
|
43
|
+
"data" => [{
|
44
|
+
"billing_details" => {
|
45
|
+
"name" => "John Doe"
|
46
|
+
},
|
47
|
+
"payment_method_details" => {
|
48
|
+
"card" => {
|
49
|
+
"brand" => "visa",
|
50
|
+
"exp_month" => 1,
|
51
|
+
"exp_year" => 2022,
|
52
|
+
"last4" => "4242"
|
53
|
+
},
|
54
|
+
}
|
55
|
+
}]
|
56
|
+
}
|
57
|
+
})
|
58
|
+
end
|
59
|
+
|
60
|
+
describe '#call' do
|
61
|
+
subject { service.call }
|
62
|
+
|
63
|
+
before do
|
64
|
+
allow(stripe).to receive(:show_intent) { intent }
|
65
|
+
allow_any_instance_of(Spree::CreditCard).to receive(:require_card_numbers?) { false }
|
66
|
+
allow_any_instance_of(Spree::PaymentMethod::StripeCreditCard).to receive(:create_profile) { true }
|
67
|
+
end
|
68
|
+
|
69
|
+
it { expect(subject).to be true }
|
70
|
+
|
71
|
+
it "creates a new pending payment" do
|
72
|
+
expect { subject }.to change { order.payments.count }
|
73
|
+
expect(order.payments.last.reload).to be_pending
|
74
|
+
end
|
75
|
+
|
76
|
+
it "creates a credit card with the correct information" do
|
77
|
+
expect { subject }.to change { Spree::CreditCard.count }
|
78
|
+
card = Spree::CreditCard.last
|
79
|
+
|
80
|
+
aggregate_failures do
|
81
|
+
expect(card.name).to eq "John Doe"
|
82
|
+
expect(card.cc_type).to eq "visa"
|
83
|
+
expect(card.month).to eq "1"
|
84
|
+
expect(card.year).to eq "2022"
|
85
|
+
expect(card.last_digits).to eq "4242"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context "when for any reason the payment could not be created" do
|
90
|
+
before { params[:form_data].delete(:city) }
|
91
|
+
|
92
|
+
it "returns false" do
|
93
|
+
expect(subject).to be false
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
context "when there are previous pending payments" do
|
98
|
+
let!(:payment) do
|
99
|
+
create(:payment, order: order, amount: order.total).tap do |payment|
|
100
|
+
payment.update!(state: :pending)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
before do
|
105
|
+
response = double(success?: true, authorization: payment.response_code)
|
106
|
+
allow_any_instance_of(Spree::PaymentMethod::StripeCreditCard).to receive(:void) { response }
|
107
|
+
end
|
108
|
+
|
109
|
+
context "when one of them is a Payment Intent" do
|
110
|
+
before do
|
111
|
+
payment.update!(payment_method: stripe)
|
112
|
+
payment.source.update!(payment_method: stripe)
|
113
|
+
end
|
114
|
+
|
115
|
+
it "invalidates it" do
|
116
|
+
expect { subject }.to change { payment.reload.state }.to 'void'
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
context "when none is a Payment Intent" do
|
121
|
+
it "does not invalidate them" do
|
122
|
+
expect { subject }.not_to change { payment.reload.state }
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -22,7 +22,8 @@ describe Spree::PaymentMethod::StripeCreditCard do
|
|
22
22
|
let(:payment) {
|
23
23
|
double('Spree::Payment',
|
24
24
|
source: source,
|
25
|
-
order: order
|
25
|
+
order: order,
|
26
|
+
amount: order.total
|
26
27
|
)
|
27
28
|
}
|
28
29
|
|
@@ -241,4 +242,75 @@ describe Spree::PaymentMethod::StripeCreditCard do
|
|
241
242
|
expect(gateway).to receive(:capture).with(9855, '12345', anything).and_return(success_response)
|
242
243
|
end
|
243
244
|
end
|
245
|
+
|
246
|
+
describe '#try_void' do
|
247
|
+
let(:payment) { create :payment, amount: order.total }
|
248
|
+
|
249
|
+
shared_examples 'voids the payment transaction' do
|
250
|
+
it 'voids the payment transaction' do
|
251
|
+
expect(gateway).to receive(:void)
|
252
|
+
|
253
|
+
subject.try_void(payment)
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
context 'when using Payment Intents' do
|
258
|
+
before { subject.preferred_v3_intents = true }
|
259
|
+
|
260
|
+
context 'when the payment is completed' do
|
261
|
+
before do
|
262
|
+
allow(payment).to receive(:completed?) { true }
|
263
|
+
end
|
264
|
+
|
265
|
+
it 'creates a refund' do
|
266
|
+
expect { subject.try_void(payment) }.to change { Spree::Refund.count }.by(1)
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
context 'when the payment is not completed' do
|
271
|
+
it_behaves_like 'voids the payment transaction'
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
context 'when not using Payment Intents' do
|
276
|
+
before { subject.preferred_v3_intents = false }
|
277
|
+
|
278
|
+
context 'when the payment is completed' do
|
279
|
+
it_behaves_like 'voids the payment transaction'
|
280
|
+
end
|
281
|
+
|
282
|
+
context 'when the payment is not completed' do
|
283
|
+
it_behaves_like 'voids the payment transaction'
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
describe '#options_for_purchase_or_auth' do
|
289
|
+
let(:card) do
|
290
|
+
FactoryBot.create(
|
291
|
+
:credit_card,
|
292
|
+
gateway_customer_profile_id: 'cus_abcde',
|
293
|
+
imported: false
|
294
|
+
)
|
295
|
+
end
|
296
|
+
|
297
|
+
before do
|
298
|
+
allow(subject).to receive(:options_for_purchase_or_auth).and_call_original
|
299
|
+
end
|
300
|
+
|
301
|
+
context 'transaction_options' do
|
302
|
+
it 'includes basic values and keys' do
|
303
|
+
options = subject.send(:options_for_purchase_or_auth, 19.99, card, {})
|
304
|
+
expect(options[0]).to eq(19.99)
|
305
|
+
expect(options[1]).to eq(card)
|
306
|
+
expect(options[2].keys).to eq([:description, :currency, :customer])
|
307
|
+
end
|
308
|
+
|
309
|
+
it 'includes statement_descriptor_suffix within options' do
|
310
|
+
transaction_options = { statement_descriptor_suffix: 'FFFFFFF' }
|
311
|
+
options = subject.send(:options_for_purchase_or_auth, 19.99, card, transaction_options)
|
312
|
+
expect(options.last[:statement_descriptor_suffix]).to eq('FFFFFFF')
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
244
316
|
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "Payment Request", type: :request do
|
6
|
+
describe "POST /stripe/update_order" do
|
7
|
+
it "responds with { success: true } when the order is correctly updated" do
|
8
|
+
order = create(:order_ready_to_complete)
|
9
|
+
allow_any_instance_of(SolidusStripe::PaymentRequestController).to receive(:current_order).and_return(order)
|
10
|
+
|
11
|
+
with_disabled_forgery_protection do
|
12
|
+
post "/stripe/update_order", params: stripe_update_request_params(order: order)
|
13
|
+
end
|
14
|
+
|
15
|
+
json = JSON.parse(response.body)
|
16
|
+
expect(json["success"]).to be_truthy
|
17
|
+
end
|
18
|
+
|
19
|
+
context "when phone number is provided as param and already set on the address" do
|
20
|
+
it "overrides the address field" do
|
21
|
+
order = create(:order_ready_to_complete)
|
22
|
+
allow_any_instance_of(SolidusStripe::PaymentRequestController).to receive(:current_order).and_return(order)
|
23
|
+
|
24
|
+
expect {
|
25
|
+
with_disabled_forgery_protection do
|
26
|
+
post "/stripe/update_order", params: stripe_update_request_params(order: order, shipping_address: default_shipping_address(phone: nil), phone: '911')
|
27
|
+
end
|
28
|
+
}.to change { order.shipping_address.phone }.to('911')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when phone number is provided both as shipping address param and main param, and already set on the address" do
|
33
|
+
it "overrides the address field giving precedence to the shipping address param" do
|
34
|
+
order = create(:order_ready_to_complete)
|
35
|
+
allow_any_instance_of(SolidusStripe::PaymentRequestController).to receive(:current_order).and_return(order)
|
36
|
+
|
37
|
+
expect {
|
38
|
+
with_disabled_forgery_protection do
|
39
|
+
post "/stripe/update_order", params: stripe_update_request_params(order: order, shipping_address: default_shipping_address(phone: '555'), phone: '911')
|
40
|
+
end
|
41
|
+
}.to change { order.shipping_address.phone }.to('555')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context "when phone number is not required, not provided as param and not set on the shipping address" do
|
46
|
+
it "does not populate the address field" do
|
47
|
+
with_address_phone_not_required
|
48
|
+
order = create(:order_ready_to_complete, shipping_address: create(:address, phone: nil))
|
49
|
+
allow_any_instance_of(SolidusStripe::PaymentRequestController).to receive(:current_order).and_return(order)
|
50
|
+
|
51
|
+
expect {
|
52
|
+
with_disabled_forgery_protection do
|
53
|
+
post "/stripe/update_order", params: stripe_update_request_params(order: order, shipping_address: default_shipping_address(phone: nil), phone: nil)
|
54
|
+
end
|
55
|
+
}.not_to change { order.shipping_address.phone }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "when phone number is not required, provided as param and not set on the shipping address" do
|
60
|
+
it "populates the address field with the phone passed as param" do
|
61
|
+
with_address_phone_not_required
|
62
|
+
order = create(:order_ready_to_complete, shipping_address: create(:address, phone: nil))
|
63
|
+
allow_any_instance_of(SolidusStripe::PaymentRequestController).to receive(:current_order).and_return(order)
|
64
|
+
|
65
|
+
expect {
|
66
|
+
with_disabled_forgery_protection do
|
67
|
+
post "/stripe/update_order", params: stripe_update_request_params(order: order, shipping_address: default_shipping_address(phone: nil), phone: '911')
|
68
|
+
end
|
69
|
+
}.to change { order.shipping_address.phone }.from(nil).to('911')
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context "when phone number is not required, provided as param but already set on the shipping address" do
|
74
|
+
it "populates the address field with the phone passed in the shipping field" do
|
75
|
+
with_address_phone_not_required
|
76
|
+
order = create(:order_ready_to_complete, shipping_address: create(:address, phone: nil))
|
77
|
+
allow_any_instance_of(SolidusStripe::PaymentRequestController).to receive(:current_order).and_return(order)
|
78
|
+
|
79
|
+
expect {
|
80
|
+
with_disabled_forgery_protection do
|
81
|
+
post "/stripe/update_order", params: stripe_update_request_params(order: order, shipping_address: default_shipping_address(phone: '555'), phone: '911')
|
82
|
+
end
|
83
|
+
}.to change { order.shipping_address.phone }.from(nil).to('555')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
def with_address_phone_not_required
|
91
|
+
if Spree::Config.respond_to?(:address_requires_phone)
|
92
|
+
stub_spree_preferences(address_requires_phone: false)
|
93
|
+
else
|
94
|
+
allow_any_instance_of(Spree::Address).to receive(:require_phone?).and_return(false)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def with_disabled_forgery_protection
|
99
|
+
original_allow_forgery_protection_value = ActionController::Base.allow_forgery_protection
|
100
|
+
ActionController::Base.allow_forgery_protection = false
|
101
|
+
|
102
|
+
yield
|
103
|
+
|
104
|
+
ActionController::Base.allow_forgery_protection = original_allow_forgery_protection_value
|
105
|
+
end
|
106
|
+
|
107
|
+
def stripe_update_request_params(
|
108
|
+
order:,
|
109
|
+
shipping_address: nil,
|
110
|
+
name: 'Clark Kent',
|
111
|
+
phone: '555-555-0199'
|
112
|
+
)
|
113
|
+
|
114
|
+
{
|
115
|
+
shipping_address: shipping_address || default_shipping_address,
|
116
|
+
shipping_option: {
|
117
|
+
id: order.shipments.first.shipping_rates.first.shipping_method.id
|
118
|
+
},
|
119
|
+
name: name,
|
120
|
+
phone: phone,
|
121
|
+
email: order.email
|
122
|
+
}
|
123
|
+
end
|
124
|
+
|
125
|
+
def default_shipping_address(
|
126
|
+
country: nil,
|
127
|
+
region: nil,
|
128
|
+
recipient: 'Clark Kent',
|
129
|
+
city: 'Metropolis',
|
130
|
+
postal_code: '12345',
|
131
|
+
address_line: ['12, Lincoln Rd'],
|
132
|
+
phone: '555-555-0199'
|
133
|
+
)
|
134
|
+
|
135
|
+
if country.blank? || region.blank?
|
136
|
+
state = create(:state)
|
137
|
+
|
138
|
+
country ||= state.country.iso
|
139
|
+
region ||= state.abbr
|
140
|
+
end
|
141
|
+
|
142
|
+
{
|
143
|
+
country: country,
|
144
|
+
region: region,
|
145
|
+
recipient: recipient,
|
146
|
+
city: city,
|
147
|
+
postalCode: postal_code,
|
148
|
+
addressLine: address_line,
|
149
|
+
phone: phone
|
150
|
+
}
|
151
|
+
end
|
152
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,18 +6,32 @@ ENV['RAILS_ENV'] = 'test'
|
|
6
6
|
# Run Coverage report
|
7
7
|
require 'solidus_dev_support/rspec/coverage'
|
8
8
|
|
9
|
-
|
9
|
+
# Create the dummy app if it's still missing.
|
10
|
+
dummy_env = "#{__dir__}/dummy/config/environment.rb"
|
11
|
+
system 'bin/rake extension:test_app' unless File.exist? dummy_env
|
12
|
+
require dummy_env
|
10
13
|
|
11
14
|
# Requires factories and other useful helpers defined in spree_core.
|
12
15
|
require 'solidus_dev_support/rspec/feature_helper'
|
13
16
|
|
14
17
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
15
18
|
# in spec/support/ and its subdirectories.
|
16
|
-
Dir[
|
19
|
+
Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }
|
20
|
+
|
21
|
+
# Requires factories defined in lib/solidus_stripe/testing_support/factories.rb
|
22
|
+
SolidusDevSupport::TestingSupport::Factories.load_for(SolidusStripe::Engine)
|
23
|
+
|
24
|
+
# Requires card input helper defined in lib/solidus_stripe/testing_support/card_input_helper.rb
|
25
|
+
require 'solidus_stripe/testing_support/card_input_helper'
|
17
26
|
|
18
27
|
RSpec.configure do |config|
|
19
28
|
config.infer_spec_type_from_file_location!
|
20
|
-
FactoryBot.find_definitions
|
21
29
|
config.use_transactional_fixtures = false
|
30
|
+
|
22
31
|
config.include SolidusAddressNameHelper, type: :feature
|
32
|
+
config.include SolidusCardInputHelper, type: :feature
|
33
|
+
|
34
|
+
if Spree.solidus_gem_version < Gem::Version.new('2.11')
|
35
|
+
config.extend Spree::TestingSupport::AuthorizationHelpers::Request, type: :system
|
36
|
+
end
|
23
37
|
end
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
# Since https://github.com/solidusio/solidus/pull/3524 was merged,
|
4
4
|
# we need to verify if we're using the single "Name" field or the
|
5
|
-
#
|
5
|
+
# previous first/last name combination.
|
6
6
|
module SolidusAddressNameHelper
|
7
7
|
def fill_in_name
|
8
|
-
if
|
8
|
+
if SolidusSupport.combined_first_and_last_name_in_address?
|
9
9
|
fill_in "Name", with: "Han Solo"
|
10
10
|
else
|
11
11
|
fill_in "First Name", with: "Han"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '2.3'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '4'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,49 +29,49 @@ dependencies:
|
|
29
29
|
version: '2.3'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '4'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: solidus_support
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.8'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.8'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activemerchant
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '1.
|
53
|
+
version: '1.105'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '1.
|
60
|
+
version: '1.105'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: solidus_dev_support
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '2.3'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '2.3'
|
75
75
|
description: Stripe Payment Method for Solidus
|
76
76
|
email: contact@solidus.io
|
77
77
|
executables: []
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- ".circleci/config.yml"
|
82
82
|
- ".gem_release.yml"
|
83
83
|
- ".github/stale.yml"
|
84
|
+
- ".github_changelog_generator"
|
84
85
|
- ".gitignore"
|
85
86
|
- ".rspec"
|
86
87
|
- ".rubocop.yml"
|
@@ -88,7 +89,6 @@ files:
|
|
88
89
|
- CHANGELOG.md
|
89
90
|
- Gemfile
|
90
91
|
- LICENSE
|
91
|
-
- LICENSE.md
|
92
92
|
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- app/assets/javascripts/spree/frontend/solidus_stripe.js
|
@@ -103,21 +103,32 @@ files:
|
|
103
103
|
- app/controllers/spree/stripe_controller.rb
|
104
104
|
- app/decorators/models/spree/order_update_attributes_decorator.rb
|
105
105
|
- app/decorators/models/spree/payment_decorator.rb
|
106
|
+
- app/decorators/models/spree/refund_decorator.rb
|
106
107
|
- app/models/solidus_stripe/address_from_params_service.rb
|
107
|
-
- app/models/solidus_stripe/
|
108
|
+
- app/models/solidus_stripe/create_intents_payment_service.rb
|
108
109
|
- app/models/solidus_stripe/prepare_order_for_payment_service.rb
|
109
110
|
- app/models/solidus_stripe/shipping_rates_service.rb
|
110
111
|
- app/models/spree/payment_method/stripe_credit_card.rb
|
111
112
|
- bin/console
|
113
|
+
- bin/r
|
112
114
|
- bin/rails
|
115
|
+
- bin/rails-engine
|
116
|
+
- bin/rails-sandbox
|
117
|
+
- bin/rake
|
118
|
+
- bin/sandbox
|
119
|
+
- bin/sandbox_rails
|
113
120
|
- bin/setup
|
121
|
+
- config/locales/en.yml
|
114
122
|
- config/routes.rb
|
115
123
|
- db/migrate/20181010123508_update_stripe_payment_method_type_to_credit_card.rb
|
116
124
|
- db/seeds.rb
|
117
125
|
- lib/assets/stylesheets/spree/frontend/solidus_stripe.scss
|
118
126
|
- lib/generators/solidus_stripe/install/install_generator.rb
|
119
127
|
- lib/solidus_stripe.rb
|
128
|
+
- lib/solidus_stripe/configuration.rb
|
120
129
|
- lib/solidus_stripe/engine.rb
|
130
|
+
- lib/solidus_stripe/testing_support/card_input_helper.rb
|
131
|
+
- lib/solidus_stripe/testing_support/factories.rb
|
121
132
|
- lib/solidus_stripe/version.rb
|
122
133
|
- lib/tasks/solidus_stripe/db/seed.rake
|
123
134
|
- lib/views/api/spree/api/payments/source_views/_stripe.json.jbuilder
|
@@ -135,18 +146,21 @@ files:
|
|
135
146
|
- solidus_stripe.gemspec
|
136
147
|
- spec/features/stripe_checkout_spec.rb
|
137
148
|
- spec/models/solidus_stripe/address_from_params_service_spec.rb
|
149
|
+
- spec/models/solidus_stripe/create_intents_payment_service_spec.rb
|
138
150
|
- spec/models/solidus_stripe/prepare_order_for_payment_service_spec.rb
|
139
151
|
- spec/models/solidus_stripe/shipping_rates_service_spec.rb
|
140
152
|
- spec/models/spree/payment_method/stripe_credit_card_spec.rb
|
153
|
+
- spec/requests/payment_requests_spec.rb
|
141
154
|
- spec/spec_helper.rb
|
142
155
|
- spec/support/solidus_address_helper.rb
|
143
|
-
homepage: https://
|
156
|
+
homepage: https://github.com/solidusio/solidus_stripe#readme
|
144
157
|
licenses:
|
145
158
|
- BSD-3
|
146
159
|
metadata:
|
147
|
-
homepage_uri: https://
|
148
|
-
source_code_uri: https://
|
149
|
-
|
160
|
+
homepage_uri: https://github.com/solidusio/solidus_stripe#readme
|
161
|
+
source_code_uri: https://github.com/solidusio/solidus_stripe
|
162
|
+
changelog_uri: https://github.com/solidusio/solidus_stripe/blob/master/CHANGELOG.md
|
163
|
+
post_install_message:
|
150
164
|
rdoc_options: []
|
151
165
|
require_paths:
|
152
166
|
- lib
|
@@ -154,23 +168,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
168
|
requirements:
|
155
169
|
- - ">="
|
156
170
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
171
|
+
version: 2.4.0
|
158
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
173
|
requirements:
|
160
174
|
- - ">="
|
161
175
|
- !ruby/object:Gem::Version
|
162
176
|
version: '0'
|
163
|
-
requirements:
|
164
|
-
|
165
|
-
|
166
|
-
signing_key:
|
177
|
+
requirements: []
|
178
|
+
rubygems_version: 3.2.20
|
179
|
+
signing_key:
|
167
180
|
specification_version: 4
|
168
181
|
summary: Stripe Payment Method for Solidus
|
169
182
|
test_files:
|
170
183
|
- spec/features/stripe_checkout_spec.rb
|
171
184
|
- spec/models/solidus_stripe/address_from_params_service_spec.rb
|
185
|
+
- spec/models/solidus_stripe/create_intents_payment_service_spec.rb
|
172
186
|
- spec/models/solidus_stripe/prepare_order_for_payment_service_spec.rb
|
173
187
|
- spec/models/solidus_stripe/shipping_rates_service_spec.rb
|
174
188
|
- spec/models/spree/payment_method/stripe_credit_card_spec.rb
|
189
|
+
- spec/requests/payment_requests_spec.rb
|
175
190
|
- spec/spec_helper.rb
|
176
191
|
- spec/support/solidus_address_helper.rb
|