From d8f4194642701f60f2672b494ffedcc48250fc4c Mon Sep 17 00:00:00 2001 From: Dharshan Bharathuru Date: Wed, 13 Feb 2019 12:46:54 +0530 Subject: [PATCH 1/5] Return verfied state --- lib/razorpay/utility.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/razorpay/utility.rb b/lib/razorpay/utility.rb index e485c03..16669d4 100644 --- a/lib/razorpay/utility.rb +++ b/lib/razorpay/utility.rb @@ -28,6 +28,8 @@ def verify_signature(data, signature, secret) verified = secure_compare(expected_signature, signature) raise SecurityError, 'Signature verification failed' unless verified + + verified end def secure_compare(a, b) From 079f1ed8e4a9ac888ae1a4756413d8235cc106b1 Mon Sep 17 00:00:00 2001 From: Dharshan Bharathuru Date: Thu, 19 Mar 2020 15:34:19 +0530 Subject: [PATCH 2/5] Subscriptio update --- lib/razorpay/subscription.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/razorpay/subscription.rb b/lib/razorpay/subscription.rb index 6b893eb..cedc143 100644 --- a/lib/razorpay/subscription.rb +++ b/lib/razorpay/subscription.rb @@ -21,6 +21,10 @@ def self.all(options = {}) request.all options end + def self.update(id, options = {}) + request.patch id, options + end + def self.cancel(id, options = {}) request.post "#{id}/cancel", options end From 1bdd7bea3efc630baf29907847b017c02d07cdf4 Mon Sep 17 00:00:00 2001 From: Dharshan Bharathuru Date: Thu, 19 Mar 2020 15:55:46 +0530 Subject: [PATCH 3/5] Resolve rubocop exceptions --- .rubocop.yml | 5 ++++- lib/razorpay/entity.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e0a2b37..878e18e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,10 +9,13 @@ Metrics/LineLength: Style/SymbolArray: MinSize: 3 +Style/FrozenStringLiteralComment: + Enabled: false + Metrics/MethodLength: Max: 15 -Naming/UncommunicativeMethodParamName: +Naming/MethodParameterName: MinNameLength: 1 AllowNamesEndingInNumbers: false diff --git a/lib/razorpay/entity.rb b/lib/razorpay/entity.rb index f198aaa..8c7a61b 100644 --- a/lib/razorpay/entity.rb +++ b/lib/razorpay/entity.rb @@ -28,7 +28,7 @@ def respond_to_missing?(method_name, include_private = false) # Public: Convert the Entity object to JSON # Returns the JSON representation of the Entity (as a string) - def to_json + def to_json(*_args) @attributes.to_json end From 4b05cc5184ef22f31a8eab8ffef8e20a744ccce2 Mon Sep 17 00:00:00 2001 From: Dharshan Bharathuru Date: Thu, 19 Mar 2020 15:56:31 +0530 Subject: [PATCH 4/5] Update Readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 977af92..f46747f 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,9 @@ You can find plan API documentation at . From 72b0c187648be8ea5111835c43196cdb5f79bbae Mon Sep 17 00:00:00 2001 From: Dharshan Bharathuru Date: Thu, 19 Mar 2020 16:01:53 +0530 Subject: [PATCH 5/5] Rubocop fix --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 878e18e..e11331a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,6 +12,9 @@ Style/SymbolArray: Style/FrozenStringLiteralComment: Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false + Metrics/MethodLength: Max: 15