payrex-ruby 1.0.0 → 1.1.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: 0b163d86d0573bfd9fba32aedb812a8fef70e908d6a845bb6ad140228ceb6557
4
- data.tar.gz: 697201f56b4517e8301c2a19dd51eb5ac0169a9cf5c108d030e46e98257e5228
3
+ metadata.gz: 8a8b57aa6a3d5a7920de9caffda7ee930334ae2d5f2c2570312c21c6719afd0a
4
+ data.tar.gz: 235b97aa3b3cf62d45f599d1fcce73c56bdf9e8055c3573874edb3a1dca1ba9e
5
5
  SHA512:
6
- metadata.gz: d752ed1ee7211e8006e0fc3389176c0ce288488fa6ac6529b11b5d5c3de10d8aa336ca6b9f73768450d9378715b1cbac6d9155385adf380d6ed0b3b1e432bd0b
7
- data.tar.gz: 211a0f662d966a9ae5bdf1cad6d55fcec1efe60e4439fcdd3f9bbca96c53042a401e80ef19ec8aa18131ca0c8298415b4b591bfbbcdcbb66f0c78eba7cf88c3c
6
+ metadata.gz: 697a904549ec2db1cd0db509ce662858cecde4caa92f37676da6fa8f0e2d5ab884c1b7a3047412ba8562a8951e1e4c2f095cc64a5185998fcbcc889ec1abc8c3
7
+ data.tar.gz: c7cc2faf27059e148c996c958c046ae6ef1bbdea9cdba9e218241eec8eef9893bfae526f55cbd9e42f966dab23a23c73c53e6d223a4b1da5548799e58c28c4a0
@@ -14,6 +14,7 @@ module Payrex
14
14
  :livemode,
15
15
  :metadata,
16
16
  :payment_intent,
17
+ :statement_descriptor,
17
18
  :status,
18
19
  :payment_settings,
19
20
  :customer,
@@ -36,6 +37,7 @@ module Payrex
36
37
  @livemode = data["livemode"]
37
38
  @metadata = data["metadata"]
38
39
  @payment_intent = data["payment_intent"]
40
+ @statement_descriptor = data["statement_descriptor"]
39
41
  @status = data["status"]
40
42
  @payment_settings = data["payment_settings"]
41
43
  @customer = data["customer"]
@@ -14,6 +14,7 @@ module Payrex
14
14
  :payment_method_id,
15
15
  :payment_methods,
16
16
  :payment_method_options,
17
+ :statement_descriptor,
17
18
  :status,
18
19
  :next_action,
19
20
  :return_url,
@@ -35,6 +36,7 @@ module Payrex
35
36
  @payment_method_id = api_resource.data["payment_method_id"]
36
37
  @payment_methods = api_resource.data["payment_methods"]
37
38
  @payment_method_options = api_resource.data["payment_method_options"]
39
+ @statement_descriptor = api_resource.data["statement_descriptor"]
38
40
  @status = api_resource.data["status"]
39
41
  @next_action = api_resource.data["next_action"]
40
42
  @return_url = api_resource.data["return_url"]
data/lib/http_client.rb CHANGED
@@ -12,7 +12,7 @@ module Payrex
12
12
 
13
13
  response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
14
14
 
15
- raise StandardError.new(response.to_s) if response.body.nil?
15
+ return nil if response.body.nil?
16
16
 
17
17
  handle_error(response) if failed?(response)
18
18
 
@@ -18,6 +18,8 @@ module Payrex
18
18
  data = api_resource.data["data"].map { |data| object.new(Payrex::ApiResource.new(data)) }
19
19
 
20
20
  Payrex::Entities::Listing.new(data: data, has_more: api_resource.data["has_more"])
21
+ elsif object.nil?
22
+ nil
21
23
  else
22
24
  object.new(api_resource)
23
25
  end
@@ -49,30 +49,35 @@ module Payrex
49
49
  )
50
50
  end
51
51
 
52
- def finalize(id, payload)
52
+ def finalize(id)
53
53
  request(
54
54
  method: :post,
55
55
  object: Payrex::Entities::BillingStatement,
56
- path: "#{PATH}/#{id}/finalize",
57
- payload: payload
56
+ path: "#{PATH}/#{id}/finalize"
57
+ )
58
+ end
59
+
60
+ def send(id)
61
+ request(
62
+ method: :post,
63
+ object: nil,
64
+ path: "#{PATH}/#{id}/send"
58
65
  )
59
66
  end
60
67
 
61
- def void(id, payload)
68
+ def void(id)
62
69
  request(
63
70
  method: :post,
64
71
  object: Payrex::Entities::BillingStatement,
65
- path: "#{PATH}/#{id}/void",
66
- payload: payload
72
+ path: "#{PATH}/#{id}/void"
67
73
  )
68
74
  end
69
75
 
70
- def mark_uncollectible(id, payload)
76
+ def mark_uncollectible(id)
71
77
  request(
72
78
  method: :post,
73
79
  object: Payrex::Entities::BillingStatement,
74
- path: "#{PATH}/#{id}/mark_uncollectible",
75
- payload: payload
80
+ path: "#{PATH}/#{id}/mark_uncollectible"
76
81
  )
77
82
  end
78
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payrex-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayRex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-04 00:00:00.000000000 Z
11
+ date: 2025-02-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: PayRex Ruby Library
14
14
  email: support@payrexhq.com