easypost 6.1.1 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78ff932eb3d904ba184e444260e54f89bc1130fa7a93f5483c3a322071035d99
4
- data.tar.gz: 51fd77d26ae8bb1351880956a47cdcd1529c84e51f26a209b125e28a67b6fa9f
3
+ metadata.gz: ae0d691e3f798606f4153ba71f6d148e3d12eeade8dddec8ab8b06cbd9420173
4
+ data.tar.gz: 92ad3799e9d50460a99844d28c456050fe58ad78d3b440520a429623adc851a5
5
5
  SHA512:
6
- metadata.gz: 21b04b15fa14c1f82bdaf7b208201f66f186c8c5b6adc4d1a4e9040e93232b9c4f3793f0a5064eaaafca269818a75e2e7b33c6cb0476793da48735d087045da3
7
- data.tar.gz: 15525784bb626e44c1469513ebc16663b8f8b0c882c46270514783118f21dc6b7b2afb4ec092fedfb0eae17325acb46a671292db385fae7a2dffca58de7d1ec9
6
+ metadata.gz: 417aea06119816b367ae0e7eeaada243b1c3a266fb784f36df681130a617bf37bfe6d80a02c0c6aa72c4b1e210f2a220ce67aec37803dc9b04735df08c073b78
7
+ data.tar.gz: 5f550b00033885606ac1f9438696549b40b5602368c39985dded593b666782eaaf05887cbbe3a28afe996e05163c2f30e1740825c27c14e08a1c46f591d01e2e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v6.2.0 (2024-04-10)
4
+
5
+ - Fix payment method funding and deletion failures due to undetermined payment method type
6
+ - Add `refund` function in Insurance service for requesting a refund for standalone insurance.
7
+
3
8
  ## v6.1.1 (2024-01-23)
4
9
 
5
10
  - Fix issues funding wallet due to invalid internal function call
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.1.1
1
+ 6.2.0
@@ -62,15 +62,15 @@ class EasyPost::Services::Billing < EasyPost::Services::Service
62
62
  end
63
63
 
64
64
  payment_method_id = payment_methods[payment_method_to_use]['id']
65
+ payment_method_object_type = payment_methods[payment_method_to_use]['object']
65
66
 
66
- unless payment_method_id.nil?
67
- if payment_method_id.start_with?('card_')
68
- endpoint = '/credit_cards'
69
- elsif payment_method_id.start_with?('bank_')
70
- endpoint = '/bank_accounts'
71
- else
72
- raise EasyPost::Errors::InvalidObjectError.new(error_string)
73
- end
67
+ if payment_method_object_type == 'CreditCard'
68
+
69
+ endpoint = '/credit_cards'
70
+ elsif payment_method_object_type == 'BankAccount'
71
+ endpoint = '/bank_accounts'
72
+ else
73
+ raise EasyPost::Errors::InvalidObjectError.new(error_string)
74
74
  end
75
75
 
76
76
  [endpoint, payment_method_id]
@@ -34,4 +34,11 @@ class EasyPost::Services::Insurance < EasyPost::Services::Service
34
34
 
35
35
  all(params)
36
36
  end
37
+
38
+ # Refund an Insurance object
39
+ def refund(id)
40
+ response = @client.make_request(:post, "insurances/#{id}/refund")
41
+
42
+ EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS)
43
+ end
37
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easypost
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.1
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - EasyPost Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-23 00:00:00.000000000 Z
11
+ date: 2024-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman