razorruby 3.0.1

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 (171) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.editorconfig +12 -0
  4. data/.github/dependabot.yml +8 -0
  5. data/.github/workflows/ruby.yml +38 -0
  6. data/.gitignore +23 -0
  7. data/.rubocop.yml +22 -0
  8. data/.simplecov +3 -0
  9. data/CHANGELOG.md +168 -0
  10. data/Gemfile +4 -0
  11. data/LICENSE.txt +22 -0
  12. data/README.md +102 -0
  13. data/Rakefile +26 -0
  14. data/documents/Invoice.md +539 -0
  15. data/documents/addon.md +191 -0
  16. data/documents/card.md +610 -0
  17. data/documents/customer.md +163 -0
  18. data/documents/emandate.md +492 -0
  19. data/documents/fund.md +89 -0
  20. data/documents/items.md +208 -0
  21. data/documents/order.md +281 -0
  22. data/documents/papernach.md +738 -0
  23. data/documents/payment.md +826 -0
  24. data/documents/paymentLink.md +1063 -0
  25. data/documents/paymentVerification.md +79 -0
  26. data/documents/plan.md +184 -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/subscriptions.md +752 -0
  33. data/documents/tokens.md +262 -0
  34. data/documents/transfers.md +781 -0
  35. data/documents/upi.md +545 -0
  36. data/documents/virtualAccount.md +591 -0
  37. data/lib/ca-bundle.crt +3988 -0
  38. data/lib/extensions/httparty/hash_conversions.rb +44 -0
  39. data/lib/razorpay/addon.rb +32 -0
  40. data/lib/razorpay/card.rb +17 -0
  41. data/lib/razorpay/collection.rb +6 -0
  42. data/lib/razorpay/constants.rb +6 -0
  43. data/lib/razorpay/customer.rb +42 -0
  44. data/lib/razorpay/entity.rb +46 -0
  45. data/lib/razorpay/errors/bad_request_error.rb +14 -0
  46. data/lib/razorpay/errors/gateway_error.rb +7 -0
  47. data/lib/razorpay/errors/razorpay_error.rb +11 -0
  48. data/lib/razorpay/errors/server_error.rb +7 -0
  49. data/lib/razorpay/errors.rb +4 -0
  50. data/lib/razorpay/fund_account.rb +19 -0
  51. data/lib/razorpay/invoice.rb +68 -0
  52. data/lib/razorpay/item.rb +34 -0
  53. data/lib/razorpay/order.rb +39 -0
  54. data/lib/razorpay/payment.rb +116 -0
  55. data/lib/razorpay/payment_link.rb +36 -0
  56. data/lib/razorpay/payment_method.rb +17 -0
  57. data/lib/razorpay/plan.rb +24 -0
  58. data/lib/razorpay/qr_code.rb +34 -0
  59. data/lib/razorpay/refund.rb +27 -0
  60. data/lib/razorpay/request.rb +119 -0
  61. data/lib/razorpay/settlement.rb +39 -0
  62. data/lib/razorpay/subscription.rb +60 -0
  63. data/lib/razorpay/subscription_registration.rb +16 -0
  64. data/lib/razorpay/transfer.rb +35 -0
  65. data/lib/razorpay/utility.rb +57 -0
  66. data/lib/razorpay/virtual_account.rb +49 -0
  67. data/lib/razorpay.rb +37 -0
  68. data/razorpay-ruby.gemspec +36 -0
  69. data/test/fixtures/addon_collection.json +60 -0
  70. data/test/fixtures/bad_request_error.json +7 -0
  71. data/test/fixtures/cancel_invoice.json +44 -0
  72. data/test/fixtures/cancel_subscription.json +20 -0
  73. data/test/fixtures/create_json_payment.json +13 -0
  74. data/test/fixtures/customer_collection.json +22 -0
  75. data/test/fixtures/delete_token.json +3 -0
  76. data/test/fixtures/downtimes_collection.json +21 -0
  77. data/test/fixtures/empty.json +2 -0
  78. data/test/fixtures/fake_addon.json +24 -0
  79. data/test/fixtures/fake_captured_payment.json +13 -0
  80. data/test/fixtures/fake_card.json +9 -0
  81. data/test/fixtures/fake_create_upi_payment.json +3 -0
  82. data/test/fixtures/fake_customer.json +8 -0
  83. data/test/fixtures/fake_customer_edited.json +8 -0
  84. data/test/fixtures/fake_direct_transfer.json +32 -0
  85. data/test/fixtures/fake_downtime.json +14 -0
  86. data/test/fixtures/fake_fund_account.json +18 -0
  87. data/test/fixtures/fake_instant_settlement.json +19 -0
  88. data/test/fixtures/fake_invoice.json +30 -0
  89. data/test/fixtures/fake_item.json +9 -0
  90. data/test/fixtures/fake_order.json +10 -0
  91. data/test/fixtures/fake_order_transfers.json +88 -0
  92. data/test/fixtures/fake_otp_generate.json +19 -0
  93. data/test/fixtures/fake_otp_resend.json +7 -0
  94. data/test/fixtures/fake_otp_submit.json +5 -0
  95. data/test/fixtures/fake_payment.json +14 -0
  96. data/test/fixtures/fake_payment_authorized_webhook.json +40 -0
  97. data/test/fixtures/fake_payment_bank_transfer.json +12 -0
  98. data/test/fixtures/fake_payment_link.json +40 -0
  99. data/test/fixtures/fake_pending_update.json +30 -0
  100. data/test/fixtures/fake_plan.json +26 -0
  101. data/test/fixtures/fake_qrcode.json +20 -0
  102. data/test/fixtures/fake_qrcode_close.json +22 -0
  103. data/test/fixtures/fake_recurring.json +5 -0
  104. data/test/fixtures/fake_refund.json +8 -0
  105. data/test/fixtures/fake_refunded_payment.json +14 -0
  106. data/test/fixtures/fake_settlement.json +11 -0
  107. data/test/fixtures/fake_settlement_on_demand.json +39 -0
  108. data/test/fixtures/fake_subscription.json +20 -0
  109. data/test/fixtures/fake_subscription_pause.json +19 -0
  110. data/test/fixtures/fake_subscription_registration.json +91 -0
  111. data/test/fixtures/fake_subscription_resume.json +19 -0
  112. data/test/fixtures/fake_token.json +31 -0
  113. data/test/fixtures/fake_transfer.json +18 -0
  114. data/test/fixtures/fake_transfer_reverse.json +15 -0
  115. data/test/fixtures/fake_update_payment.json +39 -0
  116. data/test/fixtures/fake_validate_vpa.json +5 -0
  117. data/test/fixtures/fake_virtual_account.json +21 -0
  118. data/test/fixtures/fake_virtual_account_allowed.json +46 -0
  119. data/test/fixtures/fake_virtual_account_closed.json +21 -0
  120. data/test/fixtures/fake_virtual_account_collection.json +48 -0
  121. data/test/fixtures/fake_virtual_account_receiver.json +46 -0
  122. data/test/fixtures/fund_collection.json +20 -0
  123. data/test/fixtures/hello_response.json +3 -0
  124. data/test/fixtures/invoice_collection.json +93 -0
  125. data/test/fixtures/issue_invoice.json +44 -0
  126. data/test/fixtures/item_collection.json +24 -0
  127. data/test/fixtures/order_collection.json +36 -0
  128. data/test/fixtures/order_payments.json +29 -0
  129. data/test/fixtures/payment_collection.json +32 -0
  130. data/test/fixtures/payment_collection_with_one_payment.json +19 -0
  131. data/test/fixtures/payment_link_collection.json +43 -0
  132. data/test/fixtures/payment_link_response.json +3 -0
  133. data/test/fixtures/payment_methods_collection.json +149 -0
  134. data/test/fixtures/plan_collection.json +32 -0
  135. data/test/fixtures/qrcode_collection.json +50 -0
  136. data/test/fixtures/qrcode_payments_collection.json +74 -0
  137. data/test/fixtures/refund_collection.json +30 -0
  138. data/test/fixtures/refund_collection_for_payment.json +22 -0
  139. data/test/fixtures/settlement_collection.json +26 -0
  140. data/test/fixtures/settlement_instant_collection.json +84 -0
  141. data/test/fixtures/settlement_report_collection.json +117 -0
  142. data/test/fixtures/subscription_collection.json +26 -0
  143. data/test/fixtures/success.json +3 -0
  144. data/test/fixtures/tokens_collection.json +36 -0
  145. data/test/fixtures/transfer_settlements_collection.json +38 -0
  146. data/test/fixtures/transfers_collection.json +41 -0
  147. data/test/fixtures/update_invoice.json +44 -0
  148. data/test/fixtures/welcome.json +3 -0
  149. data/test/razorpay/test_addon.rb +76 -0
  150. data/test/razorpay/test_card.rb +23 -0
  151. data/test/razorpay/test_customer.rb +69 -0
  152. data/test/razorpay/test_entity.rb +55 -0
  153. data/test/razorpay/test_fund_account.rb +42 -0
  154. data/test/razorpay/test_invoice.rb +143 -0
  155. data/test/razorpay/test_item.rb +66 -0
  156. data/test/razorpay/test_order.rb +71 -0
  157. data/test/razorpay/test_payment.rb +303 -0
  158. data/test/razorpay/test_payment_link.rb +83 -0
  159. data/test/razorpay/test_plan.rb +65 -0
  160. data/test/razorpay/test_qr_code.rb +63 -0
  161. data/test/razorpay/test_razorpay.rb +53 -0
  162. data/test/razorpay/test_refund.rb +56 -0
  163. data/test/razorpay/test_request.rb +15 -0
  164. data/test/razorpay/test_settlement.rb +76 -0
  165. data/test/razorpay/test_subscription.rb +190 -0
  166. data/test/razorpay/test_subscription_registration.rb +58 -0
  167. data/test/razorpay/test_transfer.rb +77 -0
  168. data/test/razorpay/test_utility.rb +84 -0
  169. data/test/razorpay/test_virtual_account.rb +135 -0
  170. data/test/test_helper.rb +54 -0
  171. metadata +400 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 13aa00a30d4be2473012b234bccc124b7893df61acb8784bd56bf7b6faf2bc32
