razorpay 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/CHANGELOG +8 -1
- data/README.md +14 -8
- data/lib/razorpay/constants.rb +1 -1
- data/lib/razorpay/payment.rb +5 -0
- data/test/fixtures/fake_payment.json +3 -2
- data/test/razorpay/test_payment.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17c4aad5f24c1236ebd6451887926d9bf5b45b34
|
4
|
+
data.tar.gz: ae0ef8f24f6de62bdf014e9a22b0a70de095a924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 127d16bbbc8b8a19a8cc4a0be9cab4d167781af3dd4fa847a4f9d7293044f732c5608f3eed52a82ec786280305fd80d5b35ddc3c448eeceaa5cd9f7f5652b012
|
7
|
+
data.tar.gz: eefee7a5c5011b3f88e0efec3763fc16ecda6f7469bf3e65a732adc3db1c228cef45ac8dea52f43c5fa0f39a23df67c967e5c1de4427fbb6610988dc66f115f5
|
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
Changelog for Razorpay-Ruby SDK.
|
4
4
|
|
5
|
+
## Unreleased
|
6
|
+
|
7
|
+
## [1.2.0] - 2016-11-23
|
8
|
+
### Added
|
9
|
+
- Fixed payment.method as an attribute accessor
|
10
|
+
|
5
11
|
## [1.1.0] - 2016-02-25
|
6
12
|
### Added
|
7
13
|
- Add support for Orders API
|
@@ -19,7 +25,8 @@ Changelog for Razorpay-Ruby SDK.
|
|
19
25
|
### Added
|
20
26
|
- Initial Release
|
21
27
|
|
22
|
-
[Unreleased]: https://github.com/razorpay/razorpay-ruby/compare/1.
|
28
|
+
[Unreleased]: https://github.com/razorpay/razorpay-ruby/compare/1.2.0...HEAD
|
29
|
+
[1.2.0]: https://github.com/razorpay/razorpay-ruby/compare/1.1.0...1.2.0
|
23
30
|
[1.1.0]: https://github.com/razorpay/razorpay-ruby/compare/1.0.3...1.1.0
|
24
31
|
[1.0.3]: https://github.com/razorpay/razorpay-ruby/compare/1.0.1...1.0.3
|
25
32
|
[1.0.1]: https://github.com/razorpay/razorpay-ruby/compare/1.0.0...1.0.1
|
data/README.md
CHANGED
@@ -8,7 +8,9 @@ This is the base ruby gem for interacting with the Razorpay API. This is primari
|
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
|
11
|
+
```rb
|
12
|
+
gem 'razorpay'
|
13
|
+
```
|
12
14
|
|
13
15
|
And then execute:
|
14
16
|
|
@@ -24,7 +26,9 @@ Remember to `require razorpay` before anything else.
|
|
24
26
|
|
25
27
|
Next, you need to setup your key and secret using the following:
|
26
28
|
|
27
|
-
|
29
|
+
```rb
|
30
|
+
Razorpay.setup("merchant_key_id", "merchant_key_secret")
|
31
|
+
```
|
28
32
|
|
29
33
|
You can find your API keys at <https://dashboard.razorpay.com/#/app/keys>.
|
30
34
|
|
@@ -32,13 +36,17 @@ If you are using rails, the right place to do this might be `config/initializers
|
|
32
36
|
|
33
37
|
The most common construct is capturing a payment, which you do via the following:
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
```rb
|
40
|
+
Razorpay::Payment.fetch("pay-ment_id").capture({amount:500})
|
41
|
+
# Note that the amount should come from your session, so as to verify
|
42
|
+
# that the purchase was correctly done and not tampered
|
43
|
+
```
|
38
44
|
|
39
45
|
You can handle refunds using the following constructs:
|
40
46
|
|
41
|
-
|
47
|
+
```rb
|
48
|
+
Razorpay::Payment.fetch("payment_id").refund({amount:500})
|
49
|
+
```
|
42
50
|
|
43
51
|
For other applications (such as fetching payments and refunds),
|
44
52
|
see our online documentation on <https://docs.razorpay.com>
|
@@ -82,5 +90,3 @@ payments = order.payments
|
|
82
90
|
4. Commit your changes (`git commit -am 'Add some feature'`)
|
83
91
|
5. Push to the branch (`git push origin my-new-feature`)
|
84
92
|
6. Create a new Pull Request
|
85
|
-
|
86
|
-
##
|
data/lib/razorpay/constants.rb
CHANGED
data/lib/razorpay/payment.rb
CHANGED
@@ -21,6 +21,8 @@ module Razorpay
|
|
21
21
|
payment = Razorpay::Payment.fetch(@payment_id)
|
22
22
|
assert_instance_of Razorpay::Payment, payment, 'Payment not an instance of Payment class'
|
23
23
|
assert_equal @payment_id, payment.id, 'Payment IDs do not match'
|
24
|
+
assert_equal 500, payment.amount, 'Payment amount is accessible'
|
25
|
+
assert_equal 'card', payment.method, 'Payment method is accessible'
|
24
26
|
end
|
25
27
|
|
26
28
|
def test_all_payments
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: razorpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abhay Rana
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
152
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.5.1
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: Razorpay's Ruby API
|