razorpay 2.4.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +8 -0
  3. data/.github/workflows/ruby.yml +38 -0
  4. data/CHANGELOG.md +19 -0
  5. data/README.md +29 -140
  6. data/documents/Invoice.md +531 -0
  7. data/documents/addon.md +169 -0
  8. data/documents/card.md +611 -0
  9. data/documents/customer.md +161 -0
  10. data/documents/emandate.md +484 -0
  11. data/documents/fund.md +87 -0
  12. data/documents/items.md +184 -0
  13. data/documents/order.md +230 -0
  14. data/documents/papernach.md +718 -0
  15. data/documents/payment.md +636 -0
  16. data/documents/paymentLink.md +1045 -0
  17. data/documents/paymentVerification.md +79 -0
  18. data/documents/plan.md +184 -0
  19. data/documents/qrcode.md +441 -0
  20. data/documents/refund.md +324 -0
  21. data/documents/registerEmandate.md +445 -0
  22. data/documents/registerNach.md +661 -0
  23. data/documents/settlement.md +477 -0
  24. data/documents/subscriptions.md +750 -0
  25. data/documents/tokens.md +208 -0
  26. data/documents/transfers.md +684 -0
  27. data/documents/upi.md +548 -0
  28. data/documents/virtualAccount.md +586 -0
  29. data/lib/razorpay/addon.rb +4 -0
  30. data/lib/razorpay/constants.rb +1 -1
  31. data/lib/razorpay/customer.rb +15 -0
  32. data/lib/razorpay/fund_account.rb +19 -0
  33. data/lib/razorpay/invoice.rb +8 -0
  34. data/lib/razorpay/item.rb +34 -0
  35. data/lib/razorpay/order.rb +10 -0
  36. data/lib/razorpay/payment.rb +52 -0
  37. data/lib/razorpay/payment_link.rb +36 -0
  38. data/lib/razorpay/qr_code.rb +34 -0
  39. data/lib/razorpay/refund.rb +4 -0
  40. data/lib/razorpay/request.rb +13 -6
  41. data/lib/razorpay/settlement.rb +39 -0
  42. data/lib/razorpay/subscription.rb +24 -0
  43. data/lib/razorpay/subscription_registration.rb +16 -0
  44. data/lib/razorpay/transfer.rb +35 -0
  45. data/lib/razorpay/utility.rb +7 -2
  46. data/lib/razorpay/virtual_account.rb +14 -6
  47. data/lib/razorpay.rb +7 -0
  48. data/test/fixtures/addon_collection.json +60 -0
  49. data/test/fixtures/create_json_payment.json +13 -0
  50. data/test/fixtures/delete_token.json +3 -0
  51. data/test/fixtures/downtimes_collection.json +21 -0
  52. data/test/fixtures/empty.json +2 -0
  53. data/test/fixtures/fake_addon.json +3 -3
  54. data/test/fixtures/fake_direct_transfer.json +32 -0
  55. data/test/fixtures/fake_downtime.json +14 -0
  56. data/test/fixtures/fake_fund_account.json +18 -0
  57. data/test/fixtures/fake_instant_settlement.json +19 -0
  58. data/test/fixtures/fake_item.json +9 -0
  59. data/test/fixtures/fake_order_transfers.json +88 -0
  60. data/test/fixtures/fake_otp_generate.json +19 -0
  61. data/test/fixtures/fake_otp_resend.json +7 -0
  62. data/test/fixtures/fake_otp_submit.json +5 -0
  63. data/test/fixtures/fake_payment_link.json +40 -0
  64. data/test/fixtures/fake_pending_update.json +30 -0
  65. data/test/fixtures/fake_qrcode.json +20 -0
  66. data/test/fixtures/fake_qrcode_close.json +22 -0
  67. data/test/fixtures/fake_recurring.json +5 -0
  68. data/test/fixtures/fake_refund.json +1 -1
  69. data/test/fixtures/fake_settlement.json +11 -0
  70. data/test/fixtures/fake_settlement_on_demand.json +39 -0
  71. data/test/fixtures/fake_subscription_pause.json +19 -0
  72. data/test/fixtures/fake_subscription_registration.json +91 -0
  73. data/test/fixtures/fake_subscription_resume.json +19 -0
  74. data/test/fixtures/fake_token.json +31 -0
  75. data/test/fixtures/fake_transfer.json +18 -0
  76. data/test/fixtures/fake_transfer_reverse.json +15 -0
  77. data/test/fixtures/fake_update_payment.json +39 -0
  78. data/test/fixtures/fake_virtual_account_allowed.json +46 -0
  79. data/test/fixtures/fake_virtual_account_receiver.json +46 -0
  80. data/test/fixtures/fund_collection.json +20 -0
  81. data/test/fixtures/item_collection.json +24 -0
  82. data/test/fixtures/payment_collection.json +1 -1
  83. data/test/fixtures/payment_link_collection.json +43 -0
  84. data/test/fixtures/payment_link_response.json +3 -0
  85. data/test/fixtures/qrcode_collection.json +50 -0
  86. data/test/fixtures/qrcode_payments_collection.json +74 -0
  87. data/test/fixtures/settlement_collection.json +26 -0
  88. data/test/fixtures/settlement_instant_collection.json +84 -0
  89. data/test/fixtures/settlement_report_collection.json +117 -0
  90. data/test/fixtures/success.json +3 -0
  91. data/test/fixtures/tokens_collection.json +36 -0
  92. data/test/fixtures/transfer_settlements_collection.json +38 -0
  93. data/test/fixtures/transfers_collection.json +41 -0
  94. data/test/razorpay/test_addon.rb +15 -15
  95. data/test/razorpay/test_customer.rb +27 -3
  96. data/test/razorpay/test_fund_account.rb +42 -0
  97. data/test/razorpay/test_invoice.rb +15 -2
  98. data/test/razorpay/test_item.rb +66 -0
  99. data/test/razorpay/test_order.rb +24 -1
  100. data/test/razorpay/test_payment.rb +184 -8
  101. data/test/razorpay/test_payment_link.rb +83 -0
  102. data/test/razorpay/test_plan.rb +2 -2
  103. data/test/razorpay/test_qr_code.rb +63 -0
  104. data/test/razorpay/test_refund.rb +16 -2
  105. data/test/razorpay/test_settlement.rb +76 -0
  106. data/test/razorpay/test_subscription.rb +72 -9
  107. data/test/razorpay/test_subscription_registration.rb +58 -0
  108. data/test/razorpay/test_transfer.rb +77 -0
  109. data/test/razorpay/test_utility.rb +32 -0
  110. data/test/razorpay/test_virtual_account.rb +64 -17
  111. data/test/test_helper.rb +6 -0
  112. metadata +138 -9
  113. data/.travis.yml +0 -22
  114. data/test/razorpay/test_errors.rb +0 -19