4
+ data.tar.gz: 76dfed2f3df012daf6f81a01269fe4fd26ba8d98bfcf8fffe4cd91a7294a6dcb
5
+ SHA512:
6
+ metadata.gz: 13d7883ad602d1347929e710385525b9a1748517700f2a2ed0a3a0fa8898313c7a746f227eba1fdc2e7b51cbc23969400e317eeaacec3ac7c7d1a6db5617a66f
7
+ data.tar.gz: 862a2010d15d02f1dd2bb3bbff0ccadf4d54fb7d6de97da1c737812f6e6b2f41da096ab3f73ee1bb60b2f4a4189ba9176897f12b2a24124eeaf5b8146819858e
data/.DS_Store ADDED
Binary file
data/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ ; This file is for unifying the coding style for different editors and IDEs.
2
+ ; More information at http://EditorConfig.org
3
+
4
+ root = true
5
+ ; Use 2 spaces for indentation in all files
6
+ [*]
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ indent_style = space
11
+ indent_size = 2
12
+ insert_final_newline = true
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "04:00"
8
+ timezone: Asia/Calcutta
@@ -0,0 +1,38 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test:
21
+
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby-version: ['2.6', '2.7', '3.0']
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
31
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
32
+ # uses: ruby/setup-ruby@v1
33
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
34
+ with:
35
+ ruby-version: ${{ matrix.ruby-version }}
36
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
37
+ - name: Run tests
38
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ vendor
data/.rubocop.yml ADDED
@@ -0,0 +1,22 @@
1
+ Metrics/AbcSize:
2
+ Max: 18
3
+
4
+ # Configuration parameters: AllowURI, URISchemes.
5
+ Metrics/LineLength:
6
+ Max: 110
7
+ AllowURI: true
8
+
9
+ Style/SymbolArray:
10
+ MinSize: 3
11
+
12
+ Metrics/MethodLength:
13
+ Max: 15
14
+
15
+ Naming/UncommunicativeMethodParamName:
16
+ MinNameLength: 1
17
+ AllowNamesEndingInNumbers: false
18
+
19
+ # Near-duplicate of a file from an external package, want to keep changes minimal
20
+ AllCops:
21
+ Exclude:
22
+ - 'lib/extensions/httparty/hash_conversions.rb'
data/.simplecov ADDED
@@ -0,0 +1,3 @@
1
+ SimpleCov.start do
2
+ add_filter "test"
3
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,168 @@
1
+ # Change Log
2
+
3
+ Changelog for Razorpay-Ruby SDK.
4
+
5
+ ## Unreleased
6
+
7
+ ## [3.0.1] - 2022-07-11
8
+
9
+ ### Added
10
+
11
+ - Added Third party validation API for Payments (create_upi, validate_vpa)
12
+ - New API for Payment Methods
13
+ - Doc Updated
14
+
15
+ ## [3.0.0] - 2022-06-03
16
+
17
+ ### Added
18
+
19
+ - QR code end point API
20
+ - Settlement end point API
21
+ - Fund Account end point API
22
+ - PaymentLinks end point API
23
+ - Item end point API
24
+ - New APIs for Invoices (Delete, Send/resend)
25
+ - New API for Customers (Fetch Tokens, Delete Token)
26
+ - New APIs for Subscriptions (Update, Pause, Resume, Pending update, Delete offer)
27
+ - New API for Addons (Fetch all Addons)
28
+ - New API for Refund (Update refund)
29
+ - New APIs for Payments (Update, Create recurring, Create Json, Payment downtime details, refunds of a payment, Otp generate, Otp submit, Otp resend)
30
+ - New APIs for Virtual Account (Add receiver, add an allowed payer account, delete an allowed payer account)
31
+ - Updated Testcases
32
+ - Updated Readme
33
+
34
+ ## [2.4.1] - 2019-04-09
35
+
36
+ ### Fixed
37
+
38
+ - Subscription signature verification [[#81][81]]
39
+
40
+ ### Added
41
+
42
+ - Ruby version to user agent header [[#79][79]]
43
+
44
+ ## [2.4.0] - 2019-04-08
45
+
46
+ ### Changed
47
+
48
+ - Indexed keys used in x-www-form-urlencoded request bodies [[#68][68]]
49
+ - Updated Utility verify\_\* methods to return verification bool [[#72][72]]
50
+
51
+ ### Added
52
+
53
+ - Support for custom JSON options to Entity to_json [[#75][75]]
54
+
55
+ ## [2.3.0] - 2018-04-20
56
+
57
+ ### Added
58
+
59
+ - Support for subscription signature verification
60
+ - Bang! methods (`capture!`, `refund!`) that update the calling entity
61
+
62
+ ## [2.2.0] - 2018-01-29
63
+
64
+ ### Added
65
+
66
+ - Support for Subscriptions
67
+
68
+ ## [2.1.0] - 2017-11-17
69
+
70
+ ### Changed
71
+
72
+ - Generic `Razorpay::Error` is thrown when server is unreachable
73
+
74
+ ### Added
75
+
76
+ - Support for making raw requests to the API via `raw_request`.
77
+
78
+ ## [2.1.0.pre] - 2017-08-17
79
+
80
+ ### Added
81
+
82
+ - Support for Virtual Accounts
83
+
84
+ ## [2.0.1] - 2017-07-31
85
+
86
+ ### Fixed
87
+
88
+ - Webhook signature verification
89
+
90
+ ## [2.0.0] - 2017-03-02
91
+
92
+ ### Added
93
+
94
+ - Adds `require` for all Razorpay supported entities
95
+ - All entity objects now throw `NoMethodError` instead of `NameError` if the attribute doesn't exist
96
+ - Adds customer edit API
97
+ - Adds card fetch API
98
+ - Adds custom header support
99
+ - Adds constant time signature verification API for payments and webhooks
100
+ - Adds payment capture-without-fetch API
101
+ - Enables warnings for tests
102
+ - Removes circular `require` calls
103
+ - Adds rake test groups
104
+
105
+ ## [1.2.1] - 2016-12-22
106
+
107
+ ### Changed
108
+
109
+ - Drops ArgumentError checks for local validation. Rely on server side checks instead.
110
+
111
+ ### Added
112
+
113
+ - Support for customers and invoices API
114
+ - Loads Order class by default.
115
+
116
+ ## [1.2.0] - 2016-11-23
117
+
118
+ ### Added
119
+
120
+ - Fixed payment.method as an attribute accessor
121
+
122
+ ## [1.1.0] - 2016-02-25
123
+
124
+ ### Added
125
+
126
+ - Add support for Orders API
127
+ - Bundles the CA Certificate with the gem. See #6
128
+
129
+ ## [1.0.3] - 2015-03-31
130
+
131
+ ### Changed
132
+
133
+ - Handles error requests properly
134
+
135
+ ## [1.0.1] - 2015-02-23
136
+
137
+ ### Added
138
+
139
+ - Added support for ruby versions below 2.0
140
+
141
+ ## [1.0.0] - 2015-01-17
142
+
143
+ ### Added
144
+
145
+ - Initial Release
146
+
147
+ # Diff
148
+
149
+ - [Unreleased](https://github.com/razorpay/razorpay-ruby/compare/2.4.1...HEAD)
150
+ - [2.4.1](https://github.com/razorpay/razorpay-ruby/compare/2.4.0...2.4.1)
151
+ - [2.4.0](https://github.com/razorpay/razorpay-ruby/compare/2.3.0...2.4.0)
152
+ - [2.3.0](https://github.com/razorpay/razorpay-ruby/compare/2.2.0...2.3.0)
153
+ - [2.2.0](https://github.com/razorpay/razorpay-ruby/compare/2.1.0...2.2.0)
154
+ - [2.1.0](https://github.com/razorpay/razorpay-ruby/compare/2.0.1...2.1.0)
155
+ - [2.1.0.pre](https://github.com/razorpay/razorpay-ruby/compare/2.0.1...2.1.0.pre)
156
+ - [2.0.1](https://github.com/razorpay/razorpay-ruby/compare/2.0.0...2.0.1)
157
+ - [2.0.0](https://github.com/razorpay/razorpay-ruby/compare/1.2.1...2.0.0)
158
+ - [1.2.1](https://github.com/razorpay/razorpay-ruby/compare/1.2.0...1.2.1)
159
+ - [1.2.0](https://github.com/razorpay/razorpay-ruby/compare/1.1.0...1.2.0)
160
+ - [1.1.0](https://github.com/razorpay/razorpay-ruby/compare/1.0.3...1.1.0)
161
+ - [1.0.3](https://github.com/razorpay/razorpay-ruby/compare/1.0.1...1.0.3)
162
+ - [1.0.1](https://github.com/razorpay/razorpay-ruby/compare/1.0.0...1.0.1)
163
+
164
+ [68]: https://github.com/razorpay/razorpay-ruby/pull/68
165
+ [72]: https://github.com/razorpay/razorpay-ruby/pull/72
166
+ [75]: https://github.com/razorpay/razorpay-ruby/pull/75
167
+ [79]: https://github.com/razorpay/razorpay-ruby/pull/79
168
+ [81]: https://github.com/razorpay/razorpay-ruby/pull/81
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in razorpay-ruby.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2019 Razorpay
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # Razorpay Ruby bindings
2
+
3
+ [![Build Status](https://travis-ci.org/razorpay/razorpay-ruby.svg?branch=master)](https://travis-ci.org/razorpay/razorpay-ruby) [![Gem Version](https://img.shields.io/badge/gem%20version-v3.0.1-dark%20green.svg)](http://badge.fury.io/rb/razorpay) [![Coverage Status](https://coveralls.io/repos/github/Razorpay/razorpay-ruby/badge.svg?branch=master)](https://coveralls.io/github/Razorpay/razorpay-ruby?branch=master) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
4
+
5
+ This is the base ruby gem for interacting with the Razorpay API. This is primarily meant for users who wish to perform interactions with the Razorpay API programatically.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```rb
12
+ gem 'razorpay'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install razorpay
22
+
23
+ ## Requirements
24
+
25
+ Ruby 2.6.8 or later
26
+ ## Usage
27
+
28
+ Remember to `require 'razorpay'` before anything else.
29
+
30
+ Next, you need to setup your key and secret using the following:
31
+
32
+ ```rb
33
+ Razorpay.setup('key_id', 'key_secret')
34
+ ```
35
+
36
+ You can set customer headers for your requests using the following:
37
+ ```rb
38
+ Razorpay.headers = {"CUSTOM_APP_HEADER" => "CUSTOM_VALUE"}
39
+ ```
40
+
41
+ You can find your API keys at <https://dashboard.razorpay.com/#/app/keys>.
42
+
43
+ If you are using rails, the right place to do this might be `config/initializers/razorpay.rb`.
44
+
45
+ ## Supported Resources
46
+ - [Customer](documents/customer.md)
47
+ - [Token](documents/tokens.md)
48
+ - [Order](documents/order.md)
49
+ - [Payments](documents/payment.md)
50
+ - [Settlements](documents/settlement.md)
51
+ - [Fund](documents/fund.md)
52
+ - [Refunds](documents/refund.md)
53
+ - [Invoice](documents/Invoice.md)
54
+ - [Plan](documents/plan.md)
55
+ - [Item](documents/items.md)
56
+ - [Subscriptions](documents/subscriptions.md)
57
+ - [Add-on](documents/addon.md)
58
+ - [Payment Links](documents/paymentLink.md)
59
+ - [Smart Collect](documents/virtualAccount.md)
60
+ - [Transfer](documents/transfers.md)
61
+ - [QR Code](documents/qrcode.md)
62
+ - [Emandate](documents/emandate.md)
63
+ - [Cards](documents/card.md)
64
+ - [Paper NACH](documents/papernach.md)
65
+ - [UPI](documents/upi.md)
66
+ - [Register Emandate and Charge First Payment Together](documents/registerEmandate.md)
67
+ - [Register NACH and Charge First Payment Together](documents/registerNach.md)
68
+ - [Payment Verification](documents/paymentVerification.md)
69
+ ## Development
70
+
71
+ - Everything is namespaced under the Razorpay module
72
+ - We use rubocop for checking style guidelines
73
+ - Rake + MiniTest is using as the testrunner
74
+ - Webmock is used as the request mock framework
75
+ - HTTParty is used for making requests
76
+ - Travis is used for CI
77
+ - Coveralls is used for coverage reports
78
+
79
+ ## Contributing
80
+
81
+ 1. Fork it ( https://github.com/razorpay/razorpay-ruby/fork )
82
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
83
+ 3. Run `rake` and `rubocop` after making your changes to make sure you didn't break anything
84
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
85
+ 5. Push to the branch (`git push origin my-new-feature`)
86
+ 6. Create a new Pull Request
87
+
88
+ ## Release
89
+
90
+ Steps to follow for a release:
91
+
92
+ 0. Merge the branch with the new code to master.
93
+ 1. Bump the Version in `lib/razorpay/constants.rb`
94
+ 2. Rename Unreleased to the new tag in `CHANGELOG`
95
+ 3. Fix links at bottom in `CHANGELOG`
96
+ 4. Commit (message should include version number)
97
+ 5. Tag the release and push to GitHub. Get the tag signed using Razorpay GPG key.
98
+ 6. Create a release on GitHub using the website with more details about the release
99
+ 7. Run `gem build razorpay-ruby.gemspec`
100
+ 8. Run `gem push razorpay-{version}.gem`
101
+
102
+ `gem push` will ask you for credentials, if you are not logged in already.
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ require 'rake/testtask'
2
+
3
+ # Don't try to run rubocop in 1.9.3
4
+ require 'rubocop/rake_task' if RUBY_VERSION >= '2.1.0'
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.libs << 'test'
8
+ t.warning = true
9
+ t.pattern = 'test/razorpay/test_*.rb'
10
+ end
11
+
12
+ desc 'Run tests'
13
+ task default: [:test]
14
+
15
+ desc 'Run rubocop'
16
+ task :rubocop do
17
+ RuboCop::RakeTask.new
18
+ end
19
+
20
+ FileList['test/razorpay/test_*.rb'].each do |file|
21
+ group = File.basename(file, '.rb').split('_').drop(1).join('_').to_sym
22
+ Rake::TestTask.new(group) do |t|
23
+ t.libs << 'test'
24
+ t.test_files = [file]
25
+ end
26
+ end