razorpay 2.4.0 → 3.2.4

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.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/.cursorignore +174 -0
  3. data/.github/dependabot.yml +8 -0
  4. data/.github/pull_request_template.md +8 -0
  5. data/.github/workflows/ci.yml +80 -0
  6. data/.github/workflows/ruby.yml +38 -0
  7. data/CHANGELOG.md +85 -1
  8. data/README.md +48 -137
  9. data/documents/Invoice.md +539 -0
  10. data/documents/account.md +449 -0
  11. data/documents/addon.md +191 -0
  12. data/documents/card.md +655 -0
  13. data/documents/customer.md +405 -0
  14. data/documents/dispute.md +301 -0
  15. data/documents/documents.md +65 -0
  16. data/documents/emandate.md +492 -0
  17. data/documents/fund.md +89 -0
  18. data/documents/items.md +208 -0
  19. data/documents/oauth_token.md +142 -0
  20. data/documents/order.md +352 -0
  21. data/documents/papernach.md +738 -0
  22. data/documents/payment.md +1122 -0
  23. data/documents/paymentLink.md +1063 -0
  24. data/documents/paymentVerification.md +79 -0
  25. data/documents/plan.md +184 -0
  26. data/documents/productConfiguration.md +444 -0
  27. data/documents/qrcode.md +439 -0
  28. data/documents/refund.md +325 -0
  29. data/documents/registerEmandate.md +452 -0
  30. data/documents/registerNach.md +653 -0
  31. data/documents/settlement.md +478 -0
  32. data/documents/stakeholder.md +334 -0
  33. data/documents/subscriptions.md +752 -0
  34. data/documents/tokens.md +407 -0
  35. data/documents/transfers.md +821 -0
  36. data/documents/upi.md +545 -0
  37. data/documents/virtualAccount.md +591 -0
  38. data/documents/webhook.md +224 -0
  39. data/lib/razorpay/account.rb +39 -0
  40. data/lib/razorpay/addon.rb +9 -1
  41. data/lib/razorpay/card.rb +4 -0
  42. data/lib/razorpay/constants.rb +7 -2
  43. data/lib/razorpay/customer.rb +31 -0
  44. data/lib/razorpay/dispute.rb +26 -0
  45. data/lib/razorpay/document.rb +19 -0
  46. data/lib/razorpay/fund_account.rb +19 -0
  47. data/lib/razorpay/iin.rb +15 -0
  48. data/lib/razorpay/invoice.rb +8 -0
  49. data/lib/razorpay/item.rb +34 -0
  50. data/lib/razorpay/oauth_token.rb +109 -0
  51. data/lib/razorpay/order.rb +19 -1
  52. data/lib/razorpay/payload_validator.rb +93 -0
  53. data/lib/razorpay/payment.rb +64 -0
  54. data/lib/razorpay/payment_link.rb +36 -0
  55. data/lib/razorpay/payment_method.rb +17 -0
  56. data/lib/razorpay/product.rb +37 -0
  57. data/lib/razorpay/qr_code.rb +34 -0
  58. data/lib/razorpay/refund.rb +4 -0
  59. data/lib/razorpay/request.rb +50 -26
  60. data/lib/razorpay/settlement.rb +39 -0
  61. data/lib/razorpay/stakeholder.rb +39 -0
  62. data/lib/razorpay/subscription.rb +24 -0
  63. data/lib/razorpay/subscription_registration.rb +16 -0
  64. data/lib/razorpay/token.rb +28 -0
  65. data/lib/razorpay/transfer.rb +39 -0
  66. data/lib/razorpay/utility.rb +41 -6
  67. data/lib/razorpay/validation_config.rb +11 -0
  68. data/lib/razorpay/virtual_account.rb +15 -7
  69. data/lib/razorpay/webhook.rb +50 -0
  70. data/lib/razorpay.rb +24 -1
  71. data/razorpay-ruby.gemspec +2 -1
  72. data/test/fixtures/addon_collection.json +60 -0
  73. data/test/fixtures/create_json_payment.json +13 -0
  74. data/test/fixtures/delete_token.json +3 -0
  75. data/test/fixtures/dispute_collection.json +67 -0
  76. data/test/fixtures/dispute_error.json +10 -0
  77. data/test/fixtures/document_error.json +10 -0
  78. data/test/fixtures/downtimes_collection.json +21 -0
  79. data/test/fixtures/empty.json +2 -0
  80. data/test/fixtures/error_customer.json +10 -0
  81. data/test/fixtures/error_eligibility.json +10 -0
  82. data/test/fixtures/error_eligibility_check.json +10 -0
  83. data/test/fixtures/fake_account.json +78 -0
  84. data/test/fixtures/fake_addon.json +3 -3
  85. data/test/fixtures/fake_bank_account.json +9 -0
  86. data/test/fixtures/fake_card_reference.json +5 -0
  87. data/test/fixtures/fake_create_upi_payment.json +3 -0
  88. data/test/fixtures/fake_direct_transfer.json +32 -0
  89. data/test/fixtures/fake_dispute.json +29 -0
  90. data/test/fixtures/fake_document.json +9 -0
  91. data/test/fixtures/fake_downtime.json +14 -0
  92. data/test/fixtures/fake_eligiblity.json +79 -0
  93. data/test/fixtures/fake_fulfillment.json +10 -0
  94. data/test/fixtures/fake_fund_account.json +18 -0
  95. data/test/fixtures/fake_iin_token.json +23 -0
  96. data/test/fixtures/fake_instant_settlement.json +19 -0
  97. data/test/fixtures/fake_item.json +9 -0
  98. data/test/fixtures/fake_oauth_token.json +8 -0
  99. data/test/fixtures/fake_order_transfers.json +88 -0
  100. data/test/fixtures/fake_otp_generate.json +19 -0
  101. data/test/fixtures/fake_otp_resend.json +7 -0
  102. data/test/fixtures/fake_otp_submit.json +5 -0
  103. data/test/fixtures/fake_payment_expanded_details.json +38 -0
  104. data/test/fixtures/fake_payment_expanded_details_card.json +50 -0
  105. data/test/fixtures/fake_payment_link.json +40 -0
  106. data/test/fixtures/fake_pending_update.json +30 -0
  107. data/test/fixtures/fake_product.json +138 -0
  108. data/test/fixtures/fake_qrcode.json +20 -0
  109. data/test/fixtures/fake_qrcode_close.json +22 -0
  110. data/test/fixtures/fake_recurring.json +5 -0
  111. data/test/fixtures/fake_refund.json +1 -1
  112. data/test/fixtures/fake_revoke_token.json +3 -0
  113. data/test/fixtures/fake_rto.json +15 -0
  114. data/test/fixtures/fake_settlement.json +11 -0
  115. data/test/fixtures/fake_settlement_on_demand.json +39 -0
  116. data/test/fixtures/fake_stakeholder.json +29 -0
  117. data/test/fixtures/fake_subscription_pause.json +19 -0
  118. data/test/fixtures/fake_subscription_registration.json +91 -0
  119. data/test/fixtures/fake_subscription_resume.json +19 -0
  120. data/test/fixtures/fake_token.json +31 -0
  121. data/test/fixtures/fake_tokenise_customer.json +40 -0
  122. data/test/fixtures/fake_transfer.json +18 -0
  123. data/test/fixtures/fake_transfer_reverse.json +15 -0
  124. data/test/fixtures/fake_update_payment.json +39 -0
  125. data/test/fixtures/fake_validate_vpa.json +5 -0
  126. data/test/fixtures/fake_virtual_account_allowed.json +46 -0
  127. data/test/fixtures/fake_virtual_account_receiver.json +46 -0
  128. data/test/fixtures/fake_webhook.json +79 -0
  129. data/test/fixtures/fake_webhook_by_account_id.json +22 -0
  130. data/test/fixtures/fetch_tnc.json +11 -0
  131. data/test/fixtures/fund_collection.json +20 -0
  132. data/test/fixtures/item_collection.json +24 -0
  133. data/test/fixtures/order_error.json +10 -0
  134. data/test/fixtures/payment_collection.json +1 -1
  135. data/test/fixtures/payment_error.json +10 -0
  136. data/test/fixtures/payment_link_collection.json +43 -0
  137. data/test/fixtures/payment_link_response.json +3 -0
  138. data/test/fixtures/payment_methods_collection.json +149 -0
  139. data/test/fixtures/qrcode_collection.json +50 -0
  140. data/test/fixtures/qrcode_payments_collection.json +74 -0
  141. data/test/fixtures/reversals_collection.json +22 -0
  142. data/test/fixtures/settlement_collection.json +26 -0
  143. data/test/fixtures/settlement_instant_collection.json +84 -0
  144. data/test/fixtures/settlement_report_collection.json +117 -0
  145. data/test/fixtures/stakeholder_collection.json +35 -0
  146. data/test/fixtures/success.json +3 -0
  147. data/test/fixtures/tokens_collection.json +36 -0
  148. data/test/fixtures/transfer_error.json +10 -0
  149. data/test/fixtures/transfer_settlements_collection.json +38 -0
  150. data/test/fixtures/transfers_collection.json +41 -0
  151. data/test/fixtures/webhook_by_account_collection.json +35 -0
  152. data/test/fixtures/webhook_collection.json +85 -0
  153. data/test/razorpay/test_account.rb +134 -0
  154. data/test/razorpay/test_addon.rb +19 -15
  155. data/test/razorpay/test_card.rb +6 -0
  156. data/test/razorpay/test_customer.rb +132 -3
  157. data/test/razorpay/test_dispute.rb +98 -0
  158. data/test/razorpay/test_document.rb +27 -0
  159. data/test/razorpay/test_fund_account.rb +42 -0
  160. data/test/razorpay/test_iin.rb +23 -0
  161. data/test/razorpay/test_invoice.rb +15 -2
  162. data/test/razorpay/test_item.rb +66 -0
  163. data/test/razorpay/test_oauth_token.rb +105 -0
  164. data/test/razorpay/test_order.rb +66 -1
  165. data/test/razorpay/test_payload_validator.rb +61 -0
  166. data/test/razorpay/test_payment.rb +251 -9
  167. data/test/razorpay/test_payment_link.rb +83 -0
  168. data/test/razorpay/test_plan.rb +2 -2
  169. data/test/razorpay/test_product.rb +67 -0
  170. data/test/razorpay/test_qr_code.rb +63 -0
  171. data/test/razorpay/test_razorpay.rb +19 -2
  172. data/test/razorpay/test_refund.rb +16 -2
  173. data/test/razorpay/test_settlement.rb +76 -0
  174. data/test/razorpay/test_stakeholder.rb +87 -0
  175. data/test/razorpay/test_subscription.rb +72 -9
  176. data/test/razorpay/test_subscription_registration.rb +58 -0
  177. data/test/razorpay/test_token.rb +66 -0
  178. data/test/razorpay/test_transfer.rb +94 -0
  179. data/test/razorpay/test_utility.rb +72 -4
  180. data/test/razorpay/test_virtual_account.rb +64 -17
  181. data/test/razorpay/test_webhook.rb +132 -0
  182. data/test/test_helper.rb +8 -0
  183. metadata +265 -10
  184. data/.travis.yml +0 -22
  185. data/test/razorpay/test_errors.rb +0 -19
