parsbank 0.0.4 → 0.0.8
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 +150 -64
- data/lib/configuration.rb +3 -1
- data/lib/db_setup.rb +103 -0
- data/lib/locales/en.yml +18 -0
- data/lib/locales/fa.yml +19 -0
- data/lib/parsbank/{bsc-bitcoin/bsc-bitcoin.rb → binance/binance.rb} +2 -1
- data/lib/parsbank/gates.rb +16 -0
- data/lib/parsbank/mellat/logo.svg +1 -0
- data/lib/parsbank/mellat/mellat.rb +2 -6
- data/lib/parsbank/nobitex/logo.svg +6 -0
- data/lib/parsbank/nobitex/nobitex.rb +1 -15
- data/lib/parsbank/restfull.rb +130 -71
- data/lib/parsbank/soap.rb +106 -0
- data/lib/parsbank/transaction_request.rb +134 -0
- data/lib/parsbank/transaction_verify.rb +135 -0
- data/lib/parsbank/version.rb +1 -1
- data/lib/parsbank/zarinpal/logo.svg +1 -1
- data/lib/parsbank/zarinpal/zarinpal.rb +89 -60
- data/lib/parsbank/zibal/zibal.rb +1 -18
- data/lib/parsbank.rb +35 -156
- data/lib/psp.json +84 -0
- data/lib/tmpl/_loader.html.erb +105 -0
- data/lib/tmpl/bank_list.html.erb +215 -0
- metadata +17 -47
- /data/lib/parsbank/{bsc-bitcoin/bsc-bitcoin.svg → binance/logo.svg} +0 -0
@@ -0,0 +1,215 @@
|
|
1
|
+
|
2
|
+
<%
|
3
|
+
# Global Vars
|
4
|
+
@supported_psp=Parsbank.supported_psp
|
5
|
+
%>
|
6
|
+
<style>
|
7
|
+
#parsbank-wrapper, #parsbank-wrapper *:not(svg *) {
|
8
|
+
all: revert;
|
9
|
+
}
|
10
|
+
|
11
|
+
/* Direction handling based on language and body direction */
|
12
|
+
html[lang="fa-IR"] #parsbank-wrapper,
|
13
|
+
body[dir="rtl"] #parsbank-wrapper {
|
14
|
+
direction: rtl;
|
15
|
+
}
|
16
|
+
|
17
|
+
html[lang="en"] #parsbank-wrapper,
|
18
|
+
body[dir="ltr"] #parsbank-wrapper {
|
19
|
+
direction: ltr;
|
20
|
+
}
|
21
|
+
|
22
|
+
/* Flex container settings */
|
23
|
+
#parsbank-wrapper .flex-container {
|
24
|
+
display: flex;
|
25
|
+
justify-content: center;
|
26
|
+
flex-wrap: wrap;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* Label styling */
|
30
|
+
#parsbank-wrapper .flex-container label {
|
31
|
+
margin: 15px;
|
32
|
+
display: block;
|
33
|
+
}
|
34
|
+
|
35
|
+
#parsbank-wrapper .flex-container label span {
|
36
|
+
display: block;
|
37
|
+
text-align: center;
|
38
|
+
margin: auto;
|
39
|
+
}
|
40
|
+
|
41
|
+
/* Styled radio button container */
|
42
|
+
#parsbank-wrapper .styled-radio {
|
43
|
+
position: relative;
|
44
|
+
object-fit: contain;
|
45
|
+
width: 100px;
|
46
|
+
height: 100px;
|
47
|
+
padding: 15px;
|
48
|
+
display: inline-block;
|
49
|
+
border-radius: 50%;
|
50
|
+
text-align: center;
|
51
|
+
}
|
52
|
+
|
53
|
+
#parsbank-wrapper .styled-radio svg {
|
54
|
+
position: absolute;
|
55
|
+
height: 100%;
|
56
|
+
width: 75%;
|
57
|
+
top: 0;
|
58
|
+
margin: auto;
|
59
|
+
display: block;
|
60
|
+
}
|
61
|
+
|
62
|
+
/* Color class styling */
|
63
|
+
#parsbank-wrapper .red { background: tomato; }
|
64
|
+
#parsbank-wrapper .green { background: limegreen; }
|
65
|
+
#parsbank-wrapper .blue { background: cornflowerblue; }
|
66
|
+
|
67
|
+
/* Invisible radio button styling */
|
68
|
+
#parsbank-wrapper .invisible-radio {
|
69
|
+
position: absolute;
|
70
|
+
height: 1px;
|
71
|
+
width: 1px;
|
72
|
+
overflow: hidden;
|
73
|
+
clip: rect(1px 1px 1px 1px); /* Ensure it works across browsers */
|
74
|
+
}
|
75
|
+
|
76
|
+
/* After styling when invisible radio is checked */
|
77
|
+
#parsbank-wrapper .invisible-radio + label .styled-radio::after {
|
78
|
+
content: attr(data-text);
|
79
|
+
font-size: 1.5em;
|
80
|
+
display: inline-block;
|
81
|
+
padding: 20px;
|
82
|
+
width: 150px;
|
83
|
+
text-align: center;
|
84
|
+
position: absolute;
|
85
|
+
bottom: -60px;
|
86
|
+
}
|
87
|
+
|
88
|
+
/* Styling when radio is checked */
|
89
|
+
#parsbank-wrapper .invisible-radio:checked + label .styled-radio {
|
90
|
+
background-color: #FFD700;
|
91
|
+
}
|
92
|
+
|
93
|
+
/* Checkmark display when selected */
|
94
|
+
#parsbank-wrapper .invisible-radio:checked + label span:before {
|
95
|
+
content: '\2713';
|
96
|
+
display: inline-block;
|
97
|
+
color: green;
|
98
|
+
padding-left: 5px;
|
99
|
+
scale: 1.7;
|
100
|
+
}
|
101
|
+
|
102
|
+
/* Hover effect on non-checked radios */
|
103
|
+
#parsbank-wrapper .invisible-radio:not(:checked) + label {
|
104
|
+
cursor: pointer;
|
105
|
+
}
|
106
|
+
|
107
|
+
#parsbank-wrapper .invisible-radio:not(:checked) + label:hover .styled-radio {
|
108
|
+
opacity: 0.7;
|
109
|
+
}
|
110
|
+
|
111
|
+
/* Focus effect on invisible radio */
|
112
|
+
#parsbank-wrapper .invisible-radio:focus + label .styled-radio {
|
113
|
+
transform: scale(1, 1);
|
114
|
+
animation: pulsate 1s alternate ease-in-out infinite;
|
115
|
+
}
|
116
|
+
|
117
|
+
/* Animation for pulsating effect */
|
118
|
+
@keyframes pulsate {
|
119
|
+
from {
|
120
|
+
transform: scale(1);
|
121
|
+
box-shadow: none;
|
122
|
+
}
|
123
|
+
to {
|
124
|
+
transform: scale(1.05);
|
125
|
+
box-shadow: 1px 4px 8px rgba(0, 0, 0, 0.2);
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
#parsbank-wrapper #parsbank-blockquote{
|
130
|
+
display:block !important;
|
131
|
+
width:100%;
|
132
|
+
}
|
133
|
+
|
134
|
+
|
135
|
+
#parsbank-wrapper select{
|
136
|
+
display: none;
|
137
|
+
width: 100%;
|
138
|
+
padding: .375rem 2.25rem .375rem .75rem;
|
139
|
+
-moz-padding-start: calc(0.75rem - 3px);
|
140
|
+
font-size: 1rem;
|
141
|
+
font-weight: 400;
|
142
|
+
line-height: 1.5;
|
143
|
+
color: #212529;
|
144
|
+
background-color: #fff;
|
145
|
+
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
|
146
|
+
background-repeat: no-repeat;
|
147
|
+
background-position: <%= ( I18n.locale.to_s == 'fa') ? 'right' : 'left' %> .75rem center;
|
148
|
+
background-size: 16px 12px;
|
149
|
+
border: 1px solid #ced4da;
|
150
|
+
border-radius: .25rem;
|
151
|
+
transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
152
|
+
-webkit-appearance: none;
|
153
|
+
-moz-appearance: none;
|
154
|
+
appearance: none;
|
155
|
+
transition:1s;
|
156
|
+
|
157
|
+
}
|
158
|
+
#parsbank-radio-nobitex:checked ~ .coin-network,#parsbank-radio-binance:checked ~ .coin-network{
|
159
|
+
display:block !important;
|
160
|
+
opacity: 1;
|
161
|
+
transition:1s;
|
162
|
+
}
|
163
|
+
</style>
|
164
|
+
|
165
|
+
<section id="parsbank-wrapper">
|
166
|
+
<fieldset class="flex-container">
|
167
|
+
<legend><%= args.fetch(:legend_message, 'Choose Your Payment Method...') %></legend>
|
168
|
+
<div class="flex-container">
|
169
|
+
<% Parsbank.available_gateways_list.each_key do |key| %>
|
170
|
+
<div id="<%= key %>-wrapper">
|
171
|
+
<input type="radio" name="parsbank-selectors" id="parsbank-radio-<%= key %>" value='<%= key %>' class="invisible-radio">
|
172
|
+
<label for="parsbank-radio-<%= key %>">
|
173
|
+
<div class="styled-radio blue">
|
174
|
+
<%= Object.const_get("Parsbank::#{key.capitalize}").logo if defined?(Object.const_get("Parsbank::#{key.capitalize}").logo) %>
|
175
|
+
</div>
|
176
|
+
<span><%= I18n.t "bank_names.#{key}" %></span>
|
177
|
+
</label>
|
178
|
+
|
179
|
+
<% if ['nobitex','binance'].include? key %>
|
180
|
+
<select name='coin-network' class='coin-network <%= key %>-coin-selector'>
|
181
|
+
<% Parsbank.supported_psp[key]['support_coins'].each do |coin| %>
|
182
|
+
<option value="<%= coin %>"><%= coin.upcase %></option>
|
183
|
+
<% end %>
|
184
|
+
</select>
|
185
|
+
<% end %>
|
186
|
+
</div>
|
187
|
+
<% end %>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<blockquote id='parsbank-blockquote' cite="https://github.com/Abrfanet/parsbank"></blockquote>
|
191
|
+
|
192
|
+
</fieldset>
|
193
|
+
</section>
|
194
|
+
|
195
|
+
<script type="text/javascript">
|
196
|
+
document.addEventListener("DOMContentLoaded", function() {
|
197
|
+
window.I18n = window.I18n || {};
|
198
|
+
window.I18n['<%= I18n.locale.to_s %>'] = <%= I18n.t('.').to_json.html_safe %>;
|
199
|
+
|
200
|
+
const PSP = <%= @supported_psp.to_json %>;
|
201
|
+
|
202
|
+
function loadConditions(event) {
|
203
|
+
document.getElementById('parsbank-blockquote').textContent = I18n.<%= I18n.locale.to_s %>.bank_list[event.target.value];
|
204
|
+
}
|
205
|
+
|
206
|
+
document.querySelectorAll("input[name='parsbank-selectors']").forEach((input) => {
|
207
|
+
input.addEventListener('change', loadConditions);
|
208
|
+
});
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
});
|
215
|
+
</script>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parsbank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mohammad Mahmoodi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -24,49 +24,7 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
|
28
|
-
name: faraday
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: faraday_middleware
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: savon
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
description: Focus on your ecommerce we handle your payments.
|
27
|
+
description: Focus on your ecommerce we handle your gateways.
|
70
28
|
email:
|
71
29
|
- mm580486@gmail.com
|
72
30
|
executables: []
|
@@ -77,17 +35,29 @@ files:
|
|
77
35
|
- README.md
|
78
36
|
- Rakefile
|
79
37
|
- lib/configuration.rb
|
38
|
+
- lib/db_setup.rb
|
39
|
+
- lib/locales/en.yml
|
40
|
+
- lib/locales/fa.yml
|
80
41
|
- lib/parsbank.rb
|
81
|
-
- lib/parsbank/
|
82
|
-
- lib/parsbank/
|
42
|
+
- lib/parsbank/binance/binance.rb
|
43
|
+
- lib/parsbank/binance/logo.svg
|
44
|
+
- lib/parsbank/gates.rb
|
45
|
+
- lib/parsbank/mellat/logo.svg
|
83
46
|
- lib/parsbank/mellat/mellat.rb
|
47
|
+
- lib/parsbank/nobitex/logo.svg
|
84
48
|
- lib/parsbank/nobitex/nobitex.rb
|
85
49
|
- lib/parsbank/restfull.rb
|
50
|
+
- lib/parsbank/soap.rb
|
51
|
+
- lib/parsbank/transaction_request.rb
|
52
|
+
- lib/parsbank/transaction_verify.rb
|
86
53
|
- lib/parsbank/version.rb
|
87
54
|
- lib/parsbank/zarinpal/logo.svg
|
88
55
|
- lib/parsbank/zarinpal/zarinpal.rb
|
89
56
|
- lib/parsbank/zibal/logo.svg
|
90
57
|
- lib/parsbank/zibal/zibal.rb
|
58
|
+
- lib/psp.json
|
59
|
+
- lib/tmpl/_loader.html.erb
|
60
|
+
- lib/tmpl/bank_list.html.erb
|
91
61
|
- sig/parsbank.rbs
|
92
62
|
homepage: https://github.com/Abrfanet
|
93
63
|
licenses:
|
File without changes
|