yandex_widget 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +31 -5
- data/lib/yandex_widget/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b4970ea2e1fa46871f37e43f225ae7c233ba7a3af1ec06c264639ce0f4401ac
|
4
|
+
data.tar.gz: a0983710500109f3f8e4f149640991ac07233432ab8733b012349b5fb065e1fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eb114520ce194a00fce13e25884fb4ad5be3ca62a2d354cf00fe76ca40bfa5bfaf8db882ff8360ce824de11d533d935f066be75572be64120ebf59547684b80
|
7
|
+
data.tar.gz: 21313371d67fac90ace9530cf928333e33337c2ec071e93eb7d88cfbcc43fece03886187860fea8e6c1f989afbc1bb3f6578da5621addf8274c75353aa700a4b
|
data/README.md
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
# Yandex Widget
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
3
|
+
This is a Ruby wrapper for Yandex Kassa Widget API. This is very simple solution to initialize payments, make auto payments and check payment status.
|
7
4
|
## Installation
|
8
5
|
|
9
6
|
Add this line to your application's Gemfile:
|
@@ -22,7 +19,36 @@ Or install it yourself as:
|
|
22
19
|
|
23
20
|
## Usage
|
24
21
|
|
25
|
-
|
22
|
+
Configure the gem with the credentials provided by Yandex Kassa in an initializer.
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
YandexWidget.configure do |config|
|
26
|
+
config.store_id = 'store_id'
|
27
|
+
config.secret_key = 'secret_key"
|
28
|
+
end
|
29
|
+
```
|
30
|
+
|
31
|
+
#### Create payment
|
32
|
+
To initialize widget you need to generate `confirmation_token` from Yandex Kassa
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
YandexWidget::Client.init(100, 'Idempotence Key', params)
|
36
|
+
```
|
37
|
+
It will return [payment object](https://checkout.yandex.com/developers/payment-forms/widget#widget-initialization), use it to initialize widget.
|
38
|
+
|
39
|
+
More about available options you can read in the [official documentation](https://checkout.yandex.com/developers/payment-forms/widget#widget-initialization)
|
40
|
+
|
41
|
+
#### Check payment status
|
42
|
+
```ruby
|
43
|
+
YandexWidget::Client.payment_info('Payment Id')
|
44
|
+
```
|
45
|
+
It will return [payment object](https://checkout.yandex.com/developers/api#payment_object)
|
46
|
+
|
47
|
+
#### Cancel payment
|
48
|
+
It's only available for payments with status `waiting_for_capture`
|
49
|
+
```ruby
|
50
|
+
YandexWidget::Client.cancel('Payment Id', 'Idempotence Key')
|
51
|
+
```
|
26
52
|
|
27
53
|
## Development
|
28
54
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yandex_widget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikhail Matyukhin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,7 +93,7 @@ homepage: https://gitlab.com/dcrt/yandex_widget
|
|
93
93
|
licenses:
|
94
94
|
- MIT
|
95
95
|
metadata: {}
|
96
|
-
post_install_message:
|
96
|
+
post_install_message:
|
97
97
|
rdoc_options: []
|
98
98
|
require_paths:
|
99
99
|
- lib
|
@@ -108,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.0.
|
112
|
-
signing_key:
|
111
|
+
rubygems_version: 3.0.8
|
112
|
+
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Integration for Yandex Kassa Widget
|
115
115
|
test_files: []
|