firekassa 0.1.3 → 0.1.5

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: 88c9813fd744f9bc156dc9c9a2e8e10103b8e506eba1971372749eacfe715660
4
- data.tar.gz: 90696bb7b0008ed6f341f5100da4a0aaac89d4944bd67627da1dea394e8dc28c
3
+ metadata.gz: a9c4f6a9f6641a5454d34b135a2c20b7a6b8565828978d19e1122382afa407da
4
+ data.tar.gz: 06d66a38d9e38e6428884c635a97a54acc707daaccc928d79181228410ecba2c
5
5
  SHA512:
6
- metadata.gz: 3046b7f1c1e06b5f677cba35157f75ddcdd57f696fb0640923667b7b339146a0ba08427fa5f654490a5f24ad82e07754cc693c6dfaad1d008d99205b9fc84855
7
- data.tar.gz: 485217788a1763ecce7f8b2db8bbd8b49b033b7bdbf70825e3151ed76ce60a8b3f9a09de164a215f3b28af480ac557f135a6202f378772da9f3bd6f223ee1d68
6
+ metadata.gz: b66ca0d6e6a903ec7565738614584a3da88c2d8d12573fb3b864be544c8bd5a579d12feea452f4e8c4565875d19032d623fcb4ad11634a87815a27605827ad27
7
+ data.tar.gz: 77d9cb7e9f6206277b0d778eb8004bf92e54f5f7289ec22f5f37820ce278bc63c5212a844573a6bd3d53c615d9bd4e2b38b822de005bc304b9529cd999b8b138
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- firekassa (0.1.3)
4
+ firekassa (0.1.5)
5
5
  faraday (~> 1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -34,7 +34,6 @@ Now you can make API calls
34
34
  ```ruby
35
35
  Firekassa::Balance.new.get # => { "balance": "2000.0" }
36
36
  ```
37
- See [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getBalance)
38
37
 
39
38
  ### Account
40
39
 
@@ -42,14 +41,13 @@ See [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/ge
42
41
  ```ruby
43
42
  Firekassa::Account.new.list # => items: [ ... ]
44
43
  ```
45
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getSiteAccounts)
44
+ See more info in tests
46
45
 
47
46
  #### To show your concrete account info:
48
47
  ```ruby
49
48
  Firekassa::Balance.new.show(account_id) # => { account_data... }
50
49
  ```
51
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getSiteAccount)
52
-
50
+ See more info in tests
53
51
 
54
52
  ### Transactions
55
53
 
@@ -57,73 +55,62 @@ See more info in tests and [API method reference](https://admin.vanilapay.com/ap
57
55
  ```ruby
58
56
  Firekassa::Transaction.new.list # => {items:[ trxs...] }
59
57
  ```
60
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getTransactions)
58
+ See more info in tests
61
59
 
62
- #### To create deposit:
60
+ #### To create deposit type:card:
63
61
  ```ruby
64
62
  deposit_data = {
65
63
  order_id: "123", # payment ID from your system
66
- method: "h2h-a", # host to host payment
67
64
  amount: "5000.0",
68
65
  # callbacks
69
66
  notification_url: "http://some.url/callback",
70
67
  success_url: "http://some.url/callback",
71
68
  fail_url: "http://some.url/callback",
72
- # card credentials
73
- card_number: "4242424242424242",
74
- card_expire: "01/25",
75
- card_cvv: "123"
76
69
  }
77
- result = Firekassa::Deposit.new.create(deposit_data)
78
- payment_url = result['payment_url'] # Customer should visit this link to proceed the payment
70
+ result = Firekassa::Deposit.new.create_card(deposit_data)
71
+ # it responds card credentials for making payment
79
72
  ```
80
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/createDepositTransaction)
73
+ See more info in tests
81
74
 
82
- #### To create withdrawal:
75
+ #### To create withdrawal type:card:
83
76
  ```ruby
77
+ # for card
84
78
  withdraw_data = {
85
79
  order_id: "123123", # payment ID from your system
86
- method: "card",
87
80
  account: "4242424242424242",
81
+ site_account: 'sber',
88
82
  amount: "100.00",
89
83
  # callbacks
90
84
  notification_url: "http://some.url/callback",
91
- success_url: "http://some.url/callback",
92
- fail_url: "http://some.url/callback"
93
85
  }
94
- Firekassa::Withdraw.new.create(withdraw_data) # => { trx data... }
86
+ Firekassa::Withdraw.new.create_card(withdraw_data) # => { trx data... }
95
87
  ```
96
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/createWithdrawalTransaction)
88
+ See more info in tests
97
89
 
98
90
  #### To show transaction data:
99
91
  ```ruby
100
92
  Firekassa::Transaction.new.show(deposit_id) # => { trx data... }
101
93
  ```
102
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getTransaction)
94
+ See more info in tests
103
95
 
