flowcommerce_spree 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/README.md +59 -15
- data/app/models/spree/flow_io_product_decorator.rb +2 -2
- data/lib/flowcommerce_spree/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 679a3d268ba2e06caff2460bcfd86b671630de034567017f5a9b8f51a6c20d4b
|
4
|
+
data.tar.gz: 6c95ee74d3783dbb01f1aa1ae9107b386b75de5de9f298d9ea65270ed5a43ffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af6dba3c9673dbedf2b3d3672c9dc7a09375a7bc12581393ec4173df0cefe2157d2d4022bcf3b0ac0ceeedf87b91fd6e71558d296d1d848d60abac18de9de47a
|
7
|
+
data.tar.gz: 9ad313a9ab18cb88bb9fe68dff643933bf2b940613ca1a11fd5014c51cfa26bf911443074254c719d393cb1671ef36819b3e292730d677622135bf94a464c83e
|
data/README.md
CHANGED
@@ -57,35 +57,79 @@ All flowcommerce_spree code is located in the ./app and ./lib folders.
|
|
57
57
|
`serialize :flow_data, ActiveRecord::Coders::JSON.new(symbolize_keys: true)`
|
58
58
|
|
59
59
|
|
60
|
+
## FlowcommerceSpree::Api module
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
Classes that begin with Flow are responsible for communicating with flow API.
|
64
|
-
|
65
|
-
### Flow
|
66
|
-
|
67
|
-
Helper class that offers low level flow api access and few helper methods.
|
62
|
+
This is a legacy module using the `curl` gem for making direct calls to flow.io API. It will be refactored out in
|
63
|
+
future versions of the gem in favor of using the official flow.io API client from the `flowcommerce` gem.
|
68
64
|
|
69
65
|
### FlowcommerceSpree::ExperienceService
|
70
66
|
|
71
67
|
Responsible for selecting current experience. You have to define available experiences in flow console.
|
72
68
|
|
73
|
-
###
|
69
|
+
### FlowcommerceSpree::OrderSync
|
74
70
|
|
75
71
|
Maintain and synchronizes Spree::Order with Flow API.
|
76
72
|
|
77
|
-
###
|
73
|
+
### FlowcommerceSpree::Session
|
78
74
|
|
79
75
|
Every shop user has a session. This class helps in creating and maintaining session with Flow.
|
80
76
|
|
81
|
-
|
77
|
+
### Decorators
|
82
78
|
|
83
|
-
Decorators are
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
## Helper lib
|
79
|
+
Decorators are used extensively across the gem to modify or add behaviour of several Spree classes and modules. To
|
80
|
+
properly deal with the precedence in the Ruby ancestor chain, the `class_eval`, `include` and `prepend` methods are
|
81
|
+
being used, depending on the level of modification.
|
88
82
|
|
89
83
|
### Spree::Flow::Gateway
|
90
84
|
|
91
85
|
Adapter for Spree, that allows using [Flow.io](https://www.flow.io) as payment gateway. Flow is PCI compliant payment processor.
|
86
|
+
|
87
|
+
## Gem Maintenance
|
88
|
+
|
89
|
+
### Preparing a release
|
90
|
+
|
91
|
+
Merge all the pull requests that should make it into the new release into the `main` branch, then checkout and pull the
|
92
|
+
branch and run the `github_changelog_generator`, specifying the new version as a `--future-release` cli parameter:
|
93
|
+
|
94
|
+
```
|
95
|
+
git checkout main
|
96
|
+
git pull
|
97
|
+
|
98
|
+
github_changelog_generator -u mejuri-inc -p flowcommerce_spree --future-release v0.0.2
|
99
|
+
```
|
100
|
+
|
101
|
+
Then add the changes to `git`, commit and push the `Preparing the new release` commit directly into the `main` branch:
|
102
|
+
|
103
|
+
```
|
104
|
+
git add .
|
105
|
+
git commit -m 'Preparing the new v0.0.2 release'
|
106
|
+
git push
|
107
|
+
```
|
108
|
+
|
109
|
+
### RubyGems credentials
|
110
|
+
|
111
|
+
Ensure you have the RubyGems credentials located in the `~/.gem/credentials` file.
|
112
|
+
|
113
|
+
### Adding a gem owner
|
114
|
+
|
115
|
+
```
|
116
|
+
gem owner flowcommerce_spree -a sebastian.deluca@mejuri.com
|
117
|
+
```
|
118
|
+
|
119
|
+
### Building a new gem version
|
120
|
+
|
121
|
+
Adjust the new gem version number in the `lib/flowcommerce_spree/version.rb` file. It is used when building the gem
|
122
|
+
by the following command:
|
123
|
+
|
124
|
+
```
|
125
|
+
gem build flowcommerce_spree.gemspec
|
126
|
+
```
|
127
|
+
|
128
|
+
Asuming the version was set to `0.0.1`, a `flowcommerce_spree-0.0.1.gem` will be generated at the root of the app
|
129
|
+
(repo).
|
130
|
+
|
131
|
+
### Pushing a new gem release to RubyGems
|
132
|
+
|
133
|
+
```
|
134
|
+
gem push flowcommerce_spree-0.0.1.gem # don't forget to specify the correct version number
|
135
|
+
```
|
@@ -49,7 +49,7 @@ module Spree
|
|
49
49
|
rmin = min&.amount&.to_s(:rounded, precision: 0) || 0
|
50
50
|
rmax = max&.amount&.to_s(:rounded, precision: 0) || 0
|
51
51
|
|
52
|
-
prices[currency] =
|
52
|
+
prices[currency] = { min: rmin, max: rmax }
|
53
53
|
end
|
54
54
|
|
55
55
|
add_flow_price_range(prices, product_zone)
|
@@ -82,7 +82,7 @@ module Spree
|
|
82
82
|
rmin = min&.amount&.to_s(:rounded, precision: 0) || 0
|
83
83
|
rmax = max&.amount&.to_s(:rounded, precision: 0) || 0
|
84
84
|
|
85
|
-
prices[currency] =
|
85
|
+
prices[currency] = { min: rmin, max: rmax }
|
86
86
|
prices
|
87
87
|
end
|
88
88
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowcommerce_spree
|
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
|
- Aurel Branzeanu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-02-
|
12
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|