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
@@ -4,14 +4,21 @@ module Razorpay
4
4
  # Helper functions are defined here
5
5
  class Utility
6
6
  def self.verify_payment_signature(attributes)
7
- signature = attributes[:razorpay_signature]
8
- order_id = attributes[:razorpay_order_id] || attributes[:razorpay_subscription_id]
9
- payment_id = attributes[:razorpay_payment_id]
10
-
11
- data = [order_id, payment_id].join '|'
7
+ signature = attributes.delete(:razorpay_signature)
12
8
 
9
+ # Data requires the values to be in sorted order of their keys.
10
+ # attributes.sort returns a nested array, and the last
11
+ # element of each is the value. These are joined.
12
+ data = attributes.sort.map(&:last).join('|')
13
13
  secret = Razorpay.auth[:password]
14
+ verify_signature(data, signature, secret)
15
+ end
14
16
 
17
+ def self.verify_payment_link_signature(attributes)
18
+ signature = attributes.delete(:razorpay_signature)
19
+ # element of each is the value. These are joined.
20
+ data = attributes.values.join('|')
21
+ secret = Razorpay.auth[:password]
15
22
  verify_signature(data, signature, secret)
16
23
  end
17
24
 
@@ -19,12 +26,16 @@ module Razorpay
19
26
  verify_signature(body, signature, secret)
20
27
  end
21
28
 
29
+ def self.generate_onboarding_signature(body, secret)
30
+ json_data = body.to_json
31
+ encrypt(json_data, secret);
32
+ end
33
+
22
34
  class << self
23
35
  private
24
36
 
25
37
  def verify_signature(data, signature, secret)
26
38
  expected_signature = OpenSSL::HMAC.hexdigest('SHA256', secret, data)
27
-
28
39
  verified = secure_compare(expected_signature, signature)
29
40
 
30
41
  raise SecurityError, 'Signature verification failed' unless verified
@@ -46,6 +57,30 @@ module Razorpay
46
57
 
47
58
  r.zero?
48
59
  end
60
+
61
+ def encrypt(data, secret)
62
+ key = secret[0, 16]
63
+
64
+ # Generate a fresh random 12-byte nonce per call (fixes AES-GCM nonce reuse).
65
+ # A static IV derived from the secret allows keystream recovery and tag forgery
66
+ # (NIST SP 800-38D §8.3 Forbidden Attack) using only two captured ciphertexts.
67
+ iv = OpenSSL::Random.random_bytes(12)
68
+
69
+ cipher = OpenSSL::Cipher.new('aes-128-gcm')
70
+ cipher.encrypt
71
+ cipher.key = key
72
+ cipher.iv = iv
73
+
74
+ cipher.auth_data = ""
75
+
76
+ encrypted = cipher.update(data) + cipher.final
77
+
78
+ tag = cipher.auth_tag
79
+
80
+ # Output format: iv (12 bytes) || ciphertext || tag (16 bytes), hex-encoded.
81
+ # Receiver must read the first 24 hex chars as the IV before decrypting.
82
+ (iv + encrypted + tag).unpack1("H*")
83
+ end
49
84
  end
50
85
  end
51
86
  end
@@ -0,0 +1,11 @@
1
+ module Razorpay
2
+
3
+ class ValidationConfig
4
+ attr_reader :field_name, :validations
5
+
6
+ def initialize(field_name, validations)
7
+ @field_name = field_name
8
+ @validations = validations
9
+ end
10
+ end
11
+ end
@@ -20,13 +20,9 @@ module Razorpay
20
20
  def self.all(options = {})
21
21
  request.all options
22
22
  end
23
-
23
+
24
24
  def self.close(id)
25
- request.patch id, status: 'closed'
26
- end
27
-
28
- def close
29
- self.class.request.patch id, status: 'closed'
25
+ request.post "#{id}/close"
30
26
  end
31
27
 
32
28
  def close!
@@ -35,7 +31,19 @@ module Razorpay
35
31
 
36
32
  def payments(options = {})
37
33
  r = self.class.request
38
- r.request :get, "/virtual_accounts/#{id}/payments", options
34
+ r.request :get, "/v1/virtual_accounts/#{id}/payments", options
35
+ end
36
+
37
+ def self.add_receiver(id, options = {})
38
+ request.post "#{id}/receivers", options
39
+ end
40
+
41
+ def self.allowed_payer(id, options = {})
42
+ request.post "#{id}/allowed_payers", options
43
+ end
44
+
45
+ def self.delete_allowed_payer(id, payer_id)
46
+ request.delete "#{id}/allowed_payers/#{payer_id}"
39
47
  end
