firekassa 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +68 -9
- data/lib/firekassa/deposit.rb +1 -6
- data/lib/firekassa/transaction.rb +37 -0
- data/lib/firekassa/version.rb +1 -1
- data/lib/firekassa/withdraw.rb +19 -0
- data/lib/firekassa.rb +3 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdceae90e4b6b0bb78ec79ecb406849054e3a2b1adf86c0837716f4be9ae7a41
|
4
|
+
data.tar.gz: d660a83b5a51ee7d994507c3390ddad6f4e6527856e63edd77daf7cd23672026
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94c4e146df6e8de0c896ab150926f1ffe13fff69a9569885a54e2b7fcdd2e5b9acb0bcab1f8be5c830502b8c4d84b58b91eb14f25716186488dbf64abdf9482c
|
7
|
+
data.tar.gz: 0513dfb4f9ecfbe9c9883edc1c683c937c14efd68549fe3c6a03ad88dbac94aaf4dcd94a32b6e1b486f40b941f57fd7175e467ae8b237579b0df40cc0be91da2
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -30,8 +30,7 @@ Now you can make API calls
|
|
30
30
|
|
31
31
|
### Balance
|
32
32
|
|
33
|
-
To get yoour account balance:
|
34
|
-
|
33
|
+
#### To get yoour account balance:
|
35
34
|
```ruby
|
36
35
|
Firekassa::Balance.new.get # => { "balance": "2000.0" }
|
37
36
|
```
|
@@ -39,33 +38,93 @@ See [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/ge
|
|
39
38
|
|
40
39
|
### Account
|
41
40
|
|
42
|
-
To list your Site accounts:
|
41
|
+
#### To list your Site accounts:
|
43
42
|
```ruby
|
44
43
|
Firekassa::Account.new.list # => items: [ ... ]
|
45
44
|
```
|
46
45
|
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getSiteAccounts)
|
47
46
|
|
48
|
-
To show your concrete account info:
|
47
|
+
#### To show your concrete account info:
|
49
48
|
```ruby
|
50
49
|
Firekassa::Balance.new.show(account_id) # => { account_data... }
|
51
50
|
```
|
52
51
|
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getSiteAccount)
|
53
52
|
|
54
53
|
|
55
|
-
###
|
54
|
+
### Transactions
|
56
55
|
|
57
|
-
To
|
56
|
+
#### To list transactions:
|
58
57
|
```ruby
|
59
|
-
Firekassa::
|
58
|
+
Firekassa::Transaction.new.list # => {items:[ trxs...] }
|
59
|
+
```
|
60
|
+
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getTransactions)
|
61
|
+
|
62
|
+
#### To create deposit:
|
63
|
+
```ruby
|
64
|
+
deposit_data = {
|
65
|
+
order_id: "123", # payment ID from your system
|
66
|
+
method: "h2h-a", # host to host payment
|
67
|
+
amount: "5000.0",
|
68
|
+
# callbacks
|
69
|
+
notification_url: "http://some.url/callback",
|
70
|
+
success_url: "http://some.url/callback",
|
71
|
+
fail_url: "http://some.url/callback",
|
72
|
+
# card credentials
|
73
|
+
card_number: "4242424242424242",
|
74
|
+
card_expire: "01/25",
|
75
|
+
card_cvv: "123"
|
76
|
+
}
|
77
|
+
result = Firekassa::Deposit.new.create(deposit_data)
|
78
|
+
payment_url = result['payment_url'] # Customer should visit this link to proceed the payment
|
60
79
|
```
|
61
80
|
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/createDepositTransaction)
|
62
81
|
|
63
|
-
To
|
82
|
+
#### To create withdrawal:
|
83
|
+
```ruby
|
84
|
+
withdraw_data = {
|
85
|
+
order_id: "123123", # payment ID from your system
|
86
|
+
method: "card",
|
87
|
+
account: "4242424242424242",
|
88
|
+
amount: "100.00",
|
89
|
+
# callbacks
|
90
|
+
notification_url: "http://some.url/callback",
|
91
|
+
success_url: "http://some.url/callback",
|
92
|
+
fail_url: "http://some.url/callback"
|
93
|
+
}
|
94
|
+
Firekassa::Withdraw.new.create(withdraw_data) # => { trx data... }
|
95
|
+
```
|
96
|
+
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/createWithdrawalTransaction)
|
97
|
+
|
98
|
+
#### To show transaction data:
|
64
99
|
```ruby
|
65
|
-
Firekassa::
|
100
|
+
Firekassa::Transaction.new.show(deposit_id) # => { trx data... }
|
66
101
|
```
|
67
102
|
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/getTransaction)
|
68
103
|
|
104
|
+
#### Cancel transaction:
|
105
|
+
```ruby
|
106
|
+
Firekassa::Transaction.new.cancel(id) # => { trx data... }
|
107
|
+
```
|
108
|
+
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/cancelTransaction)
|
109
|
+
|
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
|
+
|
116
|
+
#### To download transaction receipt:
|
117
|
+
```ruby
|
118
|
+
Firekassa::Transaction.new.download_receipt(id)
|
119
|
+
```
|
120
|
+
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/downloadTransactionReceipt)
|
121
|
+
|
122
|
+
To send transaction receipt to email:
|
123
|
+
```ruby
|
124
|
+
Firekassa::Transaction.new.send_to_email(id)
|
125
|
+
```
|
126
|
+
See more info in tests and [API method reference](https://admin.vanilapay.com/api/doc/v2#/operations/sendTransactionReceipt)
|
127
|
+
|
69
128
|
## Development
|
70
129
|
|
71
130
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/firekassa/deposit.rb
CHANGED
@@ -4,16 +4,11 @@ require "firekassa/config"
|
|
4
4
|
require "firekassa/client"
|
5
5
|
|
6
6
|
module Firekassa
|
7
|
-
#
|
7
|
+
# Deposit API
|
8
8
|
class Deposit < Client
|
9
9
|
def create(data)
|
10
10
|
path = "/api/v2/deposit"
|
11
11
|
send_request(method: :post, path: path, body: data)
|
12
12
|
end
|
13
|
-
|
14
|
-
def show(id)
|
15
|
-
path = "/api/v2/transactions/#{id}"
|
16
|
-
send_request(method: :get, path: path)
|
17
|
-
end
|
18
13
|
end
|
19
14
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "firekassa/config"
|
4
|
+
require "firekassa/client"
|
5
|
+
|
6
|
+
module Firekassa
|
7
|
+
# Transactions API
|
8
|
+
class Transaction < Client
|
9
|
+
def show(id)
|
10
|
+
path = "/api/v2/transactions/#{id}"
|
11
|
+
send_request(method: :get, path: path)
|
12
|
+
end
|
13
|
+
|
14
|
+
def cancel(id)
|
15
|
+
path = "/api/v2/transactions/#{id}/cancel"
|
16
|
+
send_request(method: :post, path: path)
|
17
|
+
end
|
18
|
+
|
19
|
+
def list
|
20
|
+
# TODO: add proper URI encode
|
21
|
+
# filter: nil, page: nil, sort: nil
|
22
|
+
path = "/api/v2/transactions"
|
23
|
+
send_request(method: :get, path: path)
|
24
|
+
end
|
25
|
+
|
26
|
+
def download_receipt(id)
|
27
|
+
path = "/api/v2/transactions/#{id}/receipt"
|
28
|
+
send_request(method: :get, path: path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def send_to_email(id:, email:, format:)
|
32
|
+
data = { email: email, format: format }
|
33
|
+
path = "/api/v2/transactions/#{id}/send-receipt"
|
34
|
+
send_request(method: :post, path: path, body: data)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/firekassa/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "firekassa/config"
|
4
|
+
require "firekassa/client"
|
5
|
+
|
6
|
+
module Firekassa
|
7
|
+
# Withdraw API
|
8
|
+
class Withdraw < Client
|
9
|
+
def create(data)
|
10
|
+
path = "/api/v2/withdrawal"
|
11
|
+
send_request(method: :post, path: path, body: data)
|
12
|
+
end
|
13
|
+
|
14
|
+
def currency_rate(data)
|
15
|
+
path = "/api/v2/withdrawal/rate"
|
16
|
+
send_request(method: :post, path: path, body: data)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/firekassa.rb
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|
require "firekassa/config"
|
4
4
|
require "firekassa/version"
|
5
|
+
require "firekassa/account"
|
5
6
|
require "firekassa/balance"
|
7
|
+
require "firekassa/transaction"
|
6
8
|
require "firekassa/deposit"
|
7
|
-
require "firekassa/
|
9
|
+
require "firekassa/withdraw"
|
8
10
|
|
9
11
|
# Head module
|
10
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.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Kuznetsov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -90,7 +90,9 @@ files:
|
|
90
90
|
- lib/firekassa/config.rb
|
91
91
|
- lib/firekassa/deposit.rb
|
92
92
|
- lib/firekassa/errors.rb
|
93
|
+
- lib/firekassa/transaction.rb
|
93
94
|
- lib/firekassa/version.rb
|
95
|
+
- lib/firekassa/withdraw.rb
|
94
96
|
- sig/firekassa.rbs
|
95
97
|
homepage: https://fp-dev4.fkcore.com/api/doc/v2
|
96
98
|
licenses:
|