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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c97198a524328f6200fc9b97710753837cb1b714ce85a1fa63edee8218c529d
4
- data.tar.gz: 34b389efec7b6f48e6a5a451fdd0882cc36d52505d2528a4ee766d9baf32242e
3
+ metadata.gz: e1411e801d20837ade986d35997cc52b7b6375cb53e21d1fd6dbf885f3d84f85
4
+ data.tar.gz: eb5df722b216b0f16f11ba14efdca9dacc3216b6244a0428a33cce6c6ac70953
5
5
  SHA512:
6
- metadata.gz: 04c936c4c22cce98adfc2ee290db15f46f1e474f277f4fce47e87777ce8e736595b7d1d709bb3b5bcc4f59f57d428c1e96a6b0f00be25260190ae3e975449013
7
- data.tar.gz: 47b3153a671f1c6d34e5f69d253bdfc1413ec6fbb2f9dc1b1a4041a5ebb3ee94e73cd3c5facd40b5e8983b738ee36b3c7f432eb4be80feaa400233ddfe9c4a8a
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 (default + named, e.g. `:vc`).
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
+ [![Gem Version](https://badge.fury.io/rb/cmi_gateway.svg)](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. default + VC) via `CmiGateway.configure`.
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
- # or, during development:
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
- vc_id = ENV["CMI_VC_CLIENT_ID"].to_s.strip
36
- vc_key = ENV["CMI_VC_STORE_KEY"].to_s.strip
37
- if !vc_id.empty? && !vc_key.empty?
38
- config.add_profile(:vc, client_id: vc_id, store_key: vc_key)
39
- end
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 :vc when configured
64
- accent_strip: false, # set true for stricter VC-style accent handling on hash inputs
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CmiGateway
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
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.0
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: