paygate-ruby 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
- SHA1:
3
- metadata.gz: 94ae69b205891118dbdcf53110677f1d1eb145f8
4
- data.tar.gz: a14d5e2e97db1fedb38d78bf172c4d81b1bd4932
2
+ SHA256:
3
+ metadata.gz: 5c14a70c282c1f4f93ac7e45f2de15fe88f9af2bd4f4e0dab3d5274ecb1b6499
4
+ data.tar.gz: 24158c084acd02c3d26967e5ca8f9c5e9483649e1a0d26cb26883b5d5cd3bb93
5
5
  SHA512:
6
- metadata.gz: 07ed664ec754e7053cee81863a115a636ac653e574fd5d98eaacee595bc64636c3452a270aa822ec566c3b1be75172562104a701803534ae1b47819d539b16d0
7
- data.tar.gz: 065a10db16ac830a4eab4c04bcc0a7c1b3c484ad45038c5921f9f0ccabd780a13e4ebe8549cbe0475491483097968775bb7faad25bb6d53c5f269e52f0c6b265
6
+ metadata.gz: d041fa6ccf284ab752f62429da877f31b672b85f1b2846c64dd2d1932a4c49b1b8205eca6563fddaa908114ce67a8c35497c3ce3ec0d05db7e439d8702692578
7
+ data.tar.gz: 30da4f2cbd4dae440e78b93b3b927486f7a4e5c8040841e71bb57d47bb3a7f215e6ffe26bd5dbdb6ae4ca1acaf96fb3bc3c2041540e734ce3b15064f6a6c3ae5
data/README.md CHANGED
@@ -217,7 +217,8 @@ Cancel the transaction.
217
217
 
218
218
  ```ruby
219
219
  response = member.cancel_transaction('testmid_123456.654321', amount: 1000)
220
- => #<Paygate::Response:0x007fbf3d111940 @transaction_type=:cancel, @http_code="200", @message="OK", @body="callback({\"replyCode\":\"0000\",\"replyMessage\":\"Response has been completed\",\"content\":{\"object\":\"CancelAPI tid:testmid_123456.654321 SUCCESS payRsltCode:0000\"}})", @json={"replyCode"=>"0000", "replyMessage"=>"Response has been completed", "content"=>{"object"=>"CancelAPI tid:testmid_123456.654321 SUCCESS payRsltCode:0000"}}>
220
+ => #<Paygate::Response:0x007fbf3d111940 @transaction_type=:cancel, @http_code="200", @message="OK", @body="callback({\"replyCode\":\"0000\",\"replyMessage\":\"Response has been completed\",\"content\":{\"object\":\"CancelAPI tid:testmid_123456.654321 SUCCESS payRsltCode:0000\"}})", @json={"replyCode"=>"0000", "replyMessage"=>"Response has been completed", "content"=>{"object"=>"CancelAPI tid:testmid_123456.654321 SUCCESS payRsltCode:0000"}}, @raw_info=
221
+ #<OpenStruct tid="testmid_123456.654321", tid_enc="AES256XQIdNnkzFwMQmhF7fuJhS3m0\n", request_url="https://service.paygate.net/service/cancelAPI.json?callback=callback&mid=testmid&tid=AES256XQIdNnkzFwMQmhF7fuJhS3m0%0A&amount=1000">>
221
222
  ```
222
223
 
223
224
  Here, _testmid_123456.654321_ is `tid` of the transaction you want to cancel.
@@ -233,6 +234,12 @@ response.http_code
233
234
 
234
235
  response.json
235
236
  => {"replyCode"=>"0000", "replyMessage"=>"Response has been completed", "content"=>{"object"=>"CancelAPI tid:testmid_123456.654321 SUCCESS payRsltCode:0000"}}
237
+
238
+ response.raw_info
239
+ => #<OpenStruct tid="testmid_123456.654321", tid_enc="AES256XQIdNnkzFwMQmhF7fuJhS3m0\n", request_url="https://service.paygate.net/service/cancelAPI.json?callback=callback&mid=testmid&tid=AES256XQIdNnkzFwMQmhF7fuJhS3m0%0A&amount=1000">
240
+
241
+ response.raw_info.request_url
242
+ => "https://service.paygate.net/service/cancelAPI.json?callback=callback&mid=testmid&tid=AES256XQIdNnkzFwMQmhF7fuJhS3m0%0A&amount=1000"
236
243
  ```
237
244
 
238
245
  Apart from these it also responds to `message` and `body`.
@@ -1,6 +1,6 @@
1
1
  module Paygate
2
2
  class Response
3
- attr_accessor :transaction_type, :http_code, :message, :body, :json
3
+ attr_accessor :transaction_type, :http_code, :message, :body, :raw_info, :json
4
4
 
5
5
  def self.build_from_net_http_response(txn_type, response)
6
6
  r = new
@@ -29,7 +29,9 @@ module Paygate
29
29
  uri.query = ::URI.encode_www_form(params)
30
30
  response = ::Net::HTTP.get_response(uri)
31
31
 
32
- Response.build_from_net_http_response(:cancel, response)
32
+ r = Response.build_from_net_http_response(:cancel, response)
33
+ r.raw_info = OpenStruct.new(tid: tid, tid_enc: tid_enc, request_url: uri.to_s)
34
+ r
33
35
  end
34
36
  end
35
37
  end
@@ -1,3 +1,3 @@
1
1
  module Paygate
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paygate-ruby
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
  - jagdeepsingh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.6.11
88
+ rubygems_version: 2.7.3
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Ruby wrapper for PayGate payment gateway