tinkoff 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/tinkoff/{response.rb → notification.rb} +9 -1
- data/lib/tinkoff/version.rb +1 -1
- data/lib/tinkoff.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ec4ebb3ad6cd6a6205897175eaa607697ebf21f
|
4
|
+
data.tar.gz: 2e06cb681b00628a74a41177ed8f865a1de29e0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d717451fb4002a0af715eca07391d9c849e9e05b2763704ff2eabd31573cbc50ada59c2623fa26812b1d614ee66cae3e40c8a615ee82fdc778c8d8c3640b3a48
|
7
|
+
data.tar.gz: 86d4c767dacc6a0cc1d8d93dd83d22d8b3a4571e9b9167ad07f242bfcc3e3223b33aa2fa14fc887e3ef65245ae6fb36862678f544ebb287d371147dd2366e96d
|
data/README.md
CHANGED
@@ -58,6 +58,14 @@ Tinkoff::Client.state(1)
|
|
58
58
|
|
59
59
|
You can view all available options in the [official documentation](https://oplata.tinkoff.ru/documentation/?section=aboutMet).
|
60
60
|
|
61
|
+
A notification will be sent to if you provided the URL. You should use it to update the status of your payment / order.
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
notification = Tinkoff::Notification.new(params)
|
65
|
+
order = Order.find(notification.order_id)
|
66
|
+
order.update_attribute(:paid, true)
|
67
|
+
```
|
68
|
+
|
61
69
|
## Development
|
62
70
|
|
63
71
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Tinkoff
|
2
|
-
class
|
2
|
+
class Notification
|
3
3
|
attr_reader :success, :error_code, :message, :details, :amount,
|
4
4
|
:merchant_email, :merchant_name, :order_id, :payment_id, :tran_date
|
5
5
|
|
@@ -15,5 +15,13 @@ module Tinkoff
|
|
15
15
|
@payment_id = params['PaymentId']
|
16
16
|
@tran_date = params['TranDate']
|
17
17
|
end
|
18
|
+
|
19
|
+
def failure?
|
20
|
+
!@success
|
21
|
+
end
|
22
|
+
|
23
|
+
def success?
|
24
|
+
!failure?
|
25
|
+
end
|
18
26
|
end
|
19
27
|
end
|
data/lib/tinkoff/version.rb
CHANGED
data/lib/tinkoff.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinkoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Kim
|
@@ -98,9 +98,9 @@ files:
|
|
98
98
|
- bin/setup
|
99
99
|
- lib/tinkoff.rb
|
100
100
|
- lib/tinkoff/client.rb
|
101
|
+
- lib/tinkoff/notification.rb
|
101
102
|
- lib/tinkoff/payment.rb
|
102
103
|
- lib/tinkoff/request.rb
|
103
|
-
- lib/tinkoff/response.rb
|
104
104
|
- lib/tinkoff/version.rb
|
105
105
|
- tinkoff.gemspec
|
106
106
|
homepage: https://github.com/dankimio/tinkoff
|