@@ -0,0 +1,132 @@
1
+ require 'test_helper'
2
+
3
+ module Razorpay
4
+ # Tests for Razorpay::Webhook
5
+ class RazorpayWebhookonTest < Minitest::Test
6
+ class Webhook < Razorpay::Entity; end
7
+
8
+ def setup
9
+ @webhook_id = 'H000000000000H'
10
+ @account_id = 'acc_00000000000001'
11
+ @alert_email = 'gaurav.kumar@example.com'
12
+ # Any request that ends with webhook_id
13
+ end
14
+
15
+ def test_product_should_be_defined
16
+ refute_nil Razorpay::Webhook
17
+ end
18
+
19
+ def test_webhook_with_account_id_should_be_available
20
+ stub_get(%r{/v2/accounts\/#{Regexp.quote(@account_id)}/webhooks\/#{Regexp.quote(@webhook_id)}$}, 'fake_webhook_by_account_id')
21
+ webhook = Razorpay::Webhook.fetch(@webhook_id, @account_id)
22
+ assert_instance_of Razorpay::Webhook, webhook, 'webhook not an instance of Webhook class'
23
+ assert_equal @webhook_id, webhook.id, 'Webhook IDs do not match'
24
+ assert_equal @alert_email, webhook.alert_email, 'webhook alert_email is accessible'
25
+ end
26
+
27
+ def test_webhook_with_account_id_should_be_create
28
+ payload = create_webhook_payload_by_account()
29
+ stub_post(%r{/v2/accounts/#{@account_id}/webhooks$}, 'fake_webhook_by_account_id', payload.to_json)
30
+
31
+ webhook = Razorpay::Webhook.create(payload.to_json, @account_id)
32
+ assert_instance_of Razorpay::Webhook, webhook, 'Webhook not an instance of Webhook class'
33
+ assert_equal @webhook_id, webhook.id, 'Webhook IDs do not match'
34
+ assert_equal @alert_email, webhook.alert_email, 'webhook alert_email is accessible'
35
+ end
36
+
37
+ def test_webhook_should_be_create
38
+ payload = create_webhook_payload()
39
+ stub_post(%r{/webhooks$}, 'fake_webhook', payload.to_json)
40
+
41
+ webhook = Razorpay::Webhook.create(payload.to_json)
42
+ assert_instance_of Razorpay::Webhook, webhook, 'Webhook not an instance of Webhook class'
43
+ assert_equal @webhook_id, webhook.id, 'Webhook IDs do not match'
44
+ assert_equal @alert_email, webhook.created_by_email, 'webhook alert_email is accessible'
45
+ end
46
+
47
+ def test_webhook_with_account_id_should_be_edit
48
+ payload = edit_webhook_payload_by_account()
49
+ stub_patch(%r{/v2/accounts/#{@account_id}/webhooks/#{@webhook_id}$}, 'fake_webhook_by_account_id', payload.to_json)
50
+
51
+ webhook = Razorpay::Webhook.edit(payload.to_json, @webhook_id, @account_id)
52
+ assert_instance_of Razorpay::Webhook, webhook, 'Webhook not an instance of Webhook class'
53
+ assert_equal @webhook_id, webhook.id, 'Webhook IDs do not match'
54
+ assert_equal @alert_email, webhook.alert_email, 'webhook alert_email is accessible'
55
+ end
56
+
57
+ def test_webhook_should_be_edit
58
+ payload = edit_webhook_payload()
59
+ stub_put(%r{/webhooks/#{@webhook_id}$}, 'fake_webhook', payload.to_json)
60
+
61
+ webhook = Razorpay::Webhook.edit(payload.to_json, @webhook_id)
62
+ assert_instance_of Razorpay::Webhook, webhook, 'Webhook not an instance of Webhook class'
63
+ assert_equal @webhook_id, webhook.id, 'Webhook IDs do not match'
64
+ assert_equal @alert_email, webhook.created_by_email, 'webhook alert_email is accessible'
65
+ end
66
+
67
+ def test_webhook_fetch_webhooks_by_account
68
+ stub_get(%r{/v2/accounts/#{@account_id}/webhooks$}, 'webhook_by_account_collection', {})
69
+
70
+ webhook = Razorpay::Webhook.all({}, @account_id)
71
+ assert_instance_of Razorpay::Collection, webhook, 'Webhook not an instance of Webhook class'
72
+ refute_empty webhook.items , 'Webhook should be more than one'
73
+ end
74
+
75
+ def test_webhook_fetch_webhooks
76
+ stub_get(%r{/webhooks$}, 'webhook_collection')
77
+
78
+ webhook = Razorpay::Webhook.all()
79
+ assert_instance_of Razorpay::Collection, webhook, 'Webhook not an instance of Webhook class'
80
+ refute_empty webhook.items , 'Webhook should be more than one'
81
+ end
82
+
83
+ def create_webhook_payload_by_account
84
+ return {
85
+ "url": "https://google.com",
86
+ "alert_email": "gaurav.kumar@example.com",
87
+ "secret": "12345",
88
+ "events": [
89
+ "payment.authorized",
90
+ "payment.failed",
91
+ "payment.captured",
92
+ "payment.dispute.created",
93
+ "refund.failed",
94
+ "refund.created"
95
+ ]
96
+ }
97
+ end
98
+
99
+ def edit_webhook_payload_by_account
100
+ return {
101
+ "url": "https://google.com",
102
+ "alert_email": "gaurav.kumar@example.com",
103
+ "secret": "12345",
104
+ "events": [
105
+ "payment.authorized"
106
+ ]
107
+ }
108
+ end
109
+
110
+ def create_webhook_payload
111
+ return {
112
+ "url": "https://google.com",
113
+ "alert_email": "gaurav.kumar@example.com",
114
+ "secret": "12345",
115
+ "events": {
116
+ "payment.authorized": "true",
117
+ "refund.created": "true",
118
+ "subscription.charged": "true"
119
+ }
120
+ }
121
+ end
122
+
123
+ def edit_webhook_payload
124
+ return {
125
+ "url": "https://google.com",
126
+ "events": {
127
+ "payment.authorized": "true",
128
+ }
129
+ }
130
+ end
131
+ end
132
+ end
data/test/test_helper.rb CHANGED
@@ -3,8 +3,10 @@ require 'simplecov'
3
3
  require 'minitest/autorun'
4
4
  require 'webmock/minitest'
5
5
  require 'razorpay'
6
+ require 'simplecov-cobertura'
6
7
 
7
8
  Coveralls.wear! if ENV['CI']
9
+ SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
8
10
 
9
11
  def fixture_file(filename)
10
12
  return '' if filename == ''
@@ -25,6 +27,12 @@ def stub_get(*args)
25
27
  stub_request(:get, url).to_return(response)
26
28
  end
27
29
 
30
+ def stub_delete(*args)
31
+ response = stub_response(*args)
32
+ url = args[0]
33
+ stub_request(:delete, url).to_return(response)
34
+ end
35
+
28
36
  def stub_post(*args)
29
37
  stub_request_with_body(:post, *args)
30
38
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: razorpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abhay Rana
8
8
  - Harman Singh
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-04-08 00:00:00.000000000 Z
12
+ date: 2026-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -26,7 +26,7 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0.14'
28
28
  - !ruby/object:Gem::Dependency
29
- name: coveralls
29
+ name: coveralls_reborn
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
@@ -67,6 +67,20 @@ dependencies:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: '12.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: simplecov-cobertura
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
70
84
  - !ruby/object:Gem::Dependency
71
85
  name: rubocop
72
86
  requirement: !ruby/object:Gem::Requirement
@@ -103,95 +117,242 @@ executables: []
103
117
  extensions: []
104
118
  extra_rdoc_files: []
105
119
  files:
120
+ - ".cursorignore"
106
121
  - ".editorconfig"
122
+ - ".github/dependabot.yml"
123
+ - ".github/pull_request_template.md"
124
+ - ".github/workflows/ci.yml"
125
+ - ".github/workflows/ruby.yml"
107
126
  - ".gitignore"
108
127
  - ".rubocop.yml"
109
128
  - ".simplecov"
110
- - ".travis.yml"
111
129
  - CHANGELOG.md
112
130
  - Gemfile
113
131
  - LICENSE.txt
114
132
  - README.md
115
133
  - Rakefile
134
+ - documents/Invoice.md
135
+ - documents/account.md
136
+ - documents/addon.md
137
+ - documents/card.md
138
+ - documents/customer.md
139
+ - documents/dispute.md
140
+ - documents/documents.md
141
+ - documents/emandate.md
142
+ - documents/fund.md
143
+ - documents/items.md
144
+ - documents/oauth_token.md
145
+ - documents/order.md
146
+ - documents/papernach.md
147
+ - documents/payment.md
148
+ - documents/paymentLink.md
149
+ - documents/paymentVerification.md
150
+ - documents/plan.md
151
+ - documents/productConfiguration.md
152
+ - documents/qrcode.md
153
+ - documents/refund.md
154
+ - documents/registerEmandate.md
155
+ - documents/registerNach.md
156
+ - documents/settlement.md
157
+ - documents/stakeholder.md
158
+ - documents/subscriptions.md
159
+ - documents/tokens.md
160
+ - documents/transfers.md
161
+ - documents/upi.md
162
+ - documents/virtualAccount.md
163
+ - documents/webhook.md
116
164
  - lib/ca-bundle.crt
117
165
  - lib/extensions/httparty/hash_conversions.rb
118
166
  - lib/razorpay.rb
167
+ - lib/razorpay/account.rb
119
168
  - lib/razorpay/addon.rb
120
169
  - lib/razorpay/card.rb
121
170
  - lib/razorpay/collection.rb
122
171
  - lib/razorpay/constants.rb
123
172
  - lib/razorpay/customer.rb
173
+ - lib/razorpay/dispute.rb
174
+ - lib/razorpay/document.rb
124
175
  - lib/razorpay/entity.rb
125
176
  - lib/razorpay/errors.rb
126
177
  - lib/razorpay/errors/bad_request_error.rb
127
178
  - lib/razorpay/errors/gateway_error.rb
128
179
  - lib/razorpay/errors/razorpay_error.rb
129
180
  - lib/razorpay/errors/server_error.rb
181
+ - lib/razorpay/fund_account.rb
182
+ - lib/razorpay/iin.rb
130
183
  - lib/razorpay/invoice.rb
184
+ - lib/razorpay/item.rb
185
+ - lib/razorpay/oauth_token.rb
131
186
  - lib/razorpay/order.rb
187
+ - lib/razorpay/payload_validator.rb
132
188
  - lib/razorpay/payment.rb
189
+ - lib/razorpay/payment_link.rb
190
+ - lib/razorpay/payment_method.rb
133
191
  - lib/razorpay/plan.rb
192
+ - lib/razorpay/product.rb
193
+ - lib/razorpay/qr_code.rb
134
194
  - lib/razorpay/refund.rb
135
195
  - lib/razorpay/request.rb
196
+ - lib/razorpay/settlement.rb
197
+ - lib/razorpay/stakeholder.rb
136
198
  - lib/razorpay/subscription.rb
199
+ - lib/razorpay/subscription_registration.rb
200
+ - lib/razorpay/token.rb
201
+ - lib/razorpay/transfer.rb
137
202
  - lib/razorpay/utility.rb
203
+ - lib/razorpay/validation_config.rb
138
204
  - lib/razorpay/virtual_account.rb
205
+ - lib/razorpay/webhook.rb
139
206
  - razorpay-ruby.gemspec
207
+ - test/fixtures/addon_collection.json
140
208
  - test/fixtures/bad_request_error.json
141
209
  - test/fixtures/cancel_invoice.json
142
210
  - test/fixtures/cancel_subscription.json
211
+ - test/fixtures/create_json_payment.json
143
212
  - test/fixtures/customer_collection.json
213
+ - test/fixtures/delete_token.json
214
+ - test/fixtures/dispute_collection.json
215
+ - test/fixtures/dispute_error.json
216
+ - test/fixtures/document_error.json
217
+ - test/fixtures/downtimes_collection.json
218
+ - test/fixtures/empty.json
219
+ - test/fixtures/error_customer.json
220
+ - test/fixtures/error_eligibility.json
221
+ - test/fixtures/error_eligibility_check.json
222
+ - test/fixtures/fake_account.json
144
223
  - test/fixtures/fake_addon.json
224
+ - test/fixtures/fake_bank_account.json
145
225
  - test/fixtures/fake_captured_payment.json
146
226
  - test/fixtures/fake_card.json
227
+ - test/fixtures/fake_card_reference.json
228
+ - test/fixtures/fake_create_upi_payment.json
147
229
  - test/fixtures/fake_customer.json
148
230
  - test/fixtures/fake_customer_edited.json
231
+ - test/fixtures/fake_direct_transfer.json
232
+ - test/fixtures/fake_dispute.json
233
+ - test/fixtures/fake_document.json
234
+ - test/fixtures/fake_downtime.json
235
+ - test/fixtures/fake_eligiblity.json
236
+ - test/fixtures/fake_fulfillment.json
237
+ - test/fixtures/fake_fund_account.json
238
+ - test/fixtures/fake_iin_token.json
239
+ - test/fixtures/fake_instant_settlement.json
149
240
  - test/fixtures/fake_invoice.json
241
+ - test/fixtures/fake_item.json
242
+ - test/fixtures/fake_oauth_token.json
150
243
  - test/fixtures/fake_order.json
244
+ - test/fixtures/fake_order_transfers.json
245
+ - test/fixtures/fake_otp_generate.json
246
+ - test/fixtures/fake_otp_resend.json
247
+ - test/fixtures/fake_otp_submit.json
151
248
  - test/fixtures/fake_payment.json
152
249
  - test/fixtures/fake_payment_authorized_webhook.json
153
250
  - test/fixtures/fake_payment_bank_transfer.json
251
+ - test/fixtures/fake_payment_expanded_details.json
252
+ - test/fixtures/fake_payment_expanded_details_card.json
253
+ - test/fixtures/fake_payment_link.json
254
+ - test/fixtures/fake_pending_update.json
154
255
  - test/fixtures/fake_plan.json
256
+ - test/fixtures/fake_product.json
257
+ - test/fixtures/fake_qrcode.json
258
+ - test/fixtures/fake_qrcode_close.json
259
+ - test/fixtures/fake_recurring.json
155
260
  - test/fixtures/fake_refund.json
156
261
  - test/fixtures/fake_refunded_payment.json
262
+ - test/fixtures/fake_revoke_token.json
263
+ - test/fixtures/fake_rto.json
264
+ - test/fixtures/fake_settlement.json
265
+ - test/fixtures/fake_settlement_on_demand.json
266
+ - test/fixtures/fake_stakeholder.json
157
267
  - test/fixtures/fake_subscription.json
268
+ - test/fixtures/fake_subscription_pause.json
269
+ - test/fixtures/fake_subscription_registration.json
270
+ - test/fixtures/fake_subscription_resume.json
271
+ - test/fixtures/fake_token.json
272
+ - test/fixtures/fake_tokenise_customer.json
273
+ - test/fixtures/fake_transfer.json
274
+ - test/fixtures/fake_transfer_reverse.json
275
+ - test/fixtures/fake_update_payment.json
276
+ - test/fixtures/fake_validate_vpa.json
158
277
  - test/fixtures/fake_virtual_account.json
278
+ - test/fixtures/fake_virtual_account_allowed.json
159
279
  - test/fixtures/fake_virtual_account_closed.json
160
280
  - test/fixtures/fake_virtual_account_collection.json
281
+ - test/fixtures/fake_virtual_account_receiver.json
282
+ - test/fixtures/fake_webhook.json
283
+ - test/fixtures/fake_webhook_by_account_id.json
284
+ - test/fixtures/fetch_tnc.json
285
+ - test/fixtures/fund_collection.json
161
286
  - test/fixtures/hello_response.json
162
287
  - test/fixtures/invoice_collection.json
163
288
  - test/fixtures/issue_invoice.json
289
+ - test/fixtures/item_collection.json
164
290
  - test/fixtures/order_collection.json
291
+ - test/fixtures/order_error.json
165
292
  - test/fixtures/order_payments.json
166
293
  - test/fixtures/payment_collection.json
167
294
  - test/fixtures/payment_collection_with_one_payment.json
295
+ - test/fixtures/payment_error.json
296
+ - test/fixtures/payment_link_collection.json
297
+ - test/fixtures/payment_link_response.json
298
+ - test/fixtures/payment_methods_collection.json
168
299
  - test/fixtures/plan_collection.json
300
+ - test/fixtures/qrcode_collection.json
301
+ - test/fixtures/qrcode_payments_collection.json
169
302
  - test/fixtures/refund_collection.json
170
303
  - test/fixtures/refund_collection_for_payment.json
304
+ - test/fixtures/reversals_collection.json
305
+ - test/fixtures/settlement_collection.json
306
+ - test/fixtures/settlement_instant_collection.json
307
+ - test/fixtures/settlement_report_collection.json
308
+ - test/fixtures/stakeholder_collection.json
171
309
  - test/fixtures/subscription_collection.json
310
+ - test/fixtures/success.json
311
+ - test/fixtures/tokens_collection.json
312
+ - test/fixtures/transfer_error.json
313
+ - test/fixtures/transfer_settlements_collection.json
314
+ - test/fixtures/transfers_collection.json
172
315
  - test/fixtures/update_invoice.json
316
+ - test/fixtures/webhook_by_account_collection.json
317
+ - test/fixtures/webhook_collection.json
173
318
  - test/fixtures/welcome.json
319
+ - test/razorpay/test_account.rb
174
320
  - test/razorpay/test_addon.rb
175
321
  - test/razorpay/test_card.rb
176
322
  - test/razorpay/test_customer.rb
323
+ - test/razorpay/test_dispute.rb
324
+ - test/razorpay/test_document.rb
177
325
  - test/razorpay/test_entity.rb
178
- - test/razorpay/test_errors.rb
326
+ - test/razorpay/test_fund_account.rb
327
+ - test/razorpay/test_iin.rb
179
328
  - test/razorpay/test_invoice.rb
329
+ - test/razorpay/test_item.rb
330
+ - test/razorpay/test_oauth_token.rb
180
331
  - test/razorpay/test_order.rb
332
+ - test/razorpay/test_payload_validator.rb
181
333
  - test/razorpay/test_payment.rb
334
+ - test/razorpay/test_payment_link.rb
182
335
  - test/razorpay/test_plan.rb
336
+ - test/razorpay/test_product.rb
337
+ - test/razorpay/test_qr_code.rb
183
338
  - test/razorpay/test_razorpay.rb
184
339
  - test/razorpay/test_refund.rb
185
340
  - test/razorpay/test_request.rb
341
+ - test/razorpay/test_settlement.rb
342
+ - test/razorpay/test_stakeholder.rb
186
343
  - test/razorpay/test_subscription.rb
344
+ - test/razorpay/test_subscription_registration.rb
345
+ - test/razorpay/test_token.rb
346
+ - test/razorpay/test_transfer.rb
187
347
  - test/razorpay/test_utility.rb
188
348
  - test/razorpay/test_virtual_account.rb
349
+ - test/razorpay/test_webhook.rb
189
350
  - test/test_helper.rb
190
351
  homepage: https://razorpay.com/
191
352
  licenses:
192
353
  - MIT
193
354
  metadata: {}
194
- post_install_message:
355
+ post_install_message:
195
356
  rdoc_options: []
196
357
  require_paths:
197
358
  - lib
@@ -206,58 +367,152 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
367
  - !ruby/object:Gem::Version
207
368
  version: '0'
208
369
  requirements: []
209
- rubygems_version: 3.0.1
210
- signing_key:
370
+ rubygems_version: 3.3.27
371
+ signing_key:
211
372
  specification_version: 4
212
373
  summary: Razorpay's Ruby API
213
374
  test_files:
375
+ - test/fixtures/addon_collection.json
214
376
  - test/fixtures/bad_request_error.json
215
377
  - test/fixtures/cancel_invoice.json
216
378
  - test/fixtures/cancel_subscription.json
379
+ - test/fixtures/create_json_payment.json
217
380
  - test/fixtures/customer_collection.json
381
+ - test/fixtures/delete_token.json
382
+ - test/fixtures/dispute_collection.json
383
+ - test/fixtures/dispute_error.json
384
+ - test/fixtures/document_error.json
385
+ - test/fixtures/downtimes_collection.json
386
+ - test/fixtures/empty.json
387
+ - test/fixtures/error_customer.json
388
+ - test/fixtures/error_eligibility.json
389
+ - test/fixtures/error_eligibility_check.json
390
+ - test/fixtures/fake_account.json
218
391
  - test/fixtures/fake_addon.json
392
+ - test/fixtures/fake_bank_account.json
219
393
  - test/fixtures/fake_captured_payment.json
220
394
  - test/fixtures/fake_card.json
395
+ - test/fixtures/fake_card_reference.json
396
+ - test/fixtures/fake_create_upi_payment.json
221
397
  - test/fixtures/fake_customer.json
222
398
  - test/fixtures/fake_customer_edited.json
399
+ - test/fixtures/fake_direct_transfer.json
400
+ - test/fixtures/fake_dispute.json
401
+ - test/fixtures/fake_document.json
402
+ - test/fixtures/fake_downtime.json
403
+ - test/fixtures/fake_eligiblity.json
404
+ - test/fixtures/fake_fulfillment.json
405
+ - test/fixtures/fake_fund_account.json
406
+ - test/fixtures/fake_iin_token.json
407
+ - test/fixtures/fake_instant_settlement.json
223
408
  - test/fixtures/fake_invoice.json
409
+ - test/fixtures/fake_item.json
410
+ - test/fixtures/fake_oauth_token.json
224
411
  - test/fixtures/fake_order.json
412
+ - test/fixtures/fake_order_transfers.json
413
+ - test/fixtures/fake_otp_generate.json
414
+ - test/fixtures/fake_otp_resend.json
415
+ - test/fixtures/fake_otp_submit.json
225
416
  - test/fixtures/fake_payment.json
226
417
  - test/fixtures/fake_payment_authorized_webhook.json
227
418
  - test/fixtures/fake_payment_bank_transfer.json
419
+ - test/fixtures/fake_payment_expanded_details.json
420
+ - test/fixtures/fake_payment_expanded_details_card.json
421
+ - test/fixtures/fake_payment_link.json
422
+ - test/fixtures/fake_pending_update.json
228
423
  - test/fixtures/fake_plan.json
424
+ - test/fixtures/fake_product.json
425
+ - test/fixtures/fake_qrcode.json
426
+ - test/fixtures/fake_qrcode_close.json
427
+ - test/fixtures/fake_recurring.json
229
428
  - test/fixtures/fake_refund.json
230
429
  - test/fixtures/fake_refunded_payment.json
430
+ - test/fixtures/fake_revoke_token.json
431
+ - test/fixtures/fake_rto.json
432
+ - test/fixtures/fake_settlement.json
433
+ - test/fixtures/fake_settlement_on_demand.json
434
+ - test/fixtures/fake_stakeholder.json
231
435
  - test/fixtures/fake_subscription.json
436
+ - test/fixtures/fake_subscription_pause.json
437
+ - test/fixtures/fake_subscription_registration.json
438
+ - test/fixtures/fake_subscription_resume.json
439
+ - test/fixtures/fake_token.json
440
+ - test/fixtures/fake_tokenise_customer.json
441
+ - test/fixtures/fake_transfer.json
442
+ - test/fixtures/fake_transfer_reverse.json
443
+ - test/fixtures/fake_update_payment.json
444
+ - test/fixtures/fake_validate_vpa.json
232
445
  - test/fixtures/fake_virtual_account.json
446
+ - test/fixtures/fake_virtual_account_allowed.json
233
447
  - test/fixtures/fake_virtual_account_closed.json
234
448
  - test/fixtures/fake_virtual_account_collection.json
449
+ - test/fixtures/fake_virtual_account_receiver.json
450
+ - test/fixtures/fake_webhook.json
451
+ - test/fixtures/fake_webhook_by_account_id.json
452
+ - test/fixtures/fetch_tnc.json
453
+ - test/fixtures/fund_collection.json
235
454
  - test/fixtures/hello_response.json
236
455
  - test/fixtures/invoice_collection.json
237
456
  - test/fixtures/issue_invoice.json
457
+ - test/fixtures/item_collection.json
238
458
  - test/fixtures/order_collection.json
459
+ - test/fixtures/order_error.json
239
460
  - test/fixtures/order_payments.json
240
461
  - test/fixtures/payment_collection.json
241
462
  - test/fixtures/payment_collection_with_one_payment.json
463
+ - test/fixtures/payment_error.json
464
+ - test/fixtures/payment_link_collection.json
465
+ - test/fixtures/payment_link_response.json
466
+ - test/fixtures/payment_methods_collection.json
242
467
  - test/fixtures/plan_collection.json
468
+ - test/fixtures/qrcode_collection.json
469
+ - test/fixtures/qrcode_payments_collection.json
243
470
  - test/fixtures/refund_collection.json
244
471
  - test/fixtures/refund_collection_for_payment.json
472
+ - test/fixtures/reversals_collection.json
473
+ - test/fixtures/settlement_collection.json
474
+ - test/fixtures/settlement_instant_collection.json
475
+ - test/fixtures/settlement_report_collection.json
476
+ - test/fixtures/stakeholder_collection.json
245
477
  - test/fixtures/subscription_collection.json
478
+ - test/fixtures/success.json
479
+ - test/fixtures/tokens_collection.json
480
+ - test/fixtures/transfer_error.json
481
+ - test/fixtures/transfer_settlements_collection.json
482
+ - test/fixtures/transfers_collection.json
246
483
  - test/fixtures/update_invoice.json
484
+ - test/fixtures/webhook_by_account_collection.json
485
+ - test/fixtures/webhook_collection.json
247
486
  - test/fixtures/welcome.json
487
+ - test/razorpay/test_account.rb
248
488
  - test/razorpay/test_addon.rb
249
489
  - test/razorpay/test_card.rb
250
490
  - test/razorpay/test_customer.rb
491
+ - test/razorpay/test_dispute.rb
492
+ - test/razorpay/test_document.rb
251
493
  - test/razorpay/test_entity.rb
252
- - test/razorpay/test_errors.rb
494
+ - test/razorpay/test_fund_account.rb
495
+ - test/razorpay/test_iin.rb
253
496
  - test/razorpay/test_invoice.rb
497
+ - test/razorpay/test_item.rb
498
+ - test/razorpay/test_oauth_token.rb
254
499
  - test/razorpay/test_order.rb
500
+ - test/razorpay/test_payload_validator.rb
255
501
  - test/razorpay/test_payment.rb
502
+ - test/razorpay/test_payment_link.rb
256
503
  - test/razorpay/test_plan.rb
504
+ - test/razorpay/test_product.rb
505
+ - test/razorpay/test_qr_code.rb
257
506
  - test/razorpay/test_razorpay.rb
258
507
  - test/razorpay/test_refund.rb
259
508
  - test/razorpay/test_request.rb
509
+ - test/razorpay/test_settlement.rb
510
+ - test/razorpay/test_stakeholder.rb
260
511
  - test/razorpay/test_subscription.rb
512
+ - test/razorpay/test_subscription_registration.rb
513
+ - test/razorpay/test_token.rb
514
+ - test/razorpay/test_transfer.rb
261
515
  - test/razorpay/test_utility.rb
262
516
  - test/razorpay/test_virtual_account.rb
517
+ - test/razorpay/test_webhook.rb
263
518
  - test/test_helper.rb
data/.travis.yml DELETED
@@ -1,22 +0,0 @@
1
- language: ruby
2
- # List is from https://www.ruby-lang.org/en/downloads/branches/
3
- # Merged with whatever is the top of each branch at https://www.ruby-lang.org/en/downloads/releases/
4
- matrix:
5
- include:
6
- - rvm: "2.6.2"
7
- - rvm: "2.5.5"
8
- - rvm: "2.4.6"
9
- env: LINT=rubocop
10
- allow_failures:
11
- # These are EOL versions of ruby
12
- - rvm: "2.3.8"
13
- - rvm: "2.1.10"
14
- - rvm: "2.0.0"
15
- - rvm: "1.9.3"
16
- before_install: gem update --system
17
- script:
18
- - bundle exec rake test
19
- - |
20
- if [[ "$LINT" == "rubocop" ]] ; then
21
- bundle exec rake rubocop
22
- fi
@@ -1,19 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Razorpay
4
- # Tests for Razorpay::Entity
5
- class ErrorTest < Minitest::Test
6
- def setup
7
- @payment_id = 'fake_payment_id'
8
- stub_get(%r{payments\/#{Regexp.quote(@payment_id)}$}, 'fake_payment')
9
- end
10
-
11
- def test_bad_request_error
12
- stub_post(%r{payments/#{@payment_id}/capture$}, 'bad_request_error', 'amount=5')
13
- assert_raises Razorpay::BadRequestError, 'It must raise BadRequestError' do
14
- payment = Razorpay::Payment.fetch(@payment_id)
15
- payment.capture(amount: 5)
16
- end
17
- end
18
- end
19
- end