104
96
  #### Cancel transaction:
105
97
  ```ruby
106
98
  Firekassa::Transaction.new.cancel(id) # => { trx data... }
107
99
  ```
108
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/cancelTransaction)
100
+ See more info in tests
109
101
 
110
- #### To get currency rate for withdrawal:
111
- ```ruby
112
- Firekassa::Withdraw.new.currency_rate(data) # => { rate data... }
113
- ```
114
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getWithdrawalRate)
115
102
 
116
103
  #### To download transaction receipt:
117
104
  ```ruby
118
105
  Firekassa::Transaction.new.download_receipt(id)
119
106
  ```
120
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/downloadTransactionReceipt)
107
+ See more info in tests
121
108
 
122
109
  To send transaction receipt to email:
123
110
  ```ruby
124
111
  Firekassa::Transaction.new.send_to_email(id)
125
112
  ```
126
- See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/sendTransactionReceipt)
113
+ See more info in tests
127
114
 
128
115
  ## Development
129
116
 
Binary file
@@ -6,9 +6,29 @@ require "firekassa/client"
6
6
  module Firekassa
7
7
  # Deposit API
8
8
  class Deposit < Client
9
- def create(data)
10
- path = "/api/v2/deposit"
9
+ def create(type, data)
10
+ path = "/api/v2/deposit/#{type}"
11
11
  send_request(method: :post, path: path, body: data)
12
12
  end
13
+
14
+ def create_card(data)
15
+ create(:card, data)
16
+ end
17
+
18
+ def create_sbp(data)
19
+ create(:sbp, data)
20
+ end
21
+
22
+ def create_sbpa(data)
23
+ create("sbp-a", data)
24
+ end
25
+
26
+ def create_usdt_trc20(data)
27
+ create("usdt-trc20", data)
28
+ end
29
+
30
+ def create_usdt_erc20(data)
31
+ create("usdt-erc20", data)
32
+ end
13
33
  end
14
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Firekassa
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
@@ -6,13 +6,43 @@ require "firekassa/client"
6
6
  module Firekassa
7
7
  # Withdraw API
8
8
  class Withdraw < Client
9
- def create(data)
10
- path = "/api/v2/withdrawal"
11
- send_request(method: :post, path: path, body: data)
9
+ def create_card(data)
10
+ create(:card, data)
11
+ end
12
+
13
+ def create_sbp(data)
14
+ create(:sbp, data)
15
+ end
16
+
17
+ def create_phone(data)
18
+ create(:phone, data)
19
+ end
20
+
21
+ def create_qiwi_wallet(data)
22
+ create("qiwi-wallet", data)
23
+ end
24
+
25
+ def create_yoomoney(data)
26
+ create(:yoomoney, data)
27
+ end
28
+
29
+ def create_usdt_trc20(data)
30
+ create("usdt-trc20", data)
31
+ end
32
+
33
+ def create_usdt_erc20(data)
34
+ create("usdt-erc20", data)
35
+ end
36
+
37
+ def sbp_banks
38
+ paht = "/api/v2/sbp-banks"
39
+ send_request(method: :get, path: paht)
12
40
  end
13
41
 
14
- def currency_rate(data)
15
- path = "/api/v2/withdrawal/rate"
42
+ private
43
+
44
+ def create(type, data)
45
+ path = "/api/v2/withdrawal/#{type}"
16
46
  send_request(method: :post, path: path, body: data)
17
47
  end
18
48
  end
data/lib/firekassa.rb CHANGED
@@ -7,7 +7,6 @@ require "firekassa/balance"
7
7
  require "firekassa/transaction"
8
8
  require "firekassa/deposit"
9
9
  require "firekassa/withdraw"
10
- require "firekassa/invoice"
11
10
 
12
11
  # Head module
13
12
  module Firekassa
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firekassa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Kuznetsov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date:
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -82,6 +82,7 @@ files:
82
82
  - LICENSE.txt
83
83
  - README.md
84
84
  - Rakefile
85
+ - firekassa-0.1.4.gem
85
86
  - firekassa.gemspec
86
87
  - lib/firekassa.rb
87
88
  - lib/firekassa/account.rb
@@ -90,7 +91,6 @@ files:
90
91
  - lib/firekassa/config.rb
91
92
  - lib/firekassa/deposit.rb
92
93
  - lib/firekassa/errors.rb
93
- - lib/firekassa/invoice.rb
94
94
  - lib/firekassa/transaction.rb
95
95
  - lib/firekassa/version.rb
96
96
  - lib/firekassa/withdraw.rb
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "firekassa/config"
4
- require "firekassa/client"
5
-
6
- module Firekassa
7
- # Invoice API
8
- class Invoice < Client
9
- def create(data)
10
- path = "/api/v2/invoices"
11
- send_request(method: :post, path: path, body: data)
12
- end
13
- end
14
- end