bml_connect 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/Gemfile.lock +1 -1
- data/README.md +47 -0
- data/bml_connect.gemspec +1 -1
- data/lib/bml_connect/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: 748683ae421417ab2febc03a08cc8925e6c0a3a7f58834fae3bff1be14dd5c0c
|
4
|
+
data.tar.gz: 4a0df16c2ba85dbd52943790e5af9280a001db5840482caf185a6060aa2faf41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2968f568d24d3c13f3d3ecf125fcd209f076b84a60601ae0d086f57f47977454819cb4c4cd8958e8ec93d812c094bbf57a4381868d52a76a7aac4c11deeb1819
|
7
|
+
data.tar.gz: 7e4db64d6656e92cae2a79fbc26b70c5476122d30fa6101b15a5e3da0405bc78d8437d720d3c4fd4d3a2e9fde21b6b344ae34be0cff0437196e2a854cf2b0d39
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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.
|
15
|
+
spec.required_ruby_version = ">= 2.3.0"
|
16
16
|
|
17
17
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
18
|
|
data/lib/bml_connect/version.rb
CHANGED
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.
|
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.
|
142
|
+
version: 2.3.0
|
143
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
145
|
- - ">="
|