tappay_ruby 0.16.1 → 0.18.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: 15c44ff4750b4c720db7deb88827b0472dd40ee4c98ca1651bd4b54b25d31566
4
- data.tar.gz: 199a823aa6332a3d12769bdf9b0ef32d938aba6594f3365d1d8a3212d3475837
3
+ metadata.gz: 1d06f24c2fae0e6d7e9bf2f589d387734618b6c9f4160d2df442c48107f8ce3b
4
+ data.tar.gz: 3742650a721c61ed68f158f7f01154d2f64540803f189fdd2c7d38f3aa524fe3
5
5
  SHA512:
6
- metadata.gz: 3c8730263b0071ebdcee35dc634eb5abd7f863a37ff4c2132511579ae0988496d22236a3467215365157fea82fac33aca99fc4825606020787b4591b4463a33d
7
- data.tar.gz: '095757caf7c639691c14269e86bb246a01f90083cf1115a725381061da3a7daf23021c3861c6d1ca4e189e2b5ea48f52592013d3daa6a2628e2bfd5e075b001e'
6
+ metadata.gz: df1a67d479b3a5f535be4eb6350e239c771dd63fe4ade24e796034c3a5c7b4b0160fe8cf40b358895a25126f90b427ddee95dd463aec9c9212a2951b47d16bcb
7
+ data.tar.gz: 327235b6a060a2316c117d2b0ec18b5f51dc4be7def55d61457fd32d9a410abf3dc773a4595870c5e4efe2eb3631e58e4fc894b10c916dce97ebab3a3bdcb666
data/lib/tappay/client.rb CHANGED
@@ -9,6 +9,7 @@ module Tappay
9
9
 
10
10
  def initialize(options = {})
11
11
  @options = options
12
+ @timeout = options.fetch(:timeout, 25)
12
13
  end
13
14
 
14
15
  def post(url, data)
@@ -35,7 +36,7 @@ module Tappay
35
36
  end
36
37
 
37
38
  def timeout
38
- 25 # seconds
39
+ @timeout
39
40
  end
40
41
 
41
42
  def validate_response
@@ -45,7 +46,7 @@ module Tappay
45
46
  status = data['status']
46
47
  # For transaction queries, status 2 means no records found, which is a valid response
47
48
  unless status.zero? || (status == 2 && @response.request.uri.path.include?('/tpc/transaction/query'))
48
- raise APIError.new(data['status'], data['msg'])
49
+ raise APIError.new(data['status'], data['msg'], data)
49
50
  end
50
51
  when 400
51
52
  raise ValidationError, "Invalid request: #{@response.body}"
data/lib/tappay/errors.rb CHANGED
@@ -9,11 +9,12 @@ module Tappay
9
9
  class QueryError < Error; end
10
10
 
11
11
  class APIError < Error
12
- attr_reader :code, :message
12
+ attr_reader :code, :message, :response_data
13
13
 
14
- def initialize(code, message)
14
+ def initialize(code, message, response_data = nil)
15
15
  @code = code
16
16
  @message = message
17
+ @response_data = response_data
17
18
  super("TapPay API Error (#{code}): #{message}")
18
19
  end
19
20
  end
data/lib/tappay/refund.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  module Tappay
2
2
  class Refund < Client
3
3
  def initialize(options = {})
4
- super
4
+ super(timeout: 30)
5
+ @options = options
5
6
  validate_options!
6
7
  end
7
8
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tappay
4
- VERSION = "0.16.1"
4
+ VERSION = '0.18.0'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tappay_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zac
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-26 00:00:00.000000000 Z
10
+ date: 2025-02-05 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: httparty