bml_connect 0.1.0 → 0.2.0

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: 91517f1cbbf91c13d81d93227136d7a53c5ed19d1668f035675c364c4c67f96f
4
- data.tar.gz: 460a93c1c771a53f56fd7fdbbfa6183031e2862b82cf75e08b273f0ccfe52aee
3
+ metadata.gz: 748683ae421417ab2febc03a08cc8925e6c0a3a7f58834fae3bff1be14dd5c0c
4
+ data.tar.gz: 4a0df16c2ba85dbd52943790e5af9280a001db5840482caf185a6060aa2faf41
5
5
  SHA512:
6
- metadata.gz: ef33690f58f716fc30f275ad3e0a3e0ddef3279eb13973a5f2c4fbe2273f6caac4b7fac56136fd320eed7ba497dcbd50349d2f0a64e40780a6ad1f7f23011d8b
7
- data.tar.gz: 8e5914d7c89ea92d8ed589d3b0cf8c3225fc2edacd68f152dbc763f42b3653f8f847a3aac4a212c7535b37843b4536e65f7ee00abe653fb05aec42e58a50ba76
6
+ metadata.gz: 2968f568d24d3c13f3d3ecf125fcd209f076b84a60601ae0d086f57f47977454819cb4c4cd8958e8ec93d812c094bbf57a4381868d52a76a7aac4c11deeb1819
7
+ data.tar.gz: 7e4db64d6656e92cae2a79fbc26b70c5476122d30fa6101b15a5e3da0405bc78d8437d720d3c4fd4d3a2e9fde21b6b344ae34be0cff0437196e2a854cf2b0d39
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2021-08-31
3
+ ## [0.1.0] - 2021-09-16
4
4
 
5
5
  - Initial release
6
+
7
+ ## [0.2.0] - 2021-09-17
8
+
9
+ ### Changes
10
+ - Downgraded ruby to >=2.3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bml_connect (0.1.0)
4
+ bml_connect (0.2.0)
5
5
  deep_merge (~> 1.2)
6
6
  faraday (~> 1.0)
7
7
  faraday_middleware (~> 1.0)
data/README.md CHANGED
@@ -24,6 +24,53 @@ Or install it yourself as:
24
24
 
25
25
  ## Usage
26
26
 
27
+ First get your API key and App ID from Merchant Portal for [`production`](https://dashboard.merchants.bankofmaldives.com.mv) or [`sandbox`](https://dashboard.uat.merchants.bankofmaldives.com.mv).
28
+
29
+ For production client:
30
+ ```ruby
31
+ require 'bml_connect`
32
+
33
+ client = BMLConnect::Client.new(api_key: '<your-api-key>', app_id: '<your-app-id>')
34
+ ```
35
+ For sandbox client:
36
+ ```ruby
37
+ require 'bml_connect`
38
+
39
+ client = BMLConnect::Client.new(api_key: '<your-api-key>', app_id: '<your-app-id>', mode: 'sandbox')
40
+ ```
41
+ In Ruby on Rails, to configure globally, add an intilializer `bml_connect.rb`:
42
+ ```ruby
43
+ module BMLConnect
44
+ class Client
45
+ BML_API_KEY = ENV['BML_MPG_KEY']
46
+ BML_APP_ID = ENV['BML_MPG_APP_ID']
47
+ BML_MODE = ENV['BML_MPG_MODE']
48
+ end
49
+ end
50
+ ````
51
+ ```ruby
52
+ client = BMLConnect::Client.new
53
+ ```
54
+ ### API Operations
55
+ To create a new transaction
56
+ ```ruby
57
+ resp = client.transactions.create({
58
+ amount: 10000,
59
+ currency: 'MVR',
60
+ redirectUrl: '<your-redirect-uri>',
61
+ localId: 'local-1',
62
+ customerReference: 'INV-0001'
63
+ })
64
+ ```
65
+ To fetch a specified transaction
66
+ ```ruby
67
+ resp = client.transactions.get(id)
68
+ ```
69
+ To transaction list
70
+ ```ruby
71
+ resp = client.transactions.list({ page: 2 })
72
+ ```
73
+ API responses are instances of [`Faraday::Response`](https://github.com/lostisland/faraday/blob/main/lib/faraday/response.rb) class, `json` encoded with symbolized names.
27
74
 
28
75
  ## Development
29
76
 
data/bml_connect.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "Using this gem you can interact with your Bank of Maldives Connect API."
13
13
  spec.homepage = "https://github.com/oxiqa/bml-connect-ruby"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.4.0"
15
+ spec.required_ruby_version = ">= 2.3.0"
16
16
 
17
17
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
18
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BMLConnect
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bml_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - oxiqa
@@ -139,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - ">="
141
141
  - !ruby/object:Gem::Version
142
- version: 2.4.0
142
+ version: 2.3.0
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - ">="