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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb5bddfd929a93a3eff8e932ffad75cf88e8879755f431fafb166b392d11d778
4
- data.tar.gz: 17df248b50029ea397be5563bd5d7359c33c797fe9a85650b8e6ef894e62de96
3
+ metadata.gz: 7b4970ea2e1fa46871f37e43f225ae7c233ba7a3af1ec06c264639ce0f4401ac
4
+ data.tar.gz: a0983710500109f3f8e4f149640991ac07233432ab8733b012349b5fb065e1fd
5
5
  SHA512:
6
- metadata.gz: 3c0bbd77992cf5253cde0b3a76537f608b3be23008c11f3969169378c71a4e0382cc59df0215b7e7978e7bc818426d1f5d457172d9fa66555c7251737fd9cb88
7
- data.tar.gz: 97b0445371f2a0270c125e94cd9a83213742cdcdc9868a7ee9f321709839ffef0b982ce1970b1a720fb0ede4ac9a0bf3e9dd48932e94cd7df3dff8c2bc719dc4
6
+ metadata.gz: 6eb114520ce194a00fce13e25884fb4ad5be3ca62a2d354cf00fe76ca40bfa5bfaf8db882ff8360ce824de11d533d935f066be75572be64120ebf59547684b80
7
+ data.tar.gz: 21313371d67fac90ace9530cf928333e33337c2ec071e93eb7d88cfbcc43fece03886187860fea8e6c1f989afbc1bb3f6578da5621addf8274c75353aa700a4b
data/README.md CHANGED
@@ -1,9 +1,6 @@
1
1
  # Yandex Widget
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/yandex/widget`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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
 
@@ -1,3 +1,3 @@
1
1
  module YandexWidget
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
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.0
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-05-13 00:00:00.000000000 Z
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.3
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: []