40
48
  end
41
49
  end
@@ -0,0 +1,50 @@
1
+ require 'razorpay/request'
2
+ require 'razorpay/entity'
3
+
4
+ module Razorpay
5
+ # Webhook API allows you create, fetch, update and delete
6
+ class Webhook < Entity
7
+
8
+ @@versions = "v2"
9
+
10
+ def self.request
11
+ Razorpay::Request.new('accounts')
12
+ end
13
+
14
+ def self.create(options, account_id = nil)
15
+ if(account_id)
16
+ return request.post "#{account_id}/webhooks", options, @@versions
17
+ end
18
+
19
+ r = request
20
+ return r.request :post, "/v1/webhooks", options
21
+ end
22
+
23
+ def self.all(options = {}, account_id = nil)
24
+ if(account_id)
25
+ return request.get "#{account_id}/webhooks" , options , @@versions
26
+ end
27
+
28
+ r = request
29
+ return r.request :get, "/v1/webhooks", options
30
+ end
31
+
32
+ def self.fetch(id, account_id)
33
+ request.fetch "#{account_id}/webhooks/#{id}", @@versions
34
+ end
35
+
36
+ def self.edit(options, id, account_id = nil)
37
+ if(account_id)
38
+ return request.patch "#{account_id}/webhooks/#{id}", options, @@versions
39
+ end
40
+
41
+ r = request
42
+ return r.request :put, "/v1/webhooks/#{id}" , options
43
+ end
44
+
45
+ def self.delete(id, account_id)
46
+ request.delete "#{account_id}/webhooks/#{id}", @@versions
47
+ end
48
+ end
49
+ end
50
+
data/lib/razorpay.rb CHANGED
@@ -12,15 +12,38 @@ require 'razorpay/virtual_account'
12
12
  require 'razorpay/plan'
13
13
  require 'razorpay/subscription'
14
14
  require 'razorpay/addon'
15
+ require 'razorpay/transfer'
16
+ require 'razorpay/subscription_registration'
17
+ require 'razorpay/settlement'
18
+ require 'razorpay/payment_link'
19
+ require 'razorpay/fund_account'
20
+ require 'razorpay/item'
21
+ require 'razorpay/qr_code'
22
+ require 'razorpay/payment_method'
23
+ require 'razorpay/webhook'
24
+ require 'razorpay/iin'
25
+ require 'razorpay/token'
26
+ require 'razorpay/product'
27
+ require 'razorpay/stakeholder'
28
+ require 'razorpay/account'
29
+ require 'razorpay/document'
30
+ require 'razorpay/dispute'
31
+ require 'razorpay/oauth_token'
15
32
 
16
33
  # Base Razorpay module
17
34
  module Razorpay
18
35
  class << self
19
- attr_accessor :auth, :custom_headers
36
+ attr_accessor :auth, :custom_headers, :access_token, :auth_type
20
37
  end
21
38
 
22
39
  def self.setup(key_id, key_secret)
23
40
  self.auth = { username: key_id, password: key_secret }
41
+ self.auth_type = Razorpay::PRIVATE_AUTH
42
+ end
43
+
44
+ def self.setup_with_oauth(access_token)
45
+ self.access_token = access_token
46
+ self.auth_type = Razorpay::OAUTH
24
47
  end
25
48
 
26
49
  def self.headers=(headers = {})
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_dependency 'httparty', '~> 0.14'
21
21
 
22
- spec.add_development_dependency 'coveralls', '~> 0.8'
22
+ spec.add_development_dependency 'coveralls_reborn', '~> 0.8'
23
23
  spec.add_development_dependency 'minitest', '~> 5.11'
24
24
  spec.add_development_dependency 'rake', '~> 12.0'
25
25
 
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  # rubocop is only run in the latest ruby build
28
28
  # so we use the latest version and don't switch to a
29
29
  # older version for 1.9.3
30
+ spec.add_development_dependency 'simplecov-cobertura'
30
31
  spec.add_development_dependency 'rubocop', '~> 0.49'
31
32
  spec.add_development_dependency 'webmock', '~> 3.0'
32
33
  else
