gmo_payment_gem 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +45 -0
- data/Rakefile +8 -0
- data/gmo-payment-gem.gemspec +19 -0
- data/lib/gmo_payment/api_errors.rb +1349 -0
- data/lib/gmo_payment/api_request.rb +72 -0
- data/lib/gmo_payment/api_response.rb +94 -0
- data/lib/gmo_payment/api_urls.rb +39 -0
- data/lib/gmo_payment/configurations.rb +14 -0
- data/lib/gmo_payment/custom_error.rb +1 -0
- data/lib/gmo_payment/logger.rb +10 -0
- data/lib/gmo_payment.rb +98 -0
- data/test/helper.rb +51 -0
- data/test/logs/test.log +0 -0
- data/test/test_api_errors.rb +40 -0
- data/test/test_api_request.rb +43 -0
- data/test/test_api_response.rb +105 -0
- data/test/test_api_urls.rb +21 -0
- data/test/test_configurations.rb +20 -0
- data/test/test_gmo_payment.rb +16 -0
- data/test/test_logger.rb +26 -0
- metadata +91 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 83e6d34a776342a62107ff4d734fc343333ee10b
|
4
|
+
data.tar.gz: e2711b4a153bc614c7d5b4d7d4b803d84d804585
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c969cbcbadeb2199ff7d176de22acb4651174ed3789cd42f563d90ca01a15b544c63c3b8c49b510af1612f159e59c6a7cea8d3b642f472349b1c0d4511eecda0
|
7
|
+
data.tar.gz: 6126b422a9eaa026df60cd47bf8996f03125715cb52b36a2a67d3a187126658e3889afe718fc3f25b980e59c1530d5bc25987d7c6b061b1a6182ed4b0e5f2791
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# gmo_payment_gem
|
2
|
+
Unofficial wrapper for GMO Payment Gateway API
|
3
|
+
Easy to make request to GMO Payment Gateway
|
4
|
+
|
5
|
+
### Background
|
6
|
+
* Need a simple scenario about payment,
|
7
|
+
eg: Register member and credit card info, then execute monthly payment
|
8
|
+
* Do not want to know others api with a ton of documents
|
9
|
+
* Lightweight library with no dependency, simple configurations, and extend easily
|
10
|
+
|
11
|
+
### Install
|
12
|
+
* In `Gemfile`: `gem 'gmo_payment_gem'` then `$bundle install`
|
13
|
+
* Or directly with: `$gem install gmo_payment_gem`
|
14
|
+
|
15
|
+
### Configuration
|
16
|
+
|
17
|
+
* For rails app:
|
18
|
+
In `config/environments/env_file.rb` (Eg: `config/environments/development.rb`):
|
19
|
+
```
|
20
|
+
config.after_initialize do
|
21
|
+
GmoPayment::Configurations.all = {
|
22
|
+
site_id: ENV['DEV_PAYMENT_SITE_ID'],
|
23
|
+
site_pass: ENV['DEV_PAYMENT_SITE_PASS'],
|
24
|
+
shop_id: ENV['DEV_PAYMENT_SHOP_ID'],
|
25
|
+
shop_pass: ENV['DEV_PAYMENT_SHOP_PASS'],
|
26
|
+
log_path: "#{Rails.root.to_s}/log/dev.log",
|
27
|
+
base_url: ENV['DEV_PAYMENT_BASE_URL']
|
28
|
+
}
|
29
|
+
GmoPayment::Configurations.check_valid!
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
* For other apps/libs:
|
34
|
+
Fill above config to where init your app.
|
35
|
+
|
36
|
+
* Configurations description
|
37
|
+
|
38
|
+
| Key | Required? | Value format | Description |
|
39
|
+
|:-----------|:------------- |:----- |:----- |
|
40
|
+
| site_id | Yes | String | |
|
41
|
+
| site_pass | Yes | String | |
|
42
|
+
| shop_id | Yes | String | |
|
43
|
+
| shop_pass | Yes | String | |
|
44
|
+
| log_path | Yes | String | |
|
45
|
+
| base_url | Yes | String | |
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'gmo_payment_gem'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.platform = Gem::Platform::RUBY
|
5
|
+
s.author = 'Manh Dao Van'
|
6
|
+
s.email = 'manhdaovan@gmail.com'
|
7
|
+
s.homepage = 'https://github.com/manhdaovan/gmo_payment_gem/'
|
8
|
+
s.summary = 'Simple API wrapper for GMO Payment Gateway API request'
|
9
|
+
s.description = 'Easy to make request to GMO Payment Gateway via API'
|
10
|
+
s.license = 'MIT'
|
11
|
+
|
12
|
+
s.files = `git ls-files`.split("\n")
|
13
|
+
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
14
|
+
s.require_paths = ['lib']
|
15
|
+
|
16
|
+
s.required_ruby_version = '>= 2.0.0'
|
17
|
+
s.add_development_dependency('rake')
|
18
|
+
s.add_development_dependency('webmock')
|
19
|
+
end
|