kasikornbank 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: 24b6b6162bb8f90cfb3e111aefb7c6651cf0b8d6
4
- data.tar.gz: ba537aaf1ed98e2b038fc41ac8631e7e7f1d6359
3
+ metadata.gz: e9d8c9665a7b2e1714923778958d9e969f9aa3d3
4
+ data.tar.gz: a491fbc6e3bdb79d76f440bfa6edaddc420b67a2
5
5
  SHA512:
6
- metadata.gz: f1d6d43d71f7b9d085ea466cdb38154e4a46227e33a513552d44b1b1e9ffa10a6a82350714cc503148a29145df02f5076a5e64d7a03bc3cc7bd277bb1fafecf6
7
- data.tar.gz: f48e9ecc30ff56f23a52d7d6e50abcd5eb4a3d2652c4f835e561e75a0a9db28421c26a26ebcc9686df09411ab8c06d019f23227795e10bc4ea6563afadbdc06d
6
+ metadata.gz: c9cb2f53ca6f9c513eae1617f66216548b6f67c40d17adab2020ea3480c33b4637e7e74e53f9be6c221ce6d8e34730626e0c5461e26388e5051fb59614df0ed9
7
+ data.tar.gz: cfd3cc9c611af14315b7ae61b6821a07305ad390161511b32ef47e8bf98166339975d13a5b738798b48e66f270fd1624a9a6fb45b7dd5a9724c73071960b34e1
data/README.md CHANGED
@@ -13,7 +13,7 @@ K-Payment Gateway (Kasikorn Bank Payment Gateway)
13
13
  Add this line to your application's Gemfile:
14
14
 
15
15
  ```ruby
16
- gem 'kasikornbank', '~> 0.1.3'
16
+ gem 'kasikornbank', '~> 0.1.4'
17
17
  ```
18
18
 
19
19
  And then execute:
@@ -71,7 +71,7 @@ kbank = Kasikornbank::Render.new({
71
71
  `shop_id` = <**Optional**> Shop ID, for payment template, see documentation.
72
72
  `payterm2` = <**Optional**> Number of month for installment.
73
73
 
74
- > :exclamation: Unfortunately, Kasikorn Bank doesn't have a proper way to handle payment API. In this case `Kasikornbank::Render.new()` will generage auto submit form and return it with `form` method. This form should be placed in `checkout#create` view file.
74
+ > :exclamation: Unfortunately, Kasikorn Bank doesn't have a proper way to handle payment API. In this case `Kasikornbank::Render.new()` will generage auto submit form and return it with `post` method. This form should be placed in `checkout#create` view file.
75
75
 
76
76
  #### Example
77
77
 
@@ -133,7 +133,7 @@ def kbank_response
133
133
  checkout = Checkout.find(kbank[:invoice])
134
134
  end
135
135
  ```
136
-
136
+ _\# Response will be `{:respcode=>"00", :response=>"success", :invoice=>"21", :amount=>1.0, :auth_code=>"140580"}`_
137
137
  > Controller name, routes, response url can be replaced with name you like.
138
138
 
139
139
  ## Development
@@ -10,17 +10,20 @@ module Kasikornbank
10
10
  response = Hash.new
11
11
  if @params[:PMGWRESP2]
12
12
  str = @params[:PMGWRESP2]
13
+ response[:respcode] = str[97...99]
13
14
  response[:response] = response_code(str[97...99])
14
15
  response[:invoice] = remove_lead_zero(str[32...44])
15
16
  response[:amount] = amount(str[85...97])
16
17
  response[:auth_code] = nil
17
18
  elsif @params[:HOSTRESP]
19
+ response[:respcode] = @params[:HOSTRESP]
18
20
  response[:response] = response_code(@params[:HOSTRESP])
19
21
  response[:invoice] = remove_lead_zero(@params[:RETURNINV])
20
22
  response[:amount] = amount(@params[:AMOUNT])
21
23
  response[:auth_code] = @params[:AUTHCODE]
22
24
  elsif @params[:PMGWRESP]
23
25
  str = @params[:PMGWRESP]
26
+ response[:respcode] = str[0...2]
24
27
  response[:response] = response_code(str[0...2])
25
28
  response[:invoice] = remove_lead_zero(str[56...68])
26
29
  response[:amount] = amount(str[82...94])
@@ -1,3 +1,3 @@
1
1
  module Kasikornbank
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasikornbank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Antonov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler