parsbank 0.0.8 → 0.0.9

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: 9c6774ac55b53a31e7df4982c3b01e9693edd7a481f748c38bc061941c267870
4
- data.tar.gz: ef51aa116673b80e5affff7cdb939d50ca39763210b981b43667b7db9da287ad
3
+ metadata.gz: 1e06108ffa9e0ff32ba436f8d1122529e61780965176c94a0553a84b8d73123c
4
+ data.tar.gz: 16ea88dbd6ddcf8daed720b568d184857348f72866fd606542f1bb9747d177ec
5
5
  SHA512:
6
- metadata.gz: ee11744864df67b0d88495722594309df70d57bc79464c346011ac75f8209c14fd4c84b1346b27bd27a17daf3392932696d759c18ca8f6e110fe32d4056251f7
7
- data.tar.gz: f3a0a594e3e6d032a67c5cfe4b2f22f20f527c66a448b7ff5c002b07a76eda6106d958e1b39b9ee278b623a8edafa248807cfa0fb5eb07291fe6455e3143e82b
6
+ metadata.gz: 02dd5ddb88e6594a41518e3d85a8edac46d6baac8622bd293381425eb16880baba198aaf2240905bfaf0b5f2279b1c89c0cb061a1ece102ca357d6355eac824b
7
+ data.tar.gz: 10342d63171df90e125cc543c8dffee84a0958d31b0a9be19a27169f3bec10512b75550caf6802dc7ae538ae0ddf4f981b3a3f1cc739e88afc5b7adcb72b180f
data/README.md CHANGED
@@ -80,7 +80,7 @@ class CartController < ApplicationController
80
80
  # @INPUT crypto_amount: can be crypto assets amount like 0.0005
81
81
  # @INPUT real_amount: When use crypto or Rials can use dollar instead amount of crypto (E.G 100 dollar equal 0.005 bitcoin)
82
82
  # @INPUT description(required): Explain transaction details
83
- # @INPUT bank: Select specific bank or payment method like 'bsc-binance', 'nobitex', 'zarinpal', 'perfect-money'
83
+ # @INPUT bank: Select specific bank or payment method like 'bsc-binance', 'perfect-money'
84
84
  # @INPUT tags: Used for call which payments method such as ['crypto','rls','dollar','persian-banks','russian-banks']
85
85
  # @OUTPUT get_redirect_from: an javascript code for redirect user to gateways
86
86
  def redirect_to_parsbank
@@ -155,17 +155,7 @@ We currently do not accept pull requests. Please report any issues in the [GitHu
155
155
 
156
156
  ## 💖 Support This Project
157
157
 
158
- If you find this project helpful and would like to support its development, consider making a donation. Your contributions help maintain and improve this project. Thank you for your generosity! 🙏
159
-
160
- ### Donate USDT (Tether)
161
- - **USDT (ERC-20):** `0x2028f409a42413076665231e209896bbe0221d64`
162
- - **USDT (TRC-20):** `TNtLkdy2FAKKBGJ4F8ij2mppWpjkB8GULy`
163
- - **USDT (BEP-20):** `0x2028f409a42413076665231e209896bbe0221d64`
164
-
165
-
166
- ### Donate BTC (Bitcoin)
167
- - **BSC (BEP-20):** `0x2028f409a42413076665231e209896bbe0221d64`
168
-
158
+ If you find this project helpful and would like to support its development, consider making a donation. Your contributions help maintain and improve this project.
169
159
 
170
160
 
171
161
  ## 🚀 Premium Features
@@ -174,15 +164,8 @@ This project offers **premium features** to enhance your experience and support
174
164
 
175
165
  #### 🔐 How to Access Premium Features
176
166
  1. **Make a Contribution**:
177
- - Pay 29 USDT to one of the wallet addresses below(Annualy).
178
- 2. **Send Proof of Payment**:
179
- - Email your transaction details to `info@abrfa.net` or submit them via a dedicated contact form.
180
- 3. **Receive Access**:
181
- - Upon verification, you'll receive instructions to access the premium features.
182
-
183
- #### 💳 USDT Wallet Addresses
184
- - **USDT (ERC-20):** `0x2028f409a42413076665231e209896bbe0221d64`
185
- - **USDT (TRC-20):** `TNtLkdy2FAKKBGJ4F8ij2mppWpjkB8GULy`
167
+ - Follow and take features request to one of the github below(Annualy).
168
+
186
169
 
187
170
  #### 🔥 Available Premium Features
188
171
  - Feature 1: **Advanced Analytics**
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsbank
4
- VERSION = '0.0.8'
4
+ VERSION = '0.0.9'
5
5
  end
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.8
4
+ version: 0.0.9
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-10-14 00:00:00.000000000 Z
11
+ date: 2026-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -44,20 +44,12 @@ files:
44
44
  - lib/parsbank/gates.rb
45
45
  - lib/parsbank/mellat/logo.svg
46
46
  - lib/parsbank/mellat/mellat.rb
47
- - lib/parsbank/nobitex/logo.svg
48
- - lib/parsbank/nobitex/nobitex.rb
49
47
  - lib/parsbank/restfull.rb
50
48
  - lib/parsbank/soap.rb
51
49
  - lib/parsbank/transaction_request.rb
52
50
  - lib/parsbank/transaction_verify.rb
53
51
  - lib/parsbank/version.rb
54
- - lib/parsbank/zarinpal/logo.svg
55
- - lib/parsbank/zarinpal/zarinpal.rb
56
- - lib/parsbank/zibal/logo.svg
57
- - lib/parsbank/zibal/zibal.rb
58
- - lib/psp.json
59
52
  - lib/tmpl/_loader.html.erb
60
- - lib/tmpl/bank_list.html.erb
61
53
  - sig/parsbank.rbs
62
54
  homepage: https://github.com/Abrfanet
63
55
  licenses:
@@ -1,6 +0,0 @@
1
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 800 800" preserveAspectRatio="xMidYMid meet">
2
- <path d="M0 0 C29.98287632 28.38266662 37.63391251 71.06493204 39.46484375 110.52734375 C40.31202771 154.92975 29.86598145 204.25929523 0.28125 238.5703125 C-0.30011719 239.26511719 -0.88148438 239.95992188 -1.48046875 240.67578125 C-9.81789052 249.85324551 -21.67611901 256.11718396 -33.71875 258.5703125 C-35.03875 258.5703125 -36.35875 258.5703125 -37.71875 258.5703125 C-37.32360063 257.11179369 -36.92754943 255.65351924 -36.53125 254.1953125 C-36.25925781 253.18597656 -35.98726563 252.17664063 -35.70703125 251.13671875 C-35.00172375 248.59147865 -34.27221785 246.06359208 -33.51171875 243.53515625 C-23.79117233 210.80512141 -22.35178836 174.91061391 -38.40625 143.8828125 C-46.85746156 128.35134581 -58.78064957 117.22443485 -75.71875 111.5703125 C-93.02217424 107.22355858 -110.87400028 112.8207742 -125.85644531 121.44189453 C-148.77305826 135.32765555 -164.80350975 157.6091968 -177.71875 180.5703125 C-178.05712891 181.16344238 -178.39550781 181.75657227 -178.74414062 182.36767578 C-208.06853461 234.04981757 -219.01027215 296.84557372 -220.71875 355.5703125 C-220.74211426 356.36743652 -220.76547852 357.16456055 -220.78955078 357.98583984 C-222.17370204 414.61972605 -212.37270254 471.92939392 -194.71875 525.5703125 C-194.38040131 526.60372772 -194.38040131 526.60372772 -194.03521729 527.65802002 C-175.92320978 582.95320119 -152.73773661 639.09294597 -115.71875 684.5703125 C-115.25017578 685.15312988 -114.78160156 685.73594727 -114.29882812 686.33642578 C-104.32531403 698.69721719 -93.71672552 709.72390578 -80.51953125 718.64453125 C-77.71875 720.5703125 -77.71875 720.5703125 -75.71875 722.5703125 C-132.76999776 716.17058293 -194.41700644 672.01409971 -235.1328125 633.97265625 C-237.24700441 632.00856558 -239.3916045 630.12080901 -241.59375 628.2578125 C-250.61673064 620.42654629 -259.02312328 611.69845848 -266.71875 602.5703125 C-267.56179688 601.61640625 -268.40484375 600.6625 -269.2734375 599.6796875 C-288.16365104 578.23119016 -303.83955573 554.50456846 -317.71875 529.5703125 C-318.13189453 528.83586914 -318.54503906 528.10142578 -318.97070312 527.34472656 C-341.50730026 487.03957621 -355.04945886 442.29421732 -360.71875 396.5703125 C-360.83589355 395.6534668 -360.95303711 394.73662109 -361.07373047 393.79199219 C-372.82086175 297.33634963 -344.70039279 196.68993972 -282.42016602 112.484375 C-277.06886577 105.6567691 -271.50184788 99.03548215 -265.71875 92.5703125 C-265.18701172 91.97541016 -264.65527344 91.38050781 -264.10742188 90.76757812 C-252.5193361 77.89344741 -240.1407826 65.59127078 -226.5546875 54.8203125 C-224.40784883 53.11703554 -222.29599235 51.39141688 -220.1953125 49.6328125 C-166.88571954 5.19457656 -63.78005057 -56.99883829 0 0 Z " fill="#5525AC" transform="translate(362.71875,24.4296875)"/>
3
- <path d="M0 0 C7.18875557 0.57510045 13.62151637 2.57857541 20.4375 4.875 C21.62327637 5.27428711 22.80905273 5.67357422 24.03076172 6.08496094 C73.95241984 23.2846928 120.85879426 52.57798095 159.41015625 88.59375 C161.54656893 90.57871261 163.71442515 92.48931489 165.9375 94.375 C174.59481506 101.89128818 182.60314944 110.25255676 190 119 C190.84433594 119.95519531 191.68867187 120.91039063 192.55859375 121.89453125 C251.68342563 189.04481233 283.32387647 273.08376214 287 362 C287.03609375 362.87237305 287.0721875 363.74474609 287.109375 364.64355469 C287.28714781 369.77452252 287.21220512 374.87107802 287 380 C286.95359375 381.12245117 286.9071875 382.24490234 286.859375 383.40136719 C282.79672481 473.44908522 251.57593219 562.86358552 189.40625 629.41015625 C187.42128739 631.54656893 185.51068511 633.71442515 183.625 635.9375 C176.77654255 643.8256028 169.2153172 651.34471075 161.2421875 658.09375 C159.43131772 659.6333048 157.65363477 661.19644289 155.8828125 662.78125 C134.581492 681.7337669 110.90091013 698.1330921 86 712 C85.22817383 712.43376953 84.45634766 712.86753906 83.66113281 713.31445312 C61.34722186 725.75582345 37.86881454 735.1103659 13 741 C12.20899902 741.19062012 11.41799805 741.38124023 10.60302734 741.57763672 C-14.0261503 747.26964098 -41.07360529 746.30855798 -63 733 C-66.57427523 730.56205505 -69.80402787 727.91337009 -73 725 C-73.90492188 724.17628906 -74.80984375 723.35257813 -75.7421875 722.50390625 C-82.55872097 715.99893179 -88.0628066 709.01203152 -93 701 C-93.67804688 699.90558594 -94.35609375 698.81117188 -95.0546875 697.68359375 C-104.75569094 681.17523885 -109.91402413 661.78072782 -113 643 C-113.11569336 642.33564941 -113.23138672 641.67129883 -113.35058594 640.98681641 C-121.45061902 592.56688574 -112.46220715 533.3285866 -84.13671875 492.765625 C-74.51652786 479.73187252 -61.32260349 467.47700429 -45 464 C-41.4375 463.8125 -41.4375 463.8125 -39 464 C-40.08890231 469.1686966 -41.31437389 474.25681123 -42.80175781 479.32519531 C-52.42064617 512.23036332 -53.96518454 548.4066818 -37.16796875 579.3046875 C-28.48013523 594.48968087 -17.06767432 605.0774079 -0.48828125 610.87890625 C16.32978144 615.19664945 34.44137027 609.61550255 49.05078125 601.25390625 C67.31501746 589.61801537 81.32921441 574.09291807 93 556 C93.35626465 555.44828125 93.7125293 554.8965625 94.07958984 554.328125 C121.05400703 512.11782122 134.75622658 462.3237218 141 413 C141.15098145 411.82985352 141.30196289 410.65970703 141.45751953 409.45410156 C148.55970967 351.94704745 143.79218867 293.14526422 130 237 C129.71817871 235.84419434 129.43635742 234.68838867 129.14599609 233.49755859 C118.97527788 192.32608691 104.43363569 152.17875535 86 114 C85.52626953 113.00484375 85.05253906 112.0096875 84.56445312 110.984375 C68.69174346 77.71482716 49.24981002 46.92018206 24 20 C23.43023438 19.36449219 22.86046875 18.72898437 22.2734375 18.07421875 C17.26272884 12.69091893 11.18776096 8.61467551 5.23046875 4.35546875 C2 2 2 2 0 0 Z " fill="#5525AC" transform="translate(502,0)"/>
4
- <path d="M0 0 C0.33 0 0.66 0 1 0 C1.87119265 74.19015402 1.87119265 74.19015402 -3 111 C-3.1654834 112.28261719 -3.3309668 113.56523437 -3.50146484 114.88671875 C-4.48344598 122.29411977 -5.65932659 129.64958034 -7 137 C-7.18143555 138.01545898 -7.36287109 139.03091797 -7.54980469 140.07714844 C-16.31455331 188.48692184 -32.03888974 238.6613107 -61 279 C-61.65484375 279.92683594 -62.3096875 280.85367187 -62.984375 281.80859375 C-70.64011623 292.50586008 -78.94581154 302.46989378 -88 312 C-88.50692383 312.53560547 -89.01384766 313.07121094 -89.53613281 313.62304688 C-118.86142713 344.3935678 -157.25360081 364.97682876 -198.77734375 373.52246094 C-201.18823431 374.04044226 -203.57480802 374.63547714 -205.96875 375.2265625 C-217.96904242 377.96043929 -217.96904242 377.96043929 -222.8828125 375.63671875 C-225.3661936 373.27015175 -227.12520496 370.87186263 -229 368 C-229.74121094 367.01773437 -230.48242188 366.03546875 -231.24609375 365.0234375 C-246.04406945 344.91016868 -253.9728436 321.5085935 -258 297 C-258.11569336 296.33564941 -258.23138672 295.67129883 -258.35058594 294.98681641 C-266.45061902 246.56688574 -257.46220715 187.3285866 -229.13671875 146.765625 C-219.51652786 133.73187252 -206.32260349 121.47700429 -190 118 C-186.4375 117.8125 -186.4375 117.8125 -184 118 C-185.08890231 123.1686966 -186.31437389 128.25681123 -187.80175781 133.32519531 C-197.42064617 166.23036332 -198.96518454 202.4066818 -182.16796875 233.3046875 C-173.48013523 248.48968087 -162.06767432 259.0774079 -145.48828125 264.87890625 C-128.67021856 269.19664945 -110.55862973 263.61550255 -95.94921875 255.25390625 C-77.68498254 243.61801537 -63.67078559 228.09291807 -52 210 C-51.64373535 209.44828125 -51.2874707 208.8965625 -50.92041016 208.328125 C-11.40994208 146.50106684 -1.2235268 71.91768876 0 0 Z " fill="#865CE0" transform="translate(647,346)"/>
5
- <path d="M0 0 C0.69867188 0.74121094 1.39734375 1.48242188 2.1171875 2.24609375 C24.55303974 30.21612287 32.82621846 65.71319248 34 101 C34.061875 102.70542969 34.061875 102.70542969 34.125 104.4453125 C34.92417015 149.09894475 24.79238456 198.44815615 -5 233 C-5.58136719 233.69480469 -6.16273438 234.38960937 -6.76171875 235.10546875 C-15.09914052 244.28293301 -26.95736901 250.54687146 -39 253 C-40.32 253 -41.64 253 -43 253 C-42.60485063 251.54148119 -42.20879943 250.08320674 -41.8125 248.625 C-41.54050781 247.61566406 -41.26851562 246.60632813 -40.98828125 245.56640625 C-40.28297375 243.02116615 -39.55346785 240.49327958 -38.79296875 237.96484375 C-29.07242233 205.23480891 -27.63303836 169.34030141 -43.6875 138.3125 C-52.13871156 122.78103331 -64.06189957 111.65412235 -81 106 C-98.30342424 101.65324608 -116.15525028 107.2504617 -131.13769531 115.87158203 C-154.05430826 129.75734305 -170.08475975 152.0388843 -183 175 C-183.33837891 175.59312988 -183.67675781 176.18625977 -184.02539062 176.79736328 C-213.50129206 228.74652609 -223.73179045 291.0862414 -226 350 C-226.33 350 -226.66 350 -227 350 C-228.16698179 278.4969313 -218.71418955 204.29501105 -188 139 C-187.55430664 138.04963867 -187.10861328 137.09927734 -186.64941406 136.12011719 C-176.81458028 115.36369036 -165.31684662 95.97836767 -151 78 C-150.58137695 77.46568359 -150.16275391 76.93136719 -149.73144531 76.38085938 C-137.24849055 60.54055764 -122.49335107 45.6431536 -106 34 C-105.34950684 33.53223145 -104.69901367 33.06446289 -104.02880859 32.58251953 C-86.21854607 19.86568264 -66.88989248 9.60585727 -46 3 C-44.89760986 2.65098633 -44.89760986 2.65098633 -43.77294922 2.29492188 C-38.55691991 0.68008061 -33.30252827 -0.70133447 -28 -2 C-26.65494385 -2.34417969 -26.65494385 -2.34417969 -25.28271484 -2.6953125 C-22.46748377 -3.40166722 -19.64435479 -4.05140891 -16.8125 -4.6875 C-15.93932129 -4.90946045 -15.06614258 -5.1314209 -14.16650391 -5.36010742 C-7.35468257 -6.78247902 -4.50964561 -5.13020432 0 0 Z " fill="#865CE0" transform="translate(368,30)"/>
6
- </svg>
@@ -1,136 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'faraday'
4
- require 'faraday_middleware'
5
- module Parsbank
6
- class Nobitex < Gates
7
- attr_accessor :amount, :description, :email, :mobile, :merchant, :callbackUrl, :orderId, :allowedCards, :ledgerId,
8
- :nationalCode, :checkMobileWithCard
9
-
10
- attr_reader :response, :status, :status_message, :ref_id, :logo
11
-
12
- def initialize(args = {})
13
- @amount = args.fetch(:amount)
14
- @description = args.fetch(:description, nil)
15
- @email = args.fetch(:email, nil)
16
- @mobile = args.fetch(:mobile, nil)
17
- @merchant = args.fetch(:merchant, default_config(:merchant))
18
- @callbackUrl = args.fetch(:callbackUrl, (default_config(:callback_url) || Parsbank.configuration.callback_url))
19
- @orderId = args.fetch(:orderId, nil)
20
- @allowedCards = args.fetch(:allowedCards, nil)
21
- @ledgerId = args.fetch(:ledgerId, nil)
22
- @nationalCode = args.fetch(:nationalCode, nil)
23
- @checkMobileWithCard = args.fetch(:checkMobileWithCard, nil)
24
- rescue KeyError => e
25
- raise ArgumentError, "Missing required argument: #{e.message}"
26
- end
27
-
28
-
29
- def validate(response = nil)
30
- @response = response
31
- @ref_id = @response['trackId']
32
- @status = @response['result'].present? ? @response['result'] : 'FAILED'
33
-
34
- perform_validation
35
- self
36
- end
37
-
38
- def valid?
39
- @valid
40
- end
41
-
42
- def ref_id
43
- @ref_id.to_s
44
- end
45
-
46
- def call
47
- create_rest_client
48
- rescue Savon::Error => e
49
- raise "SOAP request failed: #{e.message}"
50
- end
51
-
52
- def redirect_form
53
- "
54
- <script type='text/javascript' charset='utf-8'>
55
- function postRefId (refIdValue) {
56
- var form = document.createElement('form');
57
- form.setAttribute('method', 'POST');
58
- form.setAttribute('action', 'https://gateway.zibal.ir/start/#{ref_id}');
59
- form.setAttribute('target', '_self');
60
- var hiddenField = document.createElement('input');
61
- hiddenField.setAttribute('name', 'RefId');
62
- hiddenField.setAttribute('value', refIdValue);
63
- form.appendChild(hiddenField);
64
- document.body.appendChild(form);
65
- form.submit();
66
- document.body.removeChild(form);
67
- }
68
-
69
-
70
- postRefId('#{ref_id}') %>')
71
- </script>
72
- "
73
- end
74
-
75
- private
76
-
77
- def create_rest_client
78
- connection = Parsbank::Restfull.new(
79
- endpoint: default_config(:endpoint) || 'https://gateway.zibal.ir',
80
- action: '/v1/request',
81
- headers: {
82
- 'Content-Type' => 'application/json',
83
- 'Authorization' => "Bearer #{default_config(:access_token)}"
84
- },
85
- request_message: build_request_message,
86
- http_method: :post,
87
- response_type: :json
88
- )
89
-
90
- response = connection.call
91
-
92
- Rails.logger.info "Received response with status: #{response.status}, body: #{response.body.inspect}"
93
-
94
- if response.valid?
95
- validate(response.body)
96
- else
97
- @valid = false
98
- Rails.logger.error "POST request to #{BASE_URL}/#{endpoint} failed with status: #{response.status}, error: #{response.body.inspect}"
99
- raise "API request failed with status #{response.status}: #{response.body}"
100
- end
101
- rescue Faraday::ConnectionFailed => e
102
- Rails.logger.error "Connection failed: #{e.message}"
103
- raise "Connection to API failed: #{e.message}"
104
- rescue Faraday::TimeoutError => e
105
- Rails.logger.error "Request timed out: #{e.message}"
106
- raise "API request timed out: #{e.message}"
107
- rescue StandardError => e
108
- Rails.logger.error "An error occurred: #{e.message}"
109
- raise "An unexpected error occurred: #{e.message}"
110
-
111
- JSON.parse response.body
112
- end
113
-
114
- def build_request_message
115
- {
116
- 'amount' => @amount,
117
- 'description' => @description,
118
- 'email' => @email,
119
- 'mobile' => @mobile,
120
- 'merchant' => @merchant,
121
- 'callbackUrl' => @callbackUrl,
122
- 'orderId' => @orderId,
123
- 'allowedCards' => @allowedCards,
124
- 'ledgerId' => @ledgerId,
125
- 'nationalCode' => @nationalCode,
126
- 'checkMobileWithCard' => @checkMobileWithCard
127
- }
128
- end
129
-
130
- def perform_validation
131
- # Logic for validation should be implemented here.
132
- # Update @valid, @status, and @status_message based on @response.
133
- @valid = @response['result'] == '100'
134
- end
135
- end
136
- end
@@ -1,56 +0,0 @@
1
- <svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" viewBox="0 0 1575 350">
2
- <defs>
3
- <style>
4
- .cls-1 {
5
- fill: none;
6
- stroke: #fff;
7
- stroke-miterlimit: 10;
8
- stroke-width: 20px;
9
- }
10
-
11
- .cls-2 {
12
- fill: #19191a;
13
- fill-rule: evenodd;
14
- }
15
-
16
- .cls-3 {
17
- fill: url(#linear-gradient);
18
- }
19
-
20
- .cls-4 {
21
- fill: #0a33ff;
22
- }
23
-
24
- .cls-5 {
25
- fill: url(#linear-gradient-2);
26
- }
27
- </style>
28
- <linearGradient id="linear-gradient" x1="1464.6051" y1="719.8056" x2="1370.1251" y2="469.4806" gradientTransform="matrix(1, 0, 0, -1, 0, 770)" gradientUnits="userSpaceOnUse">
29
- <stop offset="0" stop-color="#ffd60a"/>
30
- <stop offset="1" stop-color="#f5be09"/>
31
- </linearGradient>
32
- <linearGradient id="linear-gradient-2" x1="1411.0288" y1="693.8954" x2="1357.4613" y2="560.3856" gradientTransform="matrix(1, 0, 0, -1, 0, 770)" gradientUnits="userSpaceOnUse">
33
- <stop offset="0" stop-color="#051a80"/>
34
- <stop offset="1" stop-color="#0a33ff"/>
35
- </linearGradient>
36
- </defs>
37
- <polygon class="cls-1" points="1975 4650 -7025 4650 -7025 2100 -13975 2100 -13975 -6600 1975 -6600 1975 4650"/>
38
- <g>
39
- <g>
40
- <path class="cls-2" d="M300,0a25,25,0,0,1,25,25V150a25,25,0,0,0,25,25h75a25,25,0,0,0,25-25V125a25,25,0,0,1,50,0v25a74.9994,74.9994,0,0,1-75,75H350a74.9994,74.9994,0,0,1-75-75V25A25,25,0,0,1,300,0Z"/>
41
- <path class="cls-2" d="M350,275a25,25,0,0,1,25-25h75a25,25,0,0,1,25,25v25a25,25,0,0,1-50,0H375A25,25,0,0,1,350,275Z"/>
42
- <path class="cls-2" d="M225,0a25,25,0,0,1,25,25V199.6432C250,254.8725,205.218,300,149.99,300S50,254.8725,50,199.6432V150a25,25,0,0,1,50,0v49.6432c0,27.6143,22.3752,50.3561,49.9895,50.3561S200,227.2575,200,199.6432V25A25,25,0,0,1,225,0Z"/>
43
- <path class="cls-2" d="M1150.0025,75a25.0267,25.0267,0,1,0-17.6725-7.33A24.9938,24.9938,0,0,0,1150.0025,75Z"/>
44
- <path class="cls-2" d="M625.0025,75A25.0267,25.0267,0,1,0,607.33,67.67,24.9938,24.9938,0,0,0,625.0025,75Z"/>
45
- <path class="cls-2" d="M1150,100a25,25,0,0,0-25,25v90.625c0,13.1548-3.7,21.8985-7.8925,26.889A21.0264,21.0264,0,0,1,1100,250a25,25,0,0,0,0,50,70.9509,70.9509,0,0,0,55.3925-25.3275C1168.7,258.83,1175,237.8868,1175,215.625V125a25,25,0,0,0-25-25Z"/>
46
- <path class="cls-2" d="M1075,125a25,25,0,0,0-50,0v90.625c0,13.1548-3.7,21.8985-7.8925,26.889A21.0264,21.0264,0,0,1,1000,250a25,25,0,0,0,0,50,70.9509,70.9509,0,0,0,55.3925-25.3275C1068.7,258.83,1075,237.8868,1075,215.625Z"/>
47
- <path class="cls-2" d="M925,250H850a25,25,0,0,0,0,50h75a25,25,0,0,0,0-50Z"/>
48
- <path class="cls-2" d="M975,125a25,25,0,0,0-50,0v27.5c0,12.152-9.4775,22.5-25,22.5H750c-15.5225,0-25-10.348-25-22.5V125a25,25,0,0,0-50,0v75a50,50,0,0,1-100,0V125a25,25,0,0,0-50,0v75a100.0094,100.0094,0,0,0,197.9475,20.2393A79.1518,79.1518,0,0,0,750,225H900c39.705,0,75-29.4235,75-72.5Z"/>
49
- </g>
50
- <g>
51
- <path class="cls-3" d="M1387.89,61.0007A17.6259,17.6259,0,0,1,1404.2551,50h113.1024a17.5138,17.5138,0,0,1,16.365,23.9993L1447.11,289a17.6274,17.6274,0,0,1-16.3651,11H1317.6425a17.5144,17.5144,0,0,1-16.365-24Z"/>
52
- <path class="cls-4" d="M1340,200a75,75,0,1,0-75-75A74.9994,74.9994,0,0,0,1340,200Z"/>
53
- <path class="cls-5" d="M1415,125a74.9992,74.9992,0,0,1-75,75,75.9137,75.9137,0,0,1-7.9375-.415L1385.98,65.7435A74.8675,74.8675,0,0,1,1415,125Z"/>
54
- </g>
55
- </g>
56
- </svg>
@@ -1,140 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Parsbank
4
- class Zarinpal < Gates
5
- attr_accessor :amount, :description, :email, :mobile, :merchant_id, :wsdl
6
- attr_reader :response, :status, :status_message, :ref_id, :logo
7
-
8
- def initialize(args = {})
9
- @mobile = args.fetch(:mobile, '')
10
- @email = args.fetch(:email, '')
11
- @amount = args.fetch(:amount)
12
- @description = args.fetch(:description, ' ')
13
- @callback_url = args.fetch(:callback_url,
14
- (default_config(:callback_url) || Parsbank.configuration.callback_url))
15
- @merchant_id = args.fetch(:merchant_id, default_config(:merchant_id))
16
- @wsdl = create_rest_client
17
- rescue KeyError => e
18
- raise ArgumentError, "Missing required argument: #{e.message}"
19
- end
20
-
21
- def validate(response = nil)
22
- @response = response[:payment_request_response] || response[:payment_verification_response] || response
23
- @ref_id = @response[:authority]
24
- @status = @response[:status].present? ? @response[:status] : 'FAILED'
25
-
26
- perform_validation
27
- self
28
- end
29
-
30
- def valid?
31
- @valid
32
- end
33
-
34
- def ref_id
35
- @ref_id.to_s
36
- end
37
-
38
- def call
39
- response = @wsdl.call
40
-
41
- Rails.logger.info "Received response with status: #{response.status}, body: #{response.body.inspect}"
42
-
43
- if response.valid?
44
- validate(response.body)
45
- else
46
- @valid = false
47
- Rails.logger.error "POST request to #{BASE_URL}/#{endpoint} failed with status: #{response.status}, error: #{response.body.inspect}"
48
- raise "API request failed with status #{response.status}: #{response.body}"
49
- end
50
- rescue Faraday::ConnectionFailed => e
51
- Rails.logger.error "Connection failed: #{e.message}"
52
- raise "Connection to API failed: #{e.message}"
53
- rescue Faraday::TimeoutError => e
54
- Rails.logger.error "Request timed out: #{e.message}"
55
- raise "API request timed out: #{e.message}"
56
- rescue StandardError => e
57
- Rails.logger.error "An error occurred: #{e.message}"
58
- raise "An unexpected error occurred: #{e.message}"
59
-
60
- JSON.parse response.body
61
-
62
- if response[:success]
63
- validate(response[:body])
64
- else
65
- { status: :nok, message: begin
66
- response[:error]
67
- rescue StandardError
68
- response
69
- end }
70
- end
71
- end
72
-
73
- def redirect_form(ref_id)
74
- javascript_tag = <<-JS
75
- <script type='text/javascript' charset='utf-8'>
76
- function postRefId(refIdValue) {
77
- var form = document.createElement('form');
78
- form.setAttribute('method', 'POST');
79
- form.setAttribute('action', 'https://www.zarinpal.com/pg/StartPay/' + refIdValue);
80
- form.setAttribute('target', '_self');
81
- var hiddenField = document.createElement('input');
82
- hiddenField.setAttribute('name', 'RefId');
83
- hiddenField.setAttribute('value', refIdValue);
84
- form.appendChild(hiddenField);
85
- document.body.appendChild(form);
86
- form.submit();
87
- document.body.removeChild(form);
88
- }
89
- postRefId('#{ref_id}');
90
- </script>
91
- JS
92
-
93
- redirect_loaders do
94
- "#{javascript_tag}#{I18n.t('actions.redirect_to_gate')}"
95
- end
96
- end
97
-
98
- private
99
-
100
- def create_rest_client
101
- Parsbank::Restfull.new(
102
- endpoint: default_config(:endpoint) || 'https://payment.zarinpal.com/pg/v4/payment',
103
- action: 'request.json',
104
- headers: {
105
- 'Content-Type' => 'application/json'
106
- },
107
- request_message: build_request_message,
108
- http_method: :post,
109
- response_type: :json
110
- )
111
-
112
-
113
- end
114
-
115
- def deep_clean(hash)
116
- hash.reject do |_, value|
117
- (value.is_a?(Hash) && deep_clean(value).empty?) || value.nil? || value == ""
118
- end.transform_values do |v|
119
- v.is_a?(Hash) ? deep_clean(v) : v
120
- end
121
-
122
- end
123
-
124
- def build_request_message
125
- deep_clean({
126
- 'merchant_id' => @merchant_id,
127
- 'metadata' => {'mobile' => @mobile, 'email' => @email,'order_id'=> ''},
128
- 'amount' => @amount,
129
- 'description' => @description,
130
- 'callback_url' => @callback_url
131
- })
132
- end
133
-
134
- def perform_validation
135
- # Logic for validation should be implemented here.
136
- # Update @valid, @status, and @status_message based on @response.
137
- @valid = @response[:status] == '100'
138
- end
139
- end
140
- end
@@ -1,42 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 470.9 223.6" style="enable-background:new 0 0 470.9 223.6;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{display:none;opacity:0.15;fill-rule:evenodd;clip-rule:evenodd;fill:none;}
7
- .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#3A3AE4;}
8
- .st2{fill:#172B4D;}
9
- </style>
10
- <g>
11
- <path class="st0" d="M470.9,0H0v50.1h0v123.8v5.8v44h470.9v-44v-5.8V50.1h0V0z M420.8,173.9H49.9V50.1h370.8V173.9z"/>
12
- <g>
13
- <g>
14
- <g>
15
- <path class="st1" d="M391.8,76.8l27.7,27.7c1.7,1.7,1.7,4.4,0,6L375,155.1c-1.7,1.7-4.4,1.7-6,0l-27.7-27.7
16
- c-1.7-1.7-1.7-4.4,0-6l44.5-44.6C387.5,75.1,390.2,75.1,391.8,76.8z"/>
17
- <path class="st1" d="M332.9,135.9l10.8,10.9c1.7,1.7,1.7,4.4,0,6L324.4,172c-1.7,1.7-4.4,1.7-6,0l-10.8-10.9
18
- c-1.7-1.7-1.7-4.4,0-6l19.3-19.3C328.5,134.2,331.2,134.2,332.9,135.9z"/>
19
- <path class="st1" d="M293.1,146.7L265.4,119c-1.7-1.7-1.7-4.4,0-6L310,68.3c1.7-1.7,4.4-1.7,6,0l27.7,27.7c1.7,1.7,1.7,4.4,0,6
20
- l-44.5,44.6C297.5,148.4,294.8,148.4,293.1,146.7z"/>
21
- <path class="st1" d="M352.1,87.6l-10.8-10.9c-1.7-1.7-1.7-4.4,0-6l19.3-19.3c1.7-1.7,4.4-1.7,6,0l10.8,10.9c1.7,1.7,1.7,4.4,0,6
22
- l-19.3,19.3C356.5,89.3,353.8,89.3,352.1,87.6z"/>
23
- </g>
24
- </g>
25
- <g>
26
- <path class="st2" d="M243.6,66.6h-8c-2.4,0-4.3,1.9-4.3,4.3v8c0,2.4,1.9,4.3,4.3,4.3h8c2.4,0,4.3-1.9,4.3-4.3v-8
27
- C247.8,68.5,245.9,66.6,243.6,66.6z"/>
28
- <path class="st2" d="M161.3,157.4h-8c-2.4,0-4.3,1.9-4.3,4.3v8c0,2.4,1.9,4.3,4.3,4.3h8c2.4,0,4.3-1.9,4.3-4.3v-8
29
- C165.6,159.3,163.7,157.4,161.3,157.4z"/>
30
- <path class="st2" d="M218.8,157.4h-24.5c-2.4,0-4.3,1.9-4.3,4.3v8c0,2.4,1.9,4.3,4.3,4.3h24.5c2.4,0,4.3-1.9,4.3-4.3v-8
31
- C223.1,159.3,221.2,157.4,218.8,157.4z"/>
32
- <path class="st2" d="M243.6,91.3h-8c-2.4,0-4.3,1.9-4.3,4.3v37h-28.7c-2.4,0-4.3,1.9-4.3,4.3v8c0,2.4,1.9,4.3,4.3,4.3h31.6h6.7
33
- h2.7c2.4,0,4.3-1.9,4.3-4.3V95.6C247.8,93.2,245.9,91.3,243.6,91.3z"/>
34
- <path class="st2" d="M111.7,50.1h-8c-2.4,0-4.3,1.9-4.3,4.3v78.2h-33v-37c0-2.4-1.9-4.3-4.3-4.3h-8c-2.4,0-4.3,1.9-4.3,4.3v49.2
35
- c0,2.4,1.9,4.3,4.3,4.3H61h2.5h38.8h3.9h5.4c2.4,0,4.3-1.9,4.3-4.3V54.3C115.9,52,114,50.1,111.7,50.1z"/>
36
- <path class="st2" d="M218.8,124.2c2.4,0,4.3-1.9,4.3-4.3v-8c0-2.4-1.9-4.3-4.3-4.3h-28.7V95.6c0-2.4-1.9-4.3-4.3-4.3h-8
37
- c-2.4,0-4.3,1.9-4.3,4.3v37h-33V54.3c0-2.4-1.9-4.3-4.3-4.3h-8c-2.4,0-4.3,1.9-4.3,4.3v81.1v9.4c0,2.4,1.9,4.3,4.3,4.3h9.4h38.8
38
- h2.5h6.9c2.4,0,4.3-1.9,4.3-4.3v-20.6H218.8z"/>
39
- </g>
40
- </g>
41
- </g>
42
- </svg>
@@ -1,133 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'faraday'
4
- require 'faraday_middleware'
5
- module Parsbank
6
- class Zibal < Gates
7
- attr_accessor :amount, :description, :email, :mobile, :merchant, :callbackUrl, :orderId, :allowedCards, :ledgerId,
8
- :nationalCode, :checkMobileWithCard
9
-
10
- attr_reader :response, :status, :status_message, :ref_id, :logo
11
-
12
- def initialize(args = {})
13
- @amount = args.fetch(:amount)
14
- @description = args.fetch(:description, nil)
15
- @email = args.fetch(:email, nil)
16
- @mobile = args.fetch(:mobile, nil)
17
- @merchant = args.fetch(:merchant, default_config(:merchant))
18
- @callbackUrl = args.fetch(:callbackUrl, (default_config(:callback_url) || Parsbank.configuration.callback_url))
19
- @orderId = args.fetch(:orderId, nil)
20
- @allowedCards = args.fetch(:allowedCards, nil)
21
- @ledgerId = args.fetch(:ledgerId, nil)
22
- @nationalCode = args.fetch(:nationalCode, nil)
23
- @checkMobileWithCard = args.fetch(:checkMobileWithCard, nil)
24
- rescue KeyError => e
25
- raise ArgumentError, "Missing required argument: #{e.message}"
26
- end
27
-
28
- def validate(response = nil)
29
- @response = response
30
- @ref_id = @response['trackId']
31
- @status = @response['result'].present? ? @response['result'] : 'FAILED'
32
-
33
- perform_validation
34
- self
35
- end
36
-
37
- def valid?
38
- @valid
39
- end
40
-
41
- def ref_id
42
- @ref_id.to_s
43
- end
44
-
45
- def call
46
- create_rest_client
47
- end
48
-
49
- def redirect_form
50
- "
51
- <script type='text/javascript' charset='utf-8'>
52
- function postRefId (refIdValue) {
53
- var form = document.createElement('form');
54
- form.setAttribute('method', 'POST');
55
- form.setAttribute('action', 'https://gateway.zibal.ir/start/#{ref_id}');
56
- form.setAttribute('target', '_self');
57
- var hiddenField = document.createElement('input');
58
- hiddenField.setAttribute('name', 'RefId');
59
- hiddenField.setAttribute('value', refIdValue);
60
- form.appendChild(hiddenField);
61
- document.body.appendChild(form);
62
- form.submit();
63
- document.body.removeChild(form);
64
- }
65
-
66
-
67
- postRefId('#{ref_id}') %>')
68
- </script>
69
- "
70
- end
71
-
72
- private
73
-
74
- def create_rest_client
75
- connection = Parsbank::Restfull.new(
76
- endpoint: default_config(:endpoint) || 'https://gateway.zibal.ir',
77
- action: '/v1/request',
78
- headers: {
79
- 'Content-Type' => 'application/json',
80
- 'Authorization' => "Bearer #{default_config(:access_token)}"
81
- },
82
- request_message: build_request_message,
83
- http_method: :post,
84
- response_type: :json
85
- )
86
-
87
- response = connection.call
88
-
89
- Rails.logger.info "Received response with status: #{response.status}, body: #{response.body.inspect}"
90
-
91
- if response.valid?
92
- validate(response.body)
93
- else
94
- @valid = false
95
- Rails.logger.error "POST request to #{BASE_URL}/#{endpoint} failed with status: #{response.status}, error: #{response.body.inspect}"
96
- raise "API request failed with status #{response.status}: #{response.body}"
97
- end
98
- rescue Faraday::ConnectionFailed => e
99
- Rails.logger.error "Connection failed: #{e.message}"
100
- raise "Connection to API failed: #{e.message}"
101
- rescue Faraday::TimeoutError => e
102
- Rails.logger.error "Request timed out: #{e.message}"
103
- raise "API request timed out: #{e.message}"
104
- rescue StandardError => e
105
- Rails.logger.error "An error occurred: #{e.message}"
106
- raise "An unexpected error occurred: #{e.message}"
107
-
108
- JSON.parse response.body
109
- end
110
-
111
- def build_request_message
112
- {
113
- 'amount' => @amount,
114
- 'description' => @description,
115
- 'email' => @email,
116
- 'mobile' => @mobile,
117
- 'merchant' => @merchant,
118
- 'callbackUrl' => @callbackUrl,
119
- 'orderId' => @orderId,
120
- 'allowedCards' => @allowedCards,
121
- 'ledgerId' => @ledgerId,
122
- 'nationalCode' => @nationalCode,
123
- 'checkMobileWithCard' => @checkMobileWithCard
124
- }
125
- end
126
-
127
- def perform_validation
128
- # Logic for validation should be implemented here.
129
- # Update @valid, @status, and @status_message based on @response.
130
- @valid = @response['result'] == '100'
131
- end
132
- end
133
- end
data/lib/psp.json DELETED
@@ -1,84 +0,0 @@
1
- {
2
- "asanpardakht": {
3
- "name": "Asan Pardakht CO.",
4
- "website": "http://asanpardakht.ir",
5
- "tags": ["iranian-psp", "ir", "rial"]
6
- },
7
- "damavand": {
8
- "name": "Electronic Card Damavand CO.",
9
- "website": "http://ecd-co.ir",
10
- "tags": ["iranian-psp", "ir", "rial"]
11
- },
12
- "mellat": {
13
- "name": "Behpardakht Mellat CO.",
14
- "website": "http://behpardakht.com",
15
- "tags": ["iranian-psp", "ir", "rial"]
16
- },
17
- "pep": {
18
- "name": "Pasargad CO.",
19
- "website": "http://pep.co.ir",
20
- "tags": ["iranian-psp", "ir", "rial"]
21
- },
22
- "sep": {
23
- "name": "Saman Bank CO.",
24
- "website": "http://sep.ir",
25
- "tags": ["iranian-psp", "ir", "rial"]
26
- },
27
- "pna": {
28
- "name": "Pardakht Novin Arian CO.",
29
- "website": "http://pna.co.ir",
30
- "tags": ["iranian-psp", "ir", "rial"]
31
- },
32
- "pec": {
33
- "name": "Parsian Bank CO.",
34
- "website": "http://pec.ir",
35
- "tags": ["iranian-psp", "ir", "rial"]
36
- },
37
- "sadad": {
38
- "name": "Sadad Bank CO.",
39
- "website": "http://sadadco.com",
40
- "tags": ["iranian-psp", "ir", "rial"]
41
- },
42
- "sayan": {
43
- "name": "Sayan Card CO.",
44
- "website": "http://sayancard.ir",
45
- "tags": ["iranian-psp", "ir", "rial"]
46
- },
47
- "fanava": {
48
- "name": "Fan Ava Card CO.",
49
- "website": "http://fanavacard.com",
50
- "tags": ["iranian-psp", "ir", "rial"]
51
- },
52
- "kiccc": {
53
- "name": "IranKish CO.",
54
- "website": "http://kiccc.com",
55
- "tags": ["iranian-psp", "ir", "rial"]
56
- },
57
- "sepehr": {
58
- "name": "Sepehr Bank CO.",
59
- "website": "http://www.sepehrpay.com",
60
- "tags": ["iranian-psp", "ir", "rial"]
61
- },
62
- "zarinpal": {
63
- "name": "Zarinpal",
64
- "website": "http://www.sepehrpay.com",
65
- "tags": ["iranian-psp", "irt", "rial"]
66
- },
67
- "zibal": {
68
- "name": "Zibal",
69
- "website": "http://zibal.ir",
70
- "tags": ["iranian-psp", "irt", "rial"]
71
- },
72
- "binance": {
73
- "name": "Binance",
74
- "website": "https://binance.com",
75
- "support_coins": ["btc", "usdt"],
76
- "tags": ["btc", "bitcoin", "binance", "bsc", "crypto"]
77
- },
78
- "nobitex": {
79
- "name": "Nobitex",
80
- "website": "https://nobitex.ir",
81
- "support_coins": ["btc", "usdt"],
82
- "tags": ["btc", "bitcoin", "nobitex", "bsc", "crypto"]
83
- }
84
- }
@@ -1,215 +0,0 @@
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>