@@ -0,0 +1,60 @@
1
+ {
2
+ "entity":"collection",
3
+ "count":2,
4
+ "items":[
5
+ {
6
+ "id":"ao_00000000000002",
7
+ "entity":"addon",
8
+ "item":{
9
+ "id":"item_00000000000002",
10
+ "active":true,
11
+ "name":"Extra sweet",
12
+ "description":"1 extra sweet of the day with meals",
13
+ "amount":90000,
14
+ "unit_amount":90000,
15
+ "currency":"INR",
16
+ "type":"addon",
17
+ "unit":null,
18
+ "tax_inclusive":false,
19
+ "hsn_code":null,
20
+ "sac_code":null,
21
+ "tax_rate":null,
22
+ "tax_id":null,
23
+ "tax_group_id":null,
24
+ "created_at":1581597318,
25
+ "updated_at":1581597318
26
+ },
27
+ "quantity":1,
28
+ "created_at":1581597318,
29
+ "subscription_id":"sub_00000000000001",
30
+ "invoice_id":"inv_00000000000001"
31
+ },
32
+ {
33
+ "id":"ao_00000000000001",
34
+ "entity":"addon",
35
+ "item":{
36
+ "id":"item_00000000000001",
37
+ "active":true,
38
+ "name":"Extra appala (papadum)",
39
+ "description":"1 extra oil fried appala with meals",
40
+ "amount":30000,
41
+ "unit_amount":30000,
42
+ "currency":"INR",
43
+ "type":"addon",
44
+ "unit":null,
45
+ "tax_inclusive":false,
46
+ "hsn_code":null,
47
+ "sac_code":null,
48
+ "tax_rate":null,
49
+ "tax_id":null,
50
+ "tax_group_id":null,
51
+ "created_at":1581597318,
52
+ "updated_at":1581597318
53
+ },
54
+ "quantity":2,
55
+ "created_at":1581597318,
56
+ "subscription_id":"sub_00000000000001",
57
+ "invoice_id":null
58
+ }
59
+ ]
60
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "razorpay_payment_id": "pay_FVmAstJWfsD3SO",
3
+ "next": [
4
+ {
5
+ "action": "redirect",
6
+ "url": "https://api.razorpay.com/v1/payments/FVmAtLUe9XZSGM/authorize"
7
+ },
8
+ {
9
+ "action": "otp_generate",
10
+ "url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_generate?track_id=FVmAtLUe9XZSGM&key_id=<YOUR_KEY_ID>"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "deleted": true
3
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "entity": "collection",
3
+ "count": 2,
4
+ "items": [
5
+ {
6
+ "id": "disp_Esz7KAitoYM7PJ",
7
+ "entity": "dispute",
8
+ "payment_id": "pay_EsyWjHrfzb59eR",
9
+ "amount": 10000,
10
+ "currency": "INR",
11
+ "amount_deducted": 0,
12
+ "reason_code": "pre_arbitration",
13
+ "respond_by": 1590604200,
14
+ "status": "open",
15
+ "phase": "pre_arbitration",
16
+ "created_at": 1590059211,
17
+ "evidence": {
18
+ "amount": 10000,
19
+ "summary": null,
20
+ "shipping_proof": null,
21
+ "billing_proof": null,
22
+ "cancellation_proof": null,
23
+ "customer_communication": null,
24
+ "proof_of_service": null,
25
+ "explanation_letter": null,
26
+ "refund_confirmation": null,
27
+ "access_activity_log": null,
28
+ "refund_cancellation_policy": null,
29
+ "term_and_conditions": null,
30
+ "others": null,
31
+ "submitted_at": null
32
+ }
33
+ },
34
+ {
35
+ "id": "disp_Esyvk3kZj0isXk",
36
+ "entity": "dispute",
37
+ "payment_id": "pay_EsyWjHrfzb59eR",
38
+ "amount": 5000,
39
+ "currency": "INR",
40
+ "amount_deducted": 0,
41
+ "reason_code": "warning_bulletin_or_exception_file",
42
+ "respond_by": 1590604200,
43
+ "status": "won",
44
+ "phase": "chargeback",
45
+ "created_at": 1590058554,
46
+ "evidence": {
47
+ "amount": 5000,
48
+ "summary": null,
49
+ "shipping_proof": [
50
+ "doc_EFtmUsbwpXwBH9",
51
+ "doc_EFtmUsbwpXwBH8"
52
+ ],
53
+ "billing_proof": null,
54
+ "cancellation_proof": null,
55
+ "customer_communication": null,
56
+ "proof_of_service": null,
57
+ "explanation_letter": null,
58
+ "refund_confirmation": null,
59
+ "access_activity_log": null,
60
+ "refund_cancellation_policy": null,
61
+ "term_and_conditions": null,
62
+ "others": null,
63
+ "submitted_at": 1590604100
64
+ }
65
+ }
66
+ ]
67
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "error": {
3
+ "code": "BAD_REQUEST_ERROR",
4
+ "description": "The id provided does not exist",
5
+ "source": "business",
6
+ "step": "payment_initiation",
7
+ "reason": "input_validation_failed",
8
+ "metadata": {}
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "error": {
3
+ "code": "BAD_REQUEST_ERROR",
4
+ "description": "Invalid file id provided or merchant is unauthorized to access the fileId(s) provided",
5
+ "source": "NA",
6
+ "step": "NA",
7
+ "reason": "NA",
8
+ "metadata": {}
9
+ }
10
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "entity": "collection",
3
+ "count": 1,
4
+ "items": [
5
+ {
6
+ "id": "down_F7LroRQAAFuswd",
7
+ "entity": "payment.downtime",
8
+ "method": "card",
9
+ "begin": 1593196031,
10
+ "end": null,
11
+ "status": "started",
12
+ "scheduled": false,
13
+ "severity": "high",
14
+ "instrument": {
15
+ "issuer": "SBIN"
16
+ },
17
+ "created_at": 1593196089,
18
+ "updated_at": 1593196089
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,2 @@
1
+
2
+ {}
@@ -0,0 +1,10 @@
1
+ {
2
+ "error": {
3
+ "code": "BAD_REQUEST_ERROR",
4
+ "description": "The id provided does not exist",
5
+ "source": "business",
6
+ "step": "payment_initiation",
7
+ "reason": "input_validation_failed",
8
+ "metadata": {}
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "error": {
3
+ "code": "BAD_REQUEST_ERROR",
4
+ "description": "The eligibility id does not exist.",
5
+ "source": "NA",
6
+ "step": "NA",
7
+ "reason": "NA",
8
+ "metadata": {}
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "error": {
3
+ "code": "BAD_REQUEST_ERROR",
4
+ "description": "Amount is required.",
5
+ "source": "NA",
6
+ "step": "NA",
7
+ "reason": "NA",
8
+ "metadata": {}
9
+ }
10
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "id": "acc_00000000000001",
3
+ "type": "standard",
4
+ "status": "created",
5
+ "email": "gauriagain.kumar@example.org",
6
+ "profile": {
7
+ "category": "healthcare",
8
+ "subcategory": "clinic",
9
+ "addresses": {
10
+ "registered": {
11
+ "street1": "507, Koramangala 1st block",
12
+ "street2": "MG Road",
13
+ "city": "Bengaluru",
14
+ "state": "KARNATAKA",
15
+ "postal_code": 560034,
16
+ "country": "IN"
17
+ },
18
+ "operation": {
19
+ "street1": "507, Koramangala 6th block",
20
+ "street2": "Kormanagalo",
21
+ "city": "Bengaluru",
22
+ "state": "KARNATAKA",
23
+ "country": "IN",
24
+ "postal_code": 560047
25
+ }
26
+ },
27
+ "business_model": "Online Clothing ( men, women, ethnic, modern ) fashion and lifestyle, accessories, t-shirt, shirt, track pant, shoes."
28
+ },
29
+ "notes": {
30
+ "internal_ref_id": "123123"
31
+ },
32
+ "created_at": 1611136837,
33
+ "phone": "9000090000",
34
+ "business_type": "partnership",
35
+ "legal_business_name": "Acme Corp",
36
+ "customer_facing_business_name": "Example",
37
+ "legal_info": {
38
+ "pan": "AAACL1234C",
39
+ "gst": "18AABCU9603R1ZM"
40
+ },
41
+ "apps": {
42
+ "websites": [
43
+ "https://www.example.org"
44
+ ],
45
+ "android": [
46
+ {
47
+ "url": "playstore.example.org",
48
+ "name": "Example"
49
+ }
50
+ ],
51
+ "ios": [
52
+ {
53
+ "url": "appstore.example.org",
54
+ "name": "Example"
55
+ }
56
+ ]
57
+ },
58
+ "brand": {
59
+ "color": "#FFFFFF"
60
+ },
61
+ "contact_info": {
62
+ "chargeback": {
63
+ "email": "cb@example.org",
64
+ "phone": null,
65
+ "policy_url": null
66
+ },
67
+ "refund": {
68
+ "email": "cb@example.org",
69
+ "phone": null,
70
+ "policy_url": null
71
+ },
72
+ "support": {
73
+ "email": "support@example.org",
74
+ "phone": "9999999998",
75
+ "policy_url": "https://www.google.com"
76
+ }
77
+ }
78
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
- "id": "fake_addon_id",
2
+ "id": "ao_IrSY3UIqDRx7df",
3
3
  "entity": "addon",
4
4
  "item": {
5
- "id": "fake_item_id",
5
+ "id": "item_00000000000001",
6
6
  "active": true,
7
7
  "name": "fake_item_name",
8
8
  "description": "fake_item_description",
@@ -19,6 +19,6 @@
19
19
  },
20
20
  "quantity": 1,
21
21
  "created_at": 1511525697,
22
- "subscription_id": "fake_subscription_id",
22
+ "subscription_id": "sub_00000000000001",
23
23
  "invoice_id": null
24
24
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "id": "ba_LSZht1Cm7xFTwF",
3
+ "entity": "bank_account",
4
+ "ifsc": "ICIC0001207",
5
+ "bank_name": "ICICI Bank",
6
+ "name": "Gaurav Kumar",
7
+ "notes": [],
8
+ "account_number": "XXXXXXXXXXXXXXX0434"
9
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "network":"Visa",
3
+ "network_reference_id":null,
4
+ "payment_account_reference":"V0010014620077202123799870069"
5
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "razorpay_payment_id": "pay_FVmAstJWfsD3SO"
3
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "id":"trf_JDEnyfvGu22ECp",
3
+ "entity":"transfer",
4
+ "transfer_status":"pending",
5
+ "settlement_status":null,
6
+ "source":"acc_CJoeHMNpi0nC7k",
7
+ "recipient":"acc_CPRsN1LkFccllA",
8
+ "amount":100,
9
+ "currency":"INR",
10
+ "amount_reversed":0,
11
+ "notes":[
12
+
13
+ ],
14
+ "fees":1,
15
+ "tax":0,
16
+ "on_hold":false,
17
+ "on_hold_until":null,
18
+ "recipient_settlement_id":null,
19
+ "created_at":1580219046,
20
+ "linked_account_notes":[
21
+
22
+ ],
23
+ "processed_at":null,
24
+ "errors":{
25
+ "code":null,
26
+ "description":null,
27
+ "field":null,
28
+ "source":null,
29
+ "step":null,
30
+ "reason":null
31
+ }
32
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "id": "disp_XXXXXXXXXXXXX",
3
+ "entity": "dispute",
4
+ "payment_id": "pay_EsyWjHrfzb59eR",
5
+ "amount": 10000,
6
+ "currency": "INR",
7
+ "amount_deducted": 0,
8
+ "reason_code": "pre_arbitration",
9
+ "respond_by": 1590604200,
10
+ "status": "open",
11
+ "phase": "pre_arbitration",
12
+ "created_at": 1590059211,
13
+ "evidence": {
14
+ "amount": 10000,
15
+ "summary": "goods delivered",
16
+ "shipping_proof": null,
17
+ "billing_proof": null,
18
+ "cancellation_proof": null,
19
+ "customer_communication": null,
20
+ "proof_of_service": null,
21
+ "explanation_letter": null,
22
+ "refund_confirmation": null,
23
+ "access_activity_log": null,
24
+ "refund_cancellation_policy": null,
25
+ "term_and_conditions": null,
26
+ "others": null,
27
+ "submitted_at": null
28
+ }
29
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "entity": "document",
3
+ "id": "doc_O4KANwWi2kHGiV",
4
+ "purpose": "dispute_evidence",
5
+ "created_at": 1714368859,
6
+ "mime_type": "image/jpeg",
7
+ "display_name": "Screenshot 2022-09-12 at 5.48.23 PM",
8
+ "size": 334201
9
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": "fake_downtime_id",
3
+ "method": "card",
4
+ "begin": 1593196031,
5
+ "end": null,
6
+ "status": "started",
7
+ "scheduled": false,
8
+ "severity": "high",
9
+ "instrument": {
10
+ "issuer": "SBIN"
11
+ },
12
+ "created_at": 1593196089,
13
+ "updated_at": 1593196089
14
+ }