cmi_gateway 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/README.md +20 -9
- data/lib/cmi_gateway/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1411e801d20837ade986d35997cc52b7b6375cb53e21d1fd6dbf885f3d84f85
|
|
4
|
+
data.tar.gz: eb5df722b216b0f16f11ba14efdca9dacc3216b6244a0428a33cce6c6ac70953
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 328328e887c9cb4ab6c41a057c325b01d28099517c81f99f94fde9778abd6dc50fac8e658e6d50bf266a152b1002b349972bd5f7a5bac19313331d719d802a0c
|
|
7
|
+
data.tar.gz: 62e2122298a19293268677c64059f515d94d58710ed2fb870a4c71fbcfcdae1b532c26aa31b842aa397ebae251ae317f0e52a31397bf531859b9d77b20690b5c
|
data/CHANGELOG.md
CHANGED
|
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
|
|
14
|
-
- `CmiGateway::Configuration` and global `CmiGateway.configure` for environment and merchant profiles
|
|
14
|
+
- `CmiGateway::Configuration` and global `CmiGateway.configure` for environment and named merchant profiles.
|
|
15
15
|
- `CmiGateway::Checkout` — 3D Pay Hosting parameter build, SHA-512 hash (`ver3`), test/production gateway URLs.
|
|
16
16
|
- `CmiGateway::Callback` — parse callback params; `success?` from `ProcReturnCode` / `Response`.
|
|
17
17
|
- `CmiGateway::Helpers` — amount formatting, hash escaping, transliteration helpers.
|
data/README.md
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
# cmi_gateway
|
|
2
2
|
|
|
3
|
+
[](https://rubygems.org/gems/cmi_gateway)
|
|
4
|
+
|
|
3
5
|
Ruby helpers for **CMI (Centre Monétique Interbancaire)** [3D Pay Hosting](https://www.cmi.co.ma/) integration: build signed checkout form parameters (SHA-512 + Base64) and parse server callbacks.
|
|
4
6
|
|
|
7
|
+
- **RubyGems:** [rubygems.org/gems/cmi_gateway](https://rubygems.org/gems/cmi_gateway)
|
|
5
8
|
- **No Rails required** — uses only the Ruby standard library.
|
|
6
|
-
- **Multiple merchant profiles** (e.g.
|
|
9
|
+
- **Multiple merchant profiles** (e.g. multiple CMI merchant accounts) via `CmiGateway.configure`.
|
|
7
10
|
|
|
8
11
|
## Installation
|
|
9
12
|
|
|
10
13
|
Add to your `Gemfile`:
|
|
11
14
|
|
|
15
|
+
```ruby
|
|
16
|
+
gem "cmi_gateway", "~> 0.1"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
From GitHub instead of RubyGems (edge / contribution):
|
|
20
|
+
|
|
12
21
|
```ruby
|
|
13
22
|
gem "cmi_gateway", github: "merouaneamqor/cmi_gateway"
|
|
14
|
-
#
|
|
23
|
+
# local path during development:
|
|
15
24
|
# gem "cmi_gateway", path: "../cmi_gateway"
|
|
16
25
|
```
|
|
17
26
|
|
|
@@ -32,11 +41,13 @@ CmiGateway.configure do |config|
|
|
|
32
41
|
config.client_id = ENV.fetch("CMI_CLIENT_ID", nil)
|
|
33
42
|
config.store_key = ENV.fetch("CMI_STORE_KEY", nil)
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
# Named profiles for additional CMI merchant accounts
|
|
45
|
+
config.add_profile(:merchant_a,
|
|
46
|
+
client_id: ENV["CMI_MERCHANT_A_CLIENT_ID"],
|
|
47
|
+
store_key: ENV["CMI_MERCHANT_A_STORE_KEY"])
|
|
48
|
+
config.add_profile(:merchant_b,
|
|
49
|
+
client_id: ENV["CMI_MERCHANT_B_CLIENT_ID"],
|
|
50
|
+
store_key: ENV["CMI_MERCHANT_B_STORE_KEY"])
|
|
40
51
|
end
|
|
41
52
|
```
|
|
42
53
|
|
|
@@ -60,8 +71,8 @@ checkout = CmiGateway::Checkout.new(
|
|
|
60
71
|
shopurl: "https://example.com",
|
|
61
72
|
lang: "fr",
|
|
62
73
|
tran_type: "PreAuth",
|
|
63
|
-
profile: :default, # or :
|
|
64
|
-
accent_strip: false, # set true for stricter
|
|
74
|
+
profile: :default, # or any named profile (:merchant_a, :merchant_b, ...)
|
|
75
|
+
accent_strip: false, # set true for stricter accent handling on hash inputs
|
|
65
76
|
extra_params: {} # merged into signed params (string keys recommended)
|
|
66
77
|
)
|
|
67
78
|
|
data/lib/cmi_gateway/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cmi_gateway
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- AMQOR MEROUANE
|
|
@@ -76,6 +76,7 @@ licenses:
|
|
|
76
76
|
metadata:
|
|
77
77
|
homepage_uri: https://github.com/merouaneamqor/cmi_gateway
|
|
78
78
|
source_code_uri: https://github.com/merouaneamqor/cmi_gateway
|
|
79
|
+
rubygems_uri: https://rubygems.org/gems/cmi_gateway
|
|
79
80
|
changelog_uri: https://github.com/merouaneamqor/cmi_gateway/blob/master/CHANGELOG.md
|
|
80
81
|
bug_tracker_uri: https://github.com/merouaneamqor/cmi_gateway/issues
|
|
81
82
|
post_install_message:
|