@@ -0,0 +1,1045 @@
1
+ ## Payment Links
2
+
3
+ ```rb
4
+ require "razorpay"
5
+ Razorpay.setup('key_id', 'key_secret')
6
+ ```
7
+
8
+ ### Create payment link
9
+
10
+ Request #1
11
+ Standard Payment Link
12
+
13
+ ```rb
14
+ Razorpay.headers = {"Content-type" => "application/json"}
15
+
16
+ para_attr = {
17
+ "amount": 500,
18
+ "currency": "INR",
19
+ "accept_partial": true,
20
+ "first_min_partial_amount": 100,
21
+ "description": "For XYZ purpose",
22
+ "customer": {
23
+ "name": "Gaurav Kumar",
24
+ "email": "gaurav.kumar@example.com",
25
+ "contact": "+919999999999"
26
+ },
27
+ "notify": {
28
+ "sms": true,
29
+ "email": true
30
+ },
31
+ "reminder_enable": true,
32
+ "notes": {
33
+ "policy_name": "Jeevan Bima"
34
+ },
35
+ "callback_url": "https://example-callback-url.com/",
36
+ "callback_method": "get"
37
+ }
38
+
39
+ Razorpay::PaymentLink.create(para_attr.to_json)
40
+ ```
41
+
42
+ Request #2
43
+ UPI Payment Link
44
+
45
+ ```rb
46
+
47
+ Razorpay.headers = {"Content-type" => "application/json"}
48
+
49
+ para_attr = {
50
+ "upi_link": true,
51
+ "amount": 500,
52
+ "currency": "INR",
53
+ "description": "For XYZ purpose",
54
+ "customer": {
55
+ "name": "Gaurav Kumar",
56
+ "email": "gaurav.kumar@example.com",
57
+ "contact": "+919999999999"
58
+ },
59
+ "notify": {
60
+ "sms": true,
61
+ "email": true
62
+ },
63
+ "reminder_enable": true,
64
+ "notes": {
65
+ "policy_name": "Jeevan Bima"
66
+ }
67
+ }
68
+
69
+ Razorpay::PaymentLink.create(para_attr.to_json)
70
+ ```
71
+
72
+ **Parameters:**
73
+
74
+ | Name | Type | Description |
75
+ |-----------------|---------|------------------------------------------------------------------------------|
76
+ |upi_link* | boolean | boolean Must be set to true // to creating UPI Payment Link only |
77
+ |amount* | integer | Amount to be paid using the Payment Link. |
78
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
79
+ |description | string | A brief description of the Payment Link |
80
+ |reference_id | string | AReference number tagged to a Payment Link. |
81
+ |customer | object | name, email, contact |
82
+ |expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
83
+ |notify | object | sms or email (boolean) |
84
+ |notes | json object | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty” |
85
+
86
+ **Response:**
87
+ For create payment link response please click [here](https://razorpay.com/docs/api/payment-links/#create-payment-link)
88
+
89
+ -------------------------------------------------------------------------------------------------------
90
+
91
+ ### Fetch all payment link
92
+
93
+ ```rb
94
+ Razorpay::PaymentLink.all()
95
+ ```
96
+
97
+ **Parameters:**
98
+
99
+ | Name | Type | Description |
100
+ |-----------------|---------|------------------------------------------------------------------------------|
101
+ |payment_id | string | Unique identifier of the payment associated with the Payment Link. |
102
+ |reference_id | string | The unique reference number entered by you while creating the Payment Link. |
103
+
104
+ **Response:**
105
+ For fetch all payment link response please click [here](https://razorpay.com/docs/api/payment-links/#all-payment-links)
106
+
107
+ -------------------------------------------------------------------------------------------------------
108
+
109
+ ### Fetch specific payment link
110
+
111
+ ```rb
112
+ paymentLinkId = "plink_ExjpAUN3gVHrPJ"
113
+
114
+ Razorpay::PaymentLink.fetch(paymentLinkId)
115
+ ```
116
+
117
+ **Parameters:**
118
+
119
+ | Name | Type | Description |
120
+ |-----------------|---------|------------------------------------------------------------------------------|
121
+ | paymentLinkId* | string | Unique identifier of the Payment Link. |
122
+
123
+ **Response:**
124
+ For fetch specific payment link response please click [here](https://razorpay.com/docs/api/payment-links/#specific-payment-links-by-id)
125
+
126
+ -------------------------------------------------------------------------------------------------------
127
+
128
+ ### Update payment link
129
+
130
+ ```rb
131
+
132
+ Razorpay.headers = {"Content-type" => "application/json"}
133
+
134
+ paymentLinkId = "plink_ExjpAUN3gVHrPJ"
135
+
136
+ para_attr = {
137
+ "reference_id": "TS35",
138
+ "expire_by": 1653347540,
139
+ "reminder_enable":false,
140
+ "notes":{
141
+ "policy_name": "Jeevan Saral"
142
+ }
143
+ }
144
+
145
+ Razorpay::PaymentLink.edit(paymentLinkId, para_attr.to_json)
146
+ ```
147
+
148
+ **Parameters:**
149
+
150
+ | Name | Type | Description |
151
+ |-----------------|---------|------------------------------------------------------------------------------|
152
+ | paymentLinkId* | string | The unique identifier of the Payment Link that needs to be updated. |
153
+ | accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values: true - Customer can make partial payments. false (default) - Customer cannot make partial payments. |
154
+ | reference_id | string | Adds a unique reference number to an existing link. |
155
+ | expire_by | integer | Timestamp, in Unix format, when the payment links should expire. |
156
+ | notes | string | object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”. |
157
+
158
+ **Response:**
159
+ For updating payment link response please click [here](https://razorpay.com/docs/api/payment-links/#update-payment-link)
160
+
161
+ -------------------------------------------------------------------------------------------------------
162
+
163
+ ### Cancel a payment link
164
+
165
+ ```rb
166
+ paymentLinkId = "plink_ExjpAUN3gVHrPJ"
167
+
168
+ Razorpay::PaymentLink.cancel(paymentLinkId)
169
+ ```
170
+
171
+ **Parameters:**
172
+
173
+ | Name | Type | Description |
174
+ |-----------------|---------|------------------------------------------------------------------------------|
175
+ | paymentLinkId* | string | Unique identifier of the Payment Link. |
176
+
177
+ **Response:**
178
+ For canceling payment link response please click [here](https://razorpay.com/docs/api/payment-links/#cancel-payment-link)
179
+ -------------------------------------------------------------------------------------------------------
180
+
181
+ ### Send notification
182
+
183
+ ```rb
184
+ paymentLinkId = "plink_ExjpAUN3gVHrPJ"
185
+
186
+ medium = "email"
187
+
188
+ Razorpay::PaymentLink.notify_by(paymentLinkId, medium)
189
+ ```
190
+
191
+ **Parameters:**
192
+
193
+ | Name | Type | Description |
194
+ |-----------------|---------|------------------------------------------------------------------------------|
195
+ | paymentLinkId* | string | Unique identifier of the Payment Link that should be resent. |
196
+ | medium* | string | `sms`/`email`,Medium through which the Payment Link must be resent. Allowed values are: |
197
+
198
+ **Response:**
199
+ ```json
200
+ {
201
+ "success": true
202
+ }
203
+ ```
204
+ -------------------------------------------------------------------------------------------------------
205
+
206
+ ### Transfer payments received using payment links
207
+
208
+ ```rb
209
+
210
+ para_attr = {
211
+ "amount": 20000,
212
+ "currency": "INR",
213
+ "accept_partial": false,
214
+ "description": "For XYZ purpose",
215
+ "customer": {
216
+ "name": "Gaurav Kumar",
217
+ "email": "gaurav.kumar@example.com",
218
+ "contact": "+919999999999"
219
+ },
220
+ "notify": {
221
+ "sms": true,
222
+ "email": true
223
+ },
224
+ "reminder_enable": true,
225
+ "options": {
226
+ "order": [
227
+ {
228
+ "account": "acc_CNo3jSI8OkFJJJ",
229
+ "amount": 500,
230
+ "currency": "INR",
231
+ "notes": {
232
+ "branch": "Acme Corp Bangalore North",
233
+ "name": "Saurav Kumar",
234
+ "linked_account_notes": [
235
+ "branch"
236
+ ]
237
+ }
238
+ }
239
+ ]
240
+ }
241
+ }
242
+
243
+ Razorpay.headers = {"Content-type" => "application/json"}
244
+
245
+ Razorpay::PaymentLink.create(para_attr.to_json)
246
+ ```
247
+
248
+ **Parameters:**
249
+
250
+ | Name | Type | Description |
251
+ |-----------------|---------|------------------------------------------------------------------------------|
252
+ |amount* | integer | Amount to be paid using the Payment Link. |
253
+ |options* | array | Options to configure the transfer in the Payment Link. Parent parameter under which the order child parameter must be passed. |
254
+
255
+ **Response:**
256
+ ```json
257
+ {
258
+ "accept_partial": false,
259
+ "amount": 1500,
260
+ "amount_paid": 0,
261
+ "callback_method": "",
262
+ "callback_url": "",
263
+ "cancelled_at": 0,
264
+ "created_at": 1596526969,
265
+ "currency": "INR",
266
+ "customer": {
267
+ "contact": "+919999999999",
268
+ "email": "gaurav.kumar@example.com",
269
+ "name": "Gaurav Kumar"
270
+ },
271
+ "deleted_at": 0,
272
+ "description": "Payment for policy no #23456",
273
+ "expire_by": 0,
274
+ "expired_at": 0,
275
+ "first_min_partial_amount": 0,
276
+ "id": "plink_FMbhpT6nqDjDei",
277
+ "notes": null,
278
+ "notify": {
279
+ "email": true,
280
+ "sms": true
281
+ },
282
+ "payments": null,
283
+ "reference_id": "#aasasw8",
284
+ "reminder_enable": true,
285
+ "reminders": [],
286
+ "short_url": "https://rzp.io/i/ORor1MT",
287
+ "source": "",
288
+ "source_id": "",
289
+ "status": "created",
290
+ "updated_at": 1596526969,
291
+ "user_id": ""
292
+ }
293
+ ```
294
+ -------------------------------------------------------------------------------------------------------
295
+
296
+ ### Offers on payment links
297
+
298
+ ```rb
299
+ para_attr = {
300
+ "amount": 3400,
301
+ "currency": "INR",
302
+ "accept_partial": false,
303
+ "reference_id": "#425",
304
+ "description": "Payment for policy no #23456",
305
+ "customer": {
306
+ "name": "Gaurav Kumar",
307
+ "contact": "+919999999999",
308
+ "email": "gaurav.kumar@example.com"
309
+ },
310
+ "notify": {
311
+ "sms": true,
312
+ "email": true
313
+ },
314
+ "reminder_enable": false,
315
+ "options": {
316
+ "order": {
317
+ "offers": [
318
+ "offer_F4WMTC3pwFKnzq",
319
+ "offer_F4WJHqvGzw8dWF"
320
+ ]
321
+ }
322
+ }
323
+ }
324
+
325
+ Razorpay.headers = {"Content-type" => "application/json"}
326
+
327
+ Razorpay::PaymentLink.create(para_attr.to_json)
328
+ ```
329
+
330
+ **Parameters:**
331
+
332
+ | Name | Type | Description |
333
+ |-----------------|---------|------------------------------------------------------------------------------|
334
+ |amount* | integer | Amount to be paid using the Payment Link. |
335
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
336
+ |description | string | A brief description of the Payment Link |
337
+ |reference_id | string | AReference number tagged to a Payment Link. |
338
+ |customer | array | name, email, contact |
339
+ |expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
340
+ |notify | object | sms or email (boolean) |
341
+ |options* | array | Options to associate the offer_id with the Payment Link. Parent parameter under which the order child parameter must be passed. |
342
+
343
+ **Response:**
344
+ ```json
345
+ {
346
+ "accept_partial": false,
347
+ "amount": 3400,
348
+ "amount_paid": 0,
349
+ "cancelled_at": 0,
350
+ "created_at": 1600183040,
351
+ "currency": "INR",
352
+ "customer": {
353
+ "contact": "+919999999999",
354
+ "email": "gaurav.kumar@example.com",
355
+ "name": "Gaurav Kumar"
356
+ },
357
+ "description": "Payment for policy no #23456",
358
+ "expire_by": 0,
359
+ "expired_at": 0,
360
+ "first_min_partial_amount": 0,
361
+ "id": "plink_FdLt0WBldRyE5t",
362
+ "notes": null,
363
+ "notify": {
364
+ "email": true,
365
+ "sms": true
366
+ },
367
+ "payments": null,
368
+ "reference_id": "#425",
369
+ "reminder_enable": false,
370
+ "reminders": [],
371
+ "short_url": "https://rzp.io/i/CM5ohDC",
372
+ "status": "created",
373
+ "user_id": ""
374
+ }
375
+ ```
376
+ -------------------------------------------------------------------------------------------------------
377
+
378
+ ### Managing reminders for payment links
379
+
380
+ ```rb
381
+
382
+ para_attr = {
383
+ "amount": 1000,
384
+ "currency": "INR",
385
+ "accept_partial": true,
386
+ "first_min_partial_amount": 100,
387
+ "reference_id": "#425",
388
+ "description": "Payment for policy no #23456",
389
+ "customer": {
390
+ "name": "Gaurav Kumar",
391
+ "contact": "+919999999999",
392
+ "email": "gaurav.kumar@example.com"
393
+ },
394
+ "notify": {
395
+ "sms": true,
396
+ "email": true
397
+ },
398
+ "reminder_enable": false
399
+ }
400
+
401
+ Razorpay.headers = {"Content-type" => "application/json"}
402
+
403
+ Razorpay::PaymentLink.create(para_attr.to_json)
404
+ ```
405
+
406
+ **Parameters:**
407
+
408
+ | Name | Type | Description |
409
+ |-----------------|---------|------------------------------------------------------------------------------|
410
+ |amount* | integer | Amount to be paid using the Payment Link. |
411
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
412
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
413
+ |description | string | A brief description of the Payment Link |
414
+ |customer | object | name, email, contact |
415
+ |expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
416
+ |notify | object | sms or email (boolean) |
417
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
418
+
419
+ **Response:**
420
+ ```json
421
+ {
422
+ "amount": 340000,
423
+ "amount_due": 340000,
424
+ "amount_paid": 0,
425
+ "billing_end": null,
426
+ "billing_start": null,
427
+ "cancelled_at": null,
428
+ "comment": null,
429
+ "created_at": 1592579126,
430
+ "currency": "INR",
431
+ "currency_symbol": "₹",
432
+ "customer_details": {
433
+ "billing_address": null,
434
+ "contact": "9900990099",
435
+ "customer_contact": "9900990099",
436
+ "customer_email": "gaurav.kumar@example.com",
437
+ "customer_name": "Gaurav Kumar",
438
+ "email": "gaurav.kumar@example.com",
439
+ "gstin": null,
440
+ "id": "cust_F4WNtqj1xb0Duv",
441
+ "name": "Gaurav Kumar",
442
+ "shipping_address": null
443
+ },
444
+ "customer_id": "cust_F4WNtqj1xb0Duv",
445
+ "date": 1592579126,
446
+ "description": "Salon at Home Service",
447
+ "email_status": null,
448
+ "entity": "invoice",
449
+ "expire_by": 1608390326,
450
+ "expired_at": null,
451
+ "first_payment_min_amount": 0,
452
+ "gross_amount": 340000,
453
+ "group_taxes_discounts": false,
454
+ "id": "inv_F4WfpZLk1ct35b",
455
+ "invoice_number": null,
456
+ "issued_at": 1592579126,
457
+ "line_items": [],
458
+ "notes": [],
459
+ "order_id": "order_F4WfpxUzWmYOTl",
460
+ "paid_at": null,
461
+ "partial_payment": false,
462
+ "payment_id": null,
463
+ "receipt": "5757",
464
+ "reminder_enable": false,
465
+ "short_url": "https://rzp.io/i/vitLptM",
466
+ "sms_status": null,
467
+ "status": "issued",
468
+ "tax_amount": 0,
469
+ "taxable_amount": 0,
470
+ "terms": null,
471
+ "type": "link",
472
+ "user_id": "",
473
+ "view_less": true
474
+ }
475
+ ```
476
+ -------------------------------------------------------------------------------------------------------
477
+
478
+ ### Rename labels in checkout section
479
+
480
+ ```rb
481
+
482
+ para_attr = {
483
+ "amount": 500,
484
+ "currency": "INR",
485
+ "accept_partial": true,
486
+ "first_min_partial_amount": 100,
487
+ "description": "For XYZ purpose",
488
+ "customer": {
489
+ "name": "Gaurav Kumar",
490
+ "email": "gaurav.kumar@example.com",
491
+ "contact": "+919999999999"
492
+ },
493
+ "notify": {
494
+ "sms": true,
495
+ "email": true
496
+ },
497
+ "reminder_enable": true,
498
+ "options": {
499
+ "checkout": {
500
+ "partial_payment": {
501
+ "min_amount_label": "Minimum Money to be paid",
502
+ "partial_amount_label": "Pay in parts",
503
+ "partial_amount_description": "Pay at least ₹100",
504
+ "full_amount_label": "Pay the entire amount"
505
+ }
506
+ }
507
+ }
508
+ }
509
+
510
+ Razorpay.headers = {"Content-type" => "application/json"}
511
+
512
+ Razorpay::PaymentLink.create(para_attr.to_json)
513
+ ```
514
+
515
+ **Parameters:**
516
+
517
+ | Name | Type | Description |
518
+ |-----------------|---------|------------------------------------------------------------------------------|
519
+ |amount* | integer | Amount to be paid using the Payment Link. |
520
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
521
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
522
+ |description | string | A brief description of the Payment Link |
523
+ |customer | object | name, email, contact |
524
+ |expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
525
+ |notify | object | sms or email (boolean) |
526
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
527
+ |options* | object | Options to rename the labels for partial payment fields in the checkout form. Parent parameter under which the checkout and partial_payment child parameters must be passed. |
528
+
529
+ **Response:**
530
+ ```json
531
+ {
532
+ "accept_partial": true,
533
+ "amount": 1000,
534
+ "amount_paid": 0,
535
+ "callback_method": "",
536
+ "callback_url": "",
537
+ "cancelled_at": 0,
538
+ "created_at": 1596193199,
539
+ "currency": "INR",
540
+ "customer": {
541
+ "contact": "+919999999999",
542
+ "email": "gaurav.kumar@example.com",
543
+ "name": "Gaurav Kumar"
544
+ },
545
+ "deleted_at": 0,
546
+ "description": "Payment for policy no #23456",
547
+ "expire_by": 0,
548
+ "expired_at": 0,
549
+ "first_min_partial_amount": 100,
550
+ "id": "plink_FL4vbXVKfW7PAz",
551
+ "notes": null,
552
+ "notify": {
553
+ "email": true,
554
+ "sms": true
555
+ },
556
+ "payments": null,
557
+ "reference_id": "#42321",
558
+ "reminder_enable": true,
559
+ "reminders": [],
560
+ "short_url": "https://rzp.io/i/F4GC9z1",
561
+ "source": "",
562
+ "source_id": "",
563
+ "status": "created",
564
+ "updated_at": 1596193199,
565
+ "user_id": ""
566
+ }
567
+ ```
568
+ -------------------------------------------------------------------------------------------------------
569
+
570
+ ### Change Business name
571
+
572
+ ```rb
573
+
574
+ para_attr = {
575
+ "amount": 1000,
576
+ "currency": "INR",
577
+ "accept_partial": true,
578
+ "first_min_partial_amount": 100,
579
+ "reference_id": "#2234542",
580
+ "description": "Payment for policy no #23456",
581
+ "customer": {
582
+ "name": "Gaurav Kumar",
583
+ "contact": "+919999999999",
584
+ "email": "gaurav.kumar@example.com"
585
+ },
586
+ "notify": {
587
+ "sms": true,
588
+ "email": true
589
+ },
590
+ "reminder_enable": true,
591
+ "options": {
592
+ "checkout": {
593
+ "name": "Lacme Corp"
594
+ }
595
+ }
596
+ }
597
+
598
+ Razorpay.headers = {"Content-type" => "application/json"}
599
+
600
+ Razorpay::PaymentLink.create(para_attr.to_json)
601
+ ```
602
+
603
+ **Parameters:**
604
+
605
+ | Name | Type | Description |
606
+ |-----------------|---------|------------------------------------------------------------------------------|
607
+ |amount* | integer | Amount to be paid using the Payment Link. |
608
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
609
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
610
+ |first_min_partial_amount | integer | |
611
+ |description | string | A brief description of the Payment Link |
612
+ |customer | object | name, email, contact |
613
+ |notify | object | sms or email (boolean) |
614
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
615
+ |options* | object | Option to customize the business name. Parent parameter under which the checkout child parameter must be passed.|
616
+
617
+ **Response:**
618
+ ```json
619
+ {
620
+ "accept_partial": true,
621
+ "amount": 1000,
622
+ "amount_paid": 0,
623
+ "callback_method": "",
624
+ "callback_url": "",
625
+ "cancelled_at": 0,
626
+ "created_at": 1596187657,
627
+ "currency": "INR",
628
+ "customer": {
629
+ "contact": "+919999999999",
630
+ "email": "gaurav.kumar@example.com",
631
+ "name": "Gaurav Kumar"
632
+ },
633
+ "description": "Payment for policy no #23456",
634
+ "expire_by": 0,
635
+ "expired_at": 0,
636
+ "first_min_partial_amount": 100,
637
+ "id": "plink_FL3M2gJFs1Jkma",
638
+ "notes": null,
639
+ "notify": {
640
+ "email": true,
641
+ "sms": true
642
+ },
643
+ "payments": null,
644
+ "reference_id": "#2234542",
645
+ "reminder_enable": true,
646
+ "reminders": [],
647
+ "short_url": "https://rzp.io/i/at2OOsR",
648
+ "source": "",
649
+ "source_id": "",
650
+ "status": "created",
651
+ "updated_at": 1596187657,
652
+ "user_id": ""
653
+ }
654
+ ```
655
+ -------------------------------------------------------------------------------------------------------
656
+
657
+ ### Prefill checkout fields
658
+
659
+ ```rb
660
+
661
+ para_attr = {
662
+ "amount": 1000,
663
+ "currency": "INR",
664
+ "accept_partial": true,
665
+ "first_min_partial_amount": 100,
666
+ "reference_id": "#417",
667
+ "description": "Payment for policy no #23456",
668
+ "customer": {
669
+ "name": "Gaurav Kumar",
670
+ "contact": "+919999999999",
671
+ "email": "gaurav.kumar@example.com"
672
+ },
673
+ "notify": {
674
+ "sms": true,
675
+ "email": true
676
+ },
677
+ "reminder_enable": true,
678
+ "options": {
679
+ "checkout": {
680
+ "prefill": {
681
+ "method": "card",
682
+ "card[name]": "Gaurav Kumar",
683
+ "card[number]": "4111111111111111",
684
+ "card[expiry]": "12/21",
685
+ "card[cvv]": "123"
686
+ }
687
+ }
688
+ }
689
+ }
690
+
691
+ Razorpay.headers = {"Content-type" => "application/json"}
692
+
693
+ Razorpay::PaymentLink.create(para_attr.to_json)
694
+ ```
695
+
696
+ **Parameters:**
697
+
698
+ | Name | Type | Description |
699
+ |-----------------|---------|------------------------------------------------------------------------------|
700
+ |amount* | integer | Amount to be paid using the Payment Link. |
701
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
702
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
703
+ |first_min_partial_amount | integer | |
704
+ |description | string | A brief description of the Payment Link |
705
+ |customer | object | name, email, contact |
706
+ |notify | object | sms or email (boolean) |
707
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
708
+ |options* | array | Options to customize Checkout. Parent parameter under which the checkout and prefill child parameters must be passed.|
709
+
710
+ **Response:**
711
+ For prefill checkout fields response please click [here](https://razorpay.com/docs/payment-links/api/new/advanced-options/customize/prefill/)
712
+
713
+ -------------------------------------------------------------------------------------------------------
714
+
715
+ ### Customize payment methods
716
+
717
+ ```rb
718
+
719
+ para_attr = {
720
+ "amount": 500,
721
+ "currency": "INR",
722
+ "accept_partial": true,
723
+ "first_min_partial_amount": 100,
724
+ "description": "For XYZ purpose",
725
+ "customer": {
726
+ "name": "Gaurav Kumar",
727
+ "email": "gaurav.kumar@example.com",
728
+ "contact": "+919999999999"
729
+ },
730
+ "notify": {
731
+ "sms": true,
732
+ "email": true
733
+ },
734
+ "reminder_enable": true,
735
+ "options": {
736
+ "checkout": {
737
+ "method": {
738
+ "netbanking": "1",
739
+ "card": "1",
740
+ "upi": "0",
741
+ "wallet": "0"
742
+ }
743
+ }
744
+ }
745
+ }
746
+
747
+ Razorpay.headers = {"Content-type" => "application/json"}
748
+
749
+ Razorpay::PaymentLink.create(para_attr.to_json)
750
+ ```
751
+
752
+ **Parameters:**
753
+
754
+ | Name | Type | Description |
755
+ |-----------------|---------|------------------------------------------------------------------------------|
756
+ |amount* | integer | Amount to be paid using the Payment Link. |
757
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
758
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
759
+ |first_min_partial_amount | integer | |
760
+ |description | string | A brief description of the Payment Link |
761
+ |customer | object | name, email, contact |
762
+ |notify | object | sms or email (boolean) |
763
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
764
+ |options* | object | Options to display or hide payment methods on the Checkout section. Parent parameter under which the checkout and method child parameters must be passed.|
765
+
766
+ **Response:**
767
+ ```json
768
+ {
769
+ "accept_partial": true,
770
+ "amount": 1000,
771
+ "amount_paid": 0,
772
+ "callback_method": "",
773
+ "callback_url": "",
774
+ "cancelled_at": 0,
775
+ "created_at": 1596188371,
776
+ "currency": "INR",
777
+ "customer": {
778
+ "contact": "+919999999999",
779
+ "email": "gaurav.kumar@example.com",
780
+ "name": "Gaurav Kumar"
781
+ },
782
+ "deleted_at": 0,
783
+ "description": "Payment for policy no #23456",
784
+ "expire_by": 0,
785
+ "expired_at": 0,
786
+ "first_min_partial_amount": 100,
787
+ "id": "plink_FL3YbdvN2Cj6gh",
788
+ "notes": null,
789
+ "notify": {
790
+ "email": true,
791
+ "sms": true
792
+ },
793
+ "payments": null,
794
+ "reference_id": "#543422",
795
+ "reminder_enable": true,
796
+ "reminders": [],
797
+ "short_url": "https://rzp.io/i/wKiXKud",
798
+ "source": "",
799
+ "source_id": "",
800
+ "status": "created",
801
+ "updated_at": 1596188371,
802
+ "user_id": ""
803
+ }
804
+ ```
805
+ -------------------------------------------------------------------------------------------------------
806
+
807
+ ### Set checkout fields as read-only
808
+
809
+ ```rb
810
+ para_attr = {
811
+ "amount": 1000,
812
+ "currency": "INR",
813
+ "accept_partial": true,
814
+ "first_min_partial_amount": 100,
815
+ "reference_id": "#20",
816
+ "description": "Payment for policy no #23456",
817
+ "customer": {
818
+ "name": "Gaurav Kumar",
819
+ "contact": "+919999999999",
820
+ "email": "gaurav.kumar@example.com"
821
+ },
822
+ "notify": {
823
+ "sms": true,
824
+ "email": true
825
+ },
826
+ "reminder_enable": true,
827
+ "options": {
828
+ "checkout": {
829
+ "readonly": {
830
+ "email": "1",
831
+ "contact": "1"
832
+ }
833
+ }
834
+ }
835
+ }
836
+
837
+ Razorpay.headers = {"Content-type" => "application/json"}
838
+
839
+ Razorpay::PaymentLink.create(para_attr.to_json)
840
+ ```
841
+
842
+ **Parameters:**
843
+
844
+ | Name | Type | Description |
845
+ |-----------------|---------|------------------------------------------------------------------------------|
846
+ |amount* | integer | Amount to be paid using the Payment Link. |
847
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
848
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
849
+ |first_min_partial_amount | integer | |
850
+ |description | string | A brief description of the Payment Link |
851
+ |customer | object | name, email, contact |
852
+ |notify | object | sms or email (boolean) |
853
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
854
+ |options* | object | Options to set contact and email as read-only fields on Checkout. Parent parameter under which the checkout and readonly child parameters must be passed.|
855
+
856
+ **Response:**
857
+ ```json
858
+ {
859
+ "accept_partial": true,
860
+ "amount": 1000,
861
+ "amount_paid": 0,
862
+ "callback_method": "",
863
+ "callback_url": "",
864
+ "cancelled_at": 0,
865
+ "created_at": 1596190845,
866
+ "currency": "INR",
867
+ "customer": {
868
+ "contact": "+919999999999",
869
+ "email": "gaurav.kumar@example.com",
870
+ "name": "Gaurav Kumar"
871
+ },
872
+ "deleted_at": 0,
873
+ "description": "Payment for policy no #23456",
874
+ "expire_by": 0,
875
+ "expired_at": 0,
876
+ "first_min_partial_amount": 100,
877
+ "id": "plink_FL4GA1t6FBcaVR",
878
+ "notes": null,
879
+ "notify": {
880
+ "email": true,
881
+ "sms": true
882
+ },
883
+ "payments": null,
884
+ "reference_id": "#19129",
885
+ "reminder_enable": true,
886
+ "reminders": [],
887
+ "short_url": "https://rzp.io/i/QVwUglR",
888
+ "source": "",
889
+ "source_id": "",
890
+ "status": "created",
891
+ "updated_at": 1596190845,
892
+ "user_id": ""
893
+ }
894
+ ```
895
+ -------------------------------------------------------------------------------------------------------
896
+
897
+ ### Implement thematic changes in payment links checkout section
898
+
899
+ ```rb
900
+
901
+ para_attr = {
902
+ "amount": 1000,
903
+ "currency": "INR",
904
+ "accept_partial": true,
905
+ "first_min_partial_amount": 100,
906
+ "reference_id": "#423212",
907
+ "description": "Payment for policy no #23456",
908
+ "customer": {
909
+ "name": "Gaurav Kumar",
910
+ "contact": "+919999999999",
911
+ "email": "gaurav.kumar@example.com"
912
+ },
913
+ "notify": {
914
+ "sms": true,
915
+ "email": true
916
+ },
917
+ "reminder_enable": true,
918
+ "options": {
919
+ "checkout": {
920
+ "theme": {
921
+ "hide_topbar": true
922
+ }
923
+ }
924
+ }
925
+ }
926
+
927
+ Razorpay.headers = {"Content-type" => "application/json"}
928
+
929
+ Razorpay::PaymentLink.create(para_attr.to_json)
930
+ ```
931
+
932
+ **Parameters:**
933
+
934
+ | Name | Type | Description |
935
+ |-----------------|---------|------------------------------------------------------------------------------|
936
+ |amount* | integer | Amount to be paid using the Payment Link. |
937
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
938
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
939
+ |first_min_partial_amount | integer | |
940
+ |description | string | A brief description of the Payment Link |
941
+ |customer | object | name, email, contact |
942
+ |notify | object | sms or email (boolean) |
943
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
944
+ |options* | object | Options to show or hide the top bar. Parent parameter under which the checkout and theme child parameters must be passed.|
945
+
946
+ **Response:**
947
+ ```json
948
+ {
949
+ "accept_partial": true,
950
+ "amount": 1000,
951
+ "amount_paid": 0,
952
+ "callback_method": "",
953
+ "callback_url": "",
954
+ "cancelled_at": 0,
955
+ "created_at": 1596187814,
956
+ "currency": "INR",
957
+ "customer": {
958
+ "contact": "+919999999999",
959
+ "email": "gaurav.kumar@example.com",
960
+ "name": "Gaurav Kumar"
961
+ },
962
+ "description": "Payment for policy no #23456",
963
+ "expire_by": 0,
964
+ "expired_at": 0,
965
+ "first_min_partial_amount": 100,
966
+ "id": "plink_FL3Oncr7XxXFf6",
967
+ "notes": null,
968
+ "notify": {
969
+ "email": true,
970
+ "sms": true
971
+ },
972
+ "payments": null,
973
+ "reference_id": "#423212",
974
+ "reminder_enable": true,
975
+ "reminders": [],
976
+ "short_url": "https://rzp.io/i/j45EmLE",
977
+ "source": "",
978
+ "source_id": "",
979
+ "status": "created",
980
+ "updated_at": 1596187814,
981
+ "user_id": ""
982
+ }
983
+ ```
984
+ -------------------------------------------------------------------------------------------------------
985
+
986
+ ### Rename labels in payment details section
987
+
988
+ ```rb
989
+ para_attr = {
990
+ "amount": 1000,
991
+ "currency": "INR",
992
+ "accept_partial": true,
993
+ "first_min_partial_amount": 100,
994
+ "reference_id": "#421",
995
+ "description": "Payment for policy no #23456",
996
+ "customer": {
997
+ "name": "Gaurav Kumar",
998
+ "contact": "+919999999999",
999
+ "email": "gaurav.kumar@example.com"
1000
+ },
1001
+ "notify": {
1002
+ "sms": true,
1003
+ "email": true
1004
+ },
1005
+ "reminder_enable": true,
1006
+ "options": {
1007
+ "checkout": {
1008
+ "partial_payment": {
1009
+ "min_amount_label": "Minimum Money to be paid",
1010
+ "partial_amount_label": "Pay in parts",
1011
+ "partial_amount_description": "Pay at least ₹100",
1012
+ "full_amount_label": "Pay the entire amount"
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+
1018
+ Razorpay.headers = {"Content-type" => "application/json"}
1019
+
1020
+ Razorpay::PaymentLink.create(para_attr.to_json)
1021
+ ```
1022
+
1023
+ **Parameters:**
1024
+
1025
+ | Name | Type | Description |
1026
+ |-----------------|---------|------------------------------------------------------------------------------|
1027
+ |amount* | integer | Amount to be paid using the Payment Link. |
1028
+ |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
1029
+ |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
1030
+ |first_min_partial_amount | integer | |
1031
+ |description | string | A brief description of the Payment Link |
1032
+ |customer | object | name, email, contact |
1033
+ |notify | object | sms or email (boolean) |
1034
+ |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
1035
+ |options* | object | Parent parameter under which the hosted_page and label child parameters must be passed.|
1036
+
1037
+ **Response:**
1038
+ For rename labels in payment details section response please click [here](https://razorpay.com/docs/payment-links/api/new/advanced-options/customize/rename-payment-details-labels/)
1039
+
1040
+ -------------------------------------------------------------------------------------------------------
1041
+
1042
+ **PN: * indicates mandatory fields**
1043
+ <br>
1044
+ <br>
1045
+ **For reference click [here](https://razorpay.com/docs/api/payment-links/)**