solidus_bolt 0.0.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -7
- data/app/assets/javascripts/solidus_bolt.js +4 -0
- data/app/controllers/spree/admin/bolts_controller.rb +0 -3
- data/app/decorators/models/solidus_bolt/order_decorator.rb +5 -0
- data/app/decorators/models/solidus_bolt/shipment_decorator.rb +15 -0
- data/app/models/solidus_bolt/bolt_configuration.rb +10 -1
- data/app/models/solidus_bolt/payment_method.rb +6 -0
- data/app/views/spree/admin/bolts/_configuration.html.erb +2 -2
- data/app/views/spree/admin/bolts/_form.html.erb +0 -6
- data/app/views/spree/admin/bolts/show.html.erb +6 -4
- data/config/locales/en.yml +3 -1
- data/db/migrate/20220629131950_remove_bearer_token_on_solidus_bolt_bolt_configuration.rb +5 -0
- data/db/migrate/20220725133701_remove_merchant_id_and_division_public_id_on_bolt_configuration.rb +6 -0
- data/db/seeds.rb +1 -4
- data/lib/solidus_bolt/testing_support/factories.rb +1 -4
- data/lib/solidus_bolt/version.rb +1 -1
- data/solidus_bolt.gemspec +2 -1
- data/spec/decorators/models/solidus_bolt/order_decorator_spec.rb +3 -1
- data/spec/decorators/models/solidus_bolt/shipment_decorator_spec.rb +18 -0
- data/spec/models/solidus_bolt/bolt_configuration_spec.rb +14 -6
- data/spec/models/solidus_bolt/payment_method_spec.rb +25 -0
- data/spec/requests/spree/admin/bolt_spec.rb +0 -6
- data/spec/services/solidus_bolt/webhooks/create_service_spec.rb +6 -4
- data/spec/support/bolt_configuration.rb +0 -3
- data/spec/support/vcr.rb +0 -1
- metadata +25 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f450560bb140e6c7a301138a192a5c8a96016500980580de6866eb1ed79a061d
|
4
|
+
data.tar.gz: 84ace4cc0e18e06ddb78b72ff4d06460c1bc0eeed5f7ad1beb1c53e0791a8a8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2be760b6012c698408e74d73a5b312cd3b9117f8defee100ac4f4234fa404efcff9d8553fa42170764772d2a334162ac7a30a0f3a2d4dbeb8544f29ea354547
|
7
|
+
data.tar.gz: 171b51d8f32782f81c7d50871161f8a731ccdc308cc9485c21efdb14a03248a8112f27db93cf2a4bebc69a3af2c75aa6389297242c4c00b4dfd2001a9db6b26b
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Add solidus_bolt to your Gemfile:
|
|
13
13
|
gem 'solidus_bolt'
|
14
14
|
```
|
15
15
|
|
16
|
-
Bundle your dependencies and run the installation generator (before running the following command, we recommend setting up the environment variables and seeds as described in the sections below):
|
16
|
+
Bundle your dependencies and run the installation generator (before running the following command, we recommend setting up the environment variables and seeds as described in the sections below):
|
17
17
|
|
18
18
|
```shell
|
19
19
|
bin/rails generate solidus_bolt:install
|
@@ -26,10 +26,7 @@ bin/rails generate solidus_bolt:install
|
|
26
26
|
Many of the API calls handled by this gem use the variables set in Bolt Configuration. Since this extension's seeds automatically generate a Bolt Configuration, the easiest and safest way to configure it would be by setting the following environment variables:
|
27
27
|
|
28
28
|
```
|
29
|
-
BOLT_BEARER_TOKEN
|
30
29
|
BOLT_ENVIRONMENT
|
31
|
-
BOLT_MERCHANT_PUBLIC_ID
|
32
|
-
BOLT_DIVISION_PUBLIC_ID
|
33
30
|
BOLT_API_KEY
|
34
31
|
BOLT_SIGNING_SECRET
|
35
32
|
BOLT_PUBLISHABLE_KEY
|
@@ -45,11 +42,11 @@ Provided you setup the environment variables, you can simplify the setup of a Bo
|
|
45
42
|
- AuthenticationMethod
|
46
43
|
- PaymentMethod
|
47
44
|
|
48
|
-
You can run solidus_bolt's seeds either by running
|
45
|
+
You can run solidus_bolt's seeds either by running
|
49
46
|
```shell
|
50
47
|
bin/rails db:seed:solidus_bolt
|
51
|
-
```
|
52
|
-
or by adding the following line to your seed file:
|
48
|
+
```
|
49
|
+
or by adding the following line to your seed file:
|
53
50
|
```ruby
|
54
51
|
SolidusBolt::Engine.load_seed if defined?(SolidusBolt)
|
55
52
|
```
|
@@ -16,6 +16,8 @@ const tokenize = async (paymentField, paymentMethodId, frontend) => {
|
|
16
16
|
if (result["token"]) {
|
17
17
|
updateOrder(result, paymentMethodId, frontend)
|
18
18
|
} else {
|
19
|
+
const submitButton = document.getElementById("bolt-submit-button")
|
20
|
+
submitButton.disabled = false;
|
19
21
|
console.log(`error ${result["type"]}: ${result["message"]}`);
|
20
22
|
}
|
21
23
|
});
|
@@ -75,6 +77,8 @@ document.addEventListener("DOMContentLoaded", async function () {
|
|
75
77
|
if(boltContainer.dataset["boltUserSignedIn"] != "true") {
|
76
78
|
accountCheckbox = boltEmbedded.create("account_checkbox");
|
77
79
|
accountCheckbox.on("change", checked => createBoltAccount = checked);
|
80
|
+
} else {
|
81
|
+
createBoltAccount = true;
|
78
82
|
}
|
79
83
|
cardButton.addEventListener("click", () => {
|
80
84
|
const submitButton = document.getElementById("bolt-submit-button")
|
@@ -7,6 +7,7 @@ module SolidusBolt
|
|
7
7
|
total_amount: display_total.cents,
|
8
8
|
order_reference: number,
|
9
9
|
currency: currency,
|
10
|
+
shipments: bolt_shipments_payload,
|
10
11
|
items: line_items.map do |line_item|
|
11
12
|
{
|
12
13
|
sku: line_item.sku,
|
@@ -35,6 +36,10 @@ module SolidusBolt
|
|
35
36
|
|
36
37
|
private
|
37
38
|
|
39
|
+
def bolt_shipments_payload
|
40
|
+
shipments.map(&:bolt_shipment)
|
41
|
+
end
|
42
|
+
|
38
43
|
def cents(float)
|
39
44
|
(float * 100).to_i
|
40
45
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SolidusBolt
|
4
|
+
module ShipmentDecorator
|
5
|
+
def bolt_shipment
|
6
|
+
{
|
7
|
+
shipping_address: order.ship_address.bolt_address(order.email),
|
8
|
+
reference: number,
|
9
|
+
cost: display_total.cents
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
Spree::Shipment.prepend(self)
|
14
|
+
end
|
15
|
+
end
|
@@ -6,7 +6,8 @@ module SolidusBolt
|
|
6
6
|
class BoltConfiguration < ApplicationRecord
|
7
7
|
after_commit :update_bolt_config_credentials
|
8
8
|
|
9
|
-
|
9
|
+
PRODUCTION_REGISTER_URL = 'https://merchant.bolt.com/register?platform=solidus'
|
10
|
+
SANDBOX_REGISTER_URL = 'https://merchant-sandbox.bolt.com/register?platform=solidus'
|
10
11
|
EVENTS = %w[all payment credit capture void auth pending rejected_irreversible rejected_reversible no_op
|
11
12
|
failed_payment newsletter_subscription risk_insights credit_card_deleted].freeze
|
12
13
|
|
@@ -14,6 +15,14 @@ module SolidusBolt
|
|
14
15
|
|
15
16
|
validate :config_can_be_created, on: :create
|
16
17
|
|
18
|
+
def merchant_public_id
|
19
|
+
publishable_key.split('.').first
|
20
|
+
end
|
21
|
+
|
22
|
+
def division_public_id
|
23
|
+
publishable_key.split('.').second
|
24
|
+
end
|
25
|
+
|
17
26
|
def self.fetch
|
18
27
|
first_or_create
|
19
28
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<table class="index">
|
3
3
|
<thead>
|
4
4
|
<tr>
|
5
|
-
<th><%= SolidusBolt::BoltConfiguration.human_attribute_name(:
|
5
|
+
<th><%= SolidusBolt::BoltConfiguration.human_attribute_name(:publishable_key) %></th>
|
6
6
|
<th><%= SolidusBolt::BoltConfiguration.human_attribute_name(:environment) %></th>
|
7
7
|
<th><%= SolidusBolt::BoltConfiguration.human_attribute_name(:created_at) %></th>
|
8
8
|
<th><%= SolidusBolt::BoltConfiguration.human_attribute_name(:updated_at) %></th>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
</thead>
|
12
12
|
<tbody>
|
13
13
|
<tr>
|
14
|
-
<td><%= @bolt_configuration.
|
14
|
+
<td><%= @bolt_configuration.publishable_key %></td>
|
15
15
|
<td><%= @bolt_configuration.environment %></td>
|
16
16
|
<td>
|
17
17
|
<%= @bolt_configuration.created_at.to_s(:long) %>
|
@@ -6,12 +6,6 @@
|
|
6
6
|
<div class="col-12">
|
7
7
|
<%= f.label :environment %>
|
8
8
|
<%= f.select :environment, %w[production sandbox staging] %><br />
|
9
|
-
<%= f.label :bearer_token %>
|
10
|
-
<%= f.text_field :bearer_token, class: 'fullwidth'%>
|
11
|
-
<%= f.label 'Merchant Public Id' %><br />
|
12
|
-
<%= f.text_field :merchant_public_id, class: 'fullwidth' %>
|
13
|
-
<%= f.label 'Division Public Id' %><br />
|
14
|
-
<%= f.text_field :division_public_id, class: 'fullwidth' %>
|
15
9
|
<%= f.label :api_key %><br />
|
16
10
|
<%= f.text_field :api_key, class: 'fullwidth' %>
|
17
11
|
<%= f.label :signing_secret %><br />
|
@@ -3,10 +3,12 @@
|
|
3
3
|
<% content_for :page_actions do %>
|
4
4
|
<% if SolidusBolt::BoltConfiguration.config_empty? %>
|
5
5
|
<li>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<%= raw t(
|
7
|
+
'spree.admin.bolt.register_merchant_account',
|
8
|
+
production_link: link_to(t('spree.admin.bolt.production'), SolidusBolt::BoltConfiguration::PRODUCTION_REGISTER_URL, target: '_blank'),
|
9
|
+
sandbox_link: link_to(t('spree.admin.bolt.sandbox'), SolidusBolt::BoltConfiguration::SANDBOX_REGISTER_URL, target: '_blank'),
|
10
|
+
bolt_image: image_tag("bolt_logo_standard.png", alt: "Bolt", width: "40")
|
11
|
+
) %>
|
10
12
|
</li>
|
11
13
|
<% else %>
|
12
14
|
<li>
|
data/config/locales/en.yml
CHANGED
@@ -12,6 +12,8 @@ en:
|
|
12
12
|
configuration_not_found: 'No Bolt Configuration found'
|
13
13
|
edit_configuration: 'Edit Bolt Configuration'
|
14
14
|
updated_successfully: 'Bolt Configuration Updated Successfully'
|
15
|
-
|
15
|
+
register_merchant_account: Create a %{production_link} or %{sandbox_link} merchant account with %{bolt_image}
|
16
|
+
production: Production
|
17
|
+
sandbox: Sandbox
|
16
18
|
tab:
|
17
19
|
bolt: 'Bolt'
|
data/db/migrate/20220725133701_remove_merchant_id_and_division_public_id_on_bolt_configuration.rb
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
class RemoveMerchantIdAndDivisionPublicIdOnBoltConfiguration < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
remove_column :solidus_bolt_bolt_configurations, :division_public_id, :string
|
4
|
+
remove_column :solidus_bolt_bolt_configurations, :merchant_public_id, :string
|
5
|
+
end
|
6
|
+
end
|
data/db/seeds.rb
CHANGED
@@ -2,10 +2,7 @@
|
|
2
2
|
|
3
3
|
solidus_bolt_configuration = SolidusBolt::BoltConfiguration.fetch
|
4
4
|
|
5
|
-
solidus_bolt_configuration.
|
6
|
-
solidus_bolt_configuration.environment = ENV['BOLT_ENVIRONMENT']
|
7
|
-
solidus_bolt_configuration.merchant_public_id = ENV['BOLT_MERCHANT_PUBLIC_ID']
|
8
|
-
solidus_bolt_configuration.division_public_id = ENV['BOLT_DIVISION_PUBLIC_ID']
|
5
|
+
solidus_bolt_configuration.environment = ENV.fetch('BOLT_ENVIRONMENT', 'sandbox')
|
9
6
|
solidus_bolt_configuration.api_key = ENV['BOLT_API_KEY']
|
10
7
|
solidus_bolt_configuration.signing_secret = ENV['BOLT_SIGNING_SECRET']
|
11
8
|
solidus_bolt_configuration.publishable_key = ENV['BOLT_PUBLISHABLE_KEY']
|
@@ -2,13 +2,10 @@
|
|
2
2
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :bolt_configuration, class: SolidusBolt::BoltConfiguration do
|
5
|
-
bearer_token { SecureRandom.hex }
|
6
5
|
environment { 'sandbox' }
|
7
|
-
merchant_public_id { SecureRandom.hex }
|
8
|
-
division_public_id { SecureRandom.hex }
|
9
6
|
api_key { SecureRandom.hex }
|
10
7
|
signing_secret { SecureRandom.hex }
|
11
|
-
publishable_key { SecureRandom.hex }
|
8
|
+
publishable_key { "#{SecureRandom.hex}.#{SecureRandom.hex}.#{SecureRandom.hex}" }
|
12
9
|
end
|
13
10
|
|
14
11
|
factory :bolt_payment_method, class: SolidusBolt::PaymentMethod do
|
data/lib/solidus_bolt/version.rb
CHANGED
data/solidus_bolt.gemspec
CHANGED
@@ -31,8 +31,9 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency 'coffee-rails'
|
32
32
|
spec.add_dependency 'deface'
|
33
33
|
spec.add_dependency 'httparty'
|
34
|
+
spec.add_dependency 'multi_json'
|
34
35
|
spec.add_dependency 'omniauth-bolt'
|
35
|
-
spec.add_dependency 'rails'
|
36
|
+
spec.add_dependency 'rails'
|
36
37
|
spec.add_dependency 'solidus_auth_devise'
|
37
38
|
spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 4']
|
38
39
|
spec.add_dependency 'solidus_social'
|
@@ -9,6 +9,7 @@ RSpec.describe SolidusBolt::OrderDecorator do
|
|
9
9
|
total_amount: (order.total * 100).to_i,
|
10
10
|
order_reference: order.number,
|
11
11
|
currency: 'USD',
|
12
|
+
shipments: array_including(hash_including(:reference)),
|
12
13
|
items: [{
|
13
14
|
sku: order.line_items.first.sku,
|
14
15
|
name: order.line_items.first.name,
|
@@ -16,7 +17,8 @@ RSpec.describe SolidusBolt::OrderDecorator do
|
|
16
17
|
quantity: 1
|
17
18
|
}]
|
18
19
|
}
|
19
|
-
|
20
|
+
|
21
|
+
expect(order.bolt_cart).to match hash_including(result)
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe SolidusBolt::ShipmentDecorator do
|
4
|
+
describe '#bolt_shipment' do
|
5
|
+
subject(:bolt_shipment) { shipment.bolt_shipment }
|
6
|
+
|
7
|
+
let(:shipment) { create(:shipment, number: 'S000000001') }
|
8
|
+
let(:ship_address) { shipment.order.ship_address }
|
9
|
+
|
10
|
+
it 'is expected' do
|
11
|
+
expect(bolt_shipment).to match hash_including(
|
12
|
+
shipping_address: hash_including(postal_code: ship_address.zipcode, country_code: ship_address.country_iso),
|
13
|
+
reference: 'S000000001',
|
14
|
+
cost: 10_000
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -4,10 +4,7 @@ RSpec.describe SolidusBolt::BoltConfiguration, type: :model do
|
|
4
4
|
let(:column_list) {
|
5
5
|
[
|
6
6
|
'id',
|
7
|
-
'bearer_token',
|
8
7
|
'environment',
|
9
|
-
'merchant_public_id',
|
10
|
-
'division_public_id',
|
11
8
|
'api_key',
|
12
9
|
'signing_secret',
|
13
10
|
'publishable_key',
|
@@ -47,9 +44,6 @@ RSpec.describe SolidusBolt::BoltConfiguration, type: :model do
|
|
47
44
|
it 'is true for a record with empty fields' do
|
48
45
|
create(
|
49
46
|
:bolt_configuration,
|
50
|
-
bearer_token: '',
|
51
|
-
merchant_public_id: '',
|
52
|
-
division_public_id: '',
|
53
47
|
api_key: '',
|
54
48
|
signing_secret: '',
|
55
49
|
publishable_key: ''
|
@@ -63,6 +57,20 @@ RSpec.describe SolidusBolt::BoltConfiguration, type: :model do
|
|
63
57
|
end
|
64
58
|
end
|
65
59
|
|
60
|
+
describe '#merchant_public_id' do
|
61
|
+
it 'returns the merchant_public_id' do
|
62
|
+
bolt_configuration = create(:bolt_configuration, publishable_key: 'abc.def.ghi')
|
63
|
+
expect(bolt_configuration.merchant_public_id).to eq('abc')
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe '#division_public_id' do
|
68
|
+
it 'returns the division_public_id' do
|
69
|
+
bolt_configuration = create(:bolt_configuration, publishable_key: 'abc.def.ghi')
|
70
|
+
expect(bolt_configuration.division_public_id).to eq('def')
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
66
74
|
describe '#environment_url' do
|
67
75
|
context 'when production envornment' do
|
68
76
|
let(:config) { create(:bolt_configuration, environment: 'production') }
|
@@ -18,4 +18,29 @@ RSpec.describe SolidusBolt::PaymentMethod, type: :model do
|
|
18
18
|
expect(described_class.new.partial_name).to eq 'bolt'
|
19
19
|
end
|
20
20
|
end
|
21
|
+
|
22
|
+
describe '#try_void' do
|
23
|
+
let(:payment) { create(:payment) }
|
24
|
+
|
25
|
+
context 'when the payment can be voided' do
|
26
|
+
subject(:try_void) { described_instance.try_void(payment) }
|
27
|
+
|
28
|
+
let(:described_instance) { described_class.new }
|
29
|
+
let(:response) { ActiveMerchant::Billing::Response.new(true, 'Transaction voided', {}, authorization: '123') }
|
30
|
+
|
31
|
+
before do
|
32
|
+
allow(payment.source).to receive(:can_void?).and_return(true)
|
33
|
+
allow(described_instance.gateway).to receive(:void).and_return(response)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'calls void on the gateway' do
|
37
|
+
try_void
|
38
|
+
|
39
|
+
expect(described_instance.gateway).to have_received(:void).with(
|
40
|
+
payment.response_code,
|
41
|
+
originator: payment
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
21
46
|
end
|
@@ -5,10 +5,7 @@ RSpec.describe "Spree::Admin::Bolts", type: :request do
|
|
5
5
|
|
6
6
|
let(:bolt_configuration_params) {
|
7
7
|
{
|
8
|
-
bearer_token: SecureRandom.hex,
|
9
8
|
environment: 'sandbox',
|
10
|
-
merchant_public_id: SecureRandom.hex,
|
11
|
-
division_public_id: SecureRandom.hex,
|
12
9
|
api_key: SecureRandom.hex,
|
13
10
|
signing_secret: SecureRandom.hex,
|
14
11
|
publishable_key: SecureRandom.hex
|
@@ -56,10 +53,7 @@ RSpec.describe "Spree::Admin::Bolts", type: :request do
|
|
56
53
|
request
|
57
54
|
|
58
55
|
updated_attributes = SolidusBolt::BoltConfiguration.fetch.attributes.slice(
|
59
|
-
'bearer_token',
|
60
56
|
'environment',
|
61
|
-
'merchant_public_id',
|
62
|
-
'division_public_id',
|
63
57
|
'api_key',
|
64
58
|
'signing_secret',
|
65
59
|
'publishable_key'
|
@@ -4,13 +4,15 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
RSpec.describe SolidusBolt::Webhooks::CreateService, :vcr, :bolt_configuration do
|
6
6
|
describe '#call', vcr: true do
|
7
|
-
subject(:
|
7
|
+
subject(:create_service) { described_class.call(url: 'https://solidus-test.com/webhook', event: event) }
|
8
|
+
|
9
|
+
before { SolidusBolt::BoltConfiguration.fetch.update(publishable_key: 'abc.def.ghi') }
|
8
10
|
|
9
11
|
context 'with an event' do
|
10
12
|
let(:event) { 'payment' }
|
11
13
|
|
12
14
|
it 'returns a webhook id' do
|
13
|
-
expect(
|
15
|
+
expect(create_service).to match hash_including('webhook_id')
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
@@ -18,7 +20,7 @@ RSpec.describe SolidusBolt::Webhooks::CreateService, :vcr, :bolt_configuration d
|
|
18
20
|
let(:event) { 'all' }
|
19
21
|
|
20
22
|
it 'returns a webhook id' do
|
21
|
-
expect(
|
23
|
+
expect(create_service).to match hash_including('webhook_id')
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
@@ -26,7 +28,7 @@ RSpec.describe SolidusBolt::Webhooks::CreateService, :vcr, :bolt_configuration d
|
|
26
28
|
let(:event) { '' }
|
27
29
|
|
28
30
|
it 'raises a server error' do
|
29
|
-
expect{
|
31
|
+
expect{ create_service }.to raise_error SolidusBolt::ServerError
|
30
32
|
end
|
31
33
|
end
|
32
34
|
end
|
@@ -4,10 +4,7 @@ RSpec.configure do |config|
|
|
4
4
|
config.before(:example, :bolt_configuration) do
|
5
5
|
solidus_bolt_configuration = SolidusBolt::BoltConfiguration.fetch
|
6
6
|
|
7
|
-
solidus_bolt_configuration.bearer_token = ENV['BOLT_BEARER_TOKEN']
|
8
7
|
solidus_bolt_configuration.environment = 'sandbox'
|
9
|
-
solidus_bolt_configuration.merchant_public_id = ENV['BOLT_MERCHANT_PUBLIC_ID']
|
10
|
-
solidus_bolt_configuration.division_public_id = ENV['BOLT_DIVISION_PUBLIC_ID']
|
11
8
|
solidus_bolt_configuration.api_key = ENV['BOLT_API_KEY']
|
12
9
|
solidus_bolt_configuration.signing_secret = ENV['BOLT_SIGNING_SECRET']
|
13
10
|
solidus_bolt_configuration.publishable_key = ENV['BOLT_PUBLISHABLE_KEY']
|
data/spec/support/vcr.rb
CHANGED
@@ -20,7 +20,6 @@ VCR.configure do |config|
|
|
20
20
|
|
21
21
|
config.filter_sensitive_data('<PUBLISHABLE_KEY>') { SolidusBolt::BoltConfiguration.fetch.publishable_key }
|
22
22
|
config.filter_sensitive_data('<API_KEY>') { SolidusBolt::BoltConfiguration.fetch.api_key }
|
23
|
-
config.filter_sensitive_data('<DIVISION_ID>') { SolidusBolt::BoltConfiguration.fetch.division_public_id }
|
24
23
|
|
25
24
|
# Let's you set default VCR record mode with VCR_RECORDE_MODE=all for re-recording
|
26
25
|
# episodes. :once is VCR default
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piyushswain
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coffee-rails
|
@@ -54,6 +54,20 @@ dependencies:
|
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: multi_json
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
57
71
|
- !ruby/object:Gem::Dependency
|
58
72
|
name: omniauth-bolt
|
59
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,22 +86,16 @@ dependencies:
|
|
72
86
|
name: rails
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|
74
88
|
requirements:
|
75
|
-
- - "
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 0.a
|
78
|
-
- - "<"
|
89
|
+
- - ">="
|
79
90
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
91
|
+
version: '0'
|
81
92
|
type: :runtime
|
82
93
|
prerelease: false
|
83
94
|
version_requirements: !ruby/object:Gem::Requirement
|
84
95
|
requirements:
|
85
|
-
- - "
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: 0.a
|
88
|
-
- - "<"
|
96
|
+
- - ">="
|
89
97
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
98
|
+
version: '0'
|
91
99
|
- !ruby/object:Gem::Dependency
|
92
100
|
name: solidus_auth_devise
|
93
101
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,6 +265,7 @@ files:
|
|
257
265
|
- app/decorators/models/solidus_bolt/log_entry_decorator.rb
|
258
266
|
- app/decorators/models/solidus_bolt/order_decorator.rb
|
259
267
|
- app/decorators/models/solidus_bolt/payment_decorator.rb
|
268
|
+
- app/decorators/models/solidus_bolt/shipment_decorator.rb
|
260
269
|
- app/decorators/omniauth/strategies/bolt_decorator.rb
|
261
270
|
- app/jobs/solidus_bolt/add_address_job.rb
|
262
271
|
- app/models/solidus_bolt.rb
|
@@ -320,6 +329,8 @@ files:
|
|
320
329
|
- db/migrate/20220526005619_remove_user_id_from_solidus_bolt_payment_source.rb
|
321
330
|
- db/migrate/20220530102107_rename_bolt_configuration_merchant_id_to_division_public_id.rb
|
322
331
|
- db/migrate/20220531075527_update_bolt_configuration_environment_column_restrictions.rb
|
332
|
+
- db/migrate/20220629131950_remove_bearer_token_on_solidus_bolt_bolt_configuration.rb
|
333
|
+
- db/migrate/20220725133701_remove_merchant_id_and_division_public_id_on_bolt_configuration.rb
|
323
334
|
- db/seeds.rb
|
324
335
|
- lib/generators/solidus_bolt/install/install_generator.rb
|
325
336
|
- lib/generators/solidus_bolt/install/templates/initializer.rb
|
@@ -334,6 +345,7 @@ files:
|
|
334
345
|
- spec/decorators/models/solidus_bolt/address_decorator_spec.rb
|
335
346
|
- spec/decorators/models/solidus_bolt/order_decorator_spec.rb
|
336
347
|
- spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
|
348
|
+
- spec/decorators/models/solidus_bolt/shipment_decorator_spec.rb
|
337
349
|
- spec/fixtures/vcr_cassettes/SolidusBolt_Accounts_AddAddressService/_call/with_correct_access_token/receives_a_successful_response.yml
|
338
350
|
- spec/fixtures/vcr_cassettes/SolidusBolt_Accounts_AddAddressService/_call/with_existing_address/skips_the_add_address_call.yml
|
339
351
|
- spec/fixtures/vcr_cassettes/SolidusBolt_Accounts_AddAddressService/_call/with_wrong_access_token/gives_an_error.yml
|
@@ -427,6 +439,7 @@ test_files:
|
|
427
439
|
- spec/decorators/models/solidus_bolt/address_decorator_spec.rb
|
428
440
|
- spec/decorators/models/solidus_bolt/order_decorator_spec.rb
|
429
441
|
- spec/decorators/models/solidus_bolt/payment_decorator_spec.rb
|
442
|
+
- spec/decorators/models/solidus_bolt/shipment_decorator_spec.rb
|
430
443
|
- spec/fixtures/vcr_cassettes/SolidusBolt_Accounts_AddAddressService/_call/with_correct_access_token/receives_a_successful_response.yml
|
431
444
|
- spec/fixtures/vcr_cassettes/SolidusBolt_Accounts_AddAddressService/_call/with_existing_address/skips_the_add_address_call.yml
|
432
445
|
- spec/fixtures/vcr_cassettes/SolidusBolt_Accounts_AddAddressService/_call/with_wrong_access_token/gives_an_error.yml
|