rails-przelewy24 0.0.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.
- data/MIT-LICENSE +20 -0
- data/README +30 -0
- data/Rakefile +28 -0
- data/generators/przelewy24/USAGE +12 -0
- data/generators/przelewy24/przelewy24_generator.rb +107 -0
- data/generators/przelewy24/templates/controller.rb +108 -0
- data/generators/przelewy24/templates/helper.rb +2 -0
- data/generators/przelewy24/templates/migration.rb +28 -0
- data/generators/przelewy24/templates/model.rb +87 -0
- data/generators/przelewy24/templates/view__form.html.erb +32 -0
- data/generators/przelewy24/templates/view_confirm.html.erb +41 -0
- data/generators/przelewy24/templates/view_error.html.erb +1 -0
- data/generators/przelewy24/templates/view_index.html.erb +30 -0
- data/generators/przelewy24/templates/view_new.html.erb +3 -0
- data/generators/przelewy24/templates/view_show.html.erb +67 -0
- data/generators/przelewy24/templates/view_verified.html.erb +1 -0
- metadata +70 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 [Jakub Godawa, Łukasz Krystkowiak]
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
rails-przelewy24
|
2
|
+
==========
|
3
|
+
|
4
|
+
No yet finished.
|
5
|
+
This is the plugin for polish payment service Przelewy24.pl
|
6
|
+
|
7
|
+
It consist of a generator of model, controller and views for dealing with Przelewy24.
|
8
|
+
|
9
|
+
|
10
|
+
Example
|
11
|
+
=======
|
12
|
+
|
13
|
+
Application that have products to sell finally sends the form to Przelewy24.
|
14
|
+
All transaction security and verification is held by this plugin and Przelewy24 site.
|
15
|
+
|
16
|
+
Just after cloning it do, example:
|
17
|
+
|
18
|
+
script/generate przelewy24 payment
|
19
|
+
rake db:migrate
|
20
|
+
|
21
|
+
copy/paste to routes:
|
22
|
+
map.confirm_payment 'confirmation', :controller => :payments, :action => :confirm
|
23
|
+
map.ok_payments 'verification-successful', :controller => :payments, :action => :ok, :conditions => { :method => :post }
|
24
|
+
map.error_payments 'error-in-transaction', :controller => :payments, :action => :error
|
25
|
+
|
26
|
+
|
27
|
+
and you are free to connect your shop with Przelewy24 payment service.
|
28
|
+
|
29
|
+
|
30
|
+
Copyright (c) 2010 [Jakub Godawa, Łukasz Krystkowiak], released under the MIT license
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubygems/package_task'
|
3
|
+
|
4
|
+
PKG_FILES = FileList[
|
5
|
+
'[a-zA-Z]*',
|
6
|
+
'generators/**/*'
|
7
|
+
]
|
8
|
+
|
9
|
+
spec = Gem::Specification.new do |s|
|
10
|
+
s.name = "rails-przelewy24"
|
11
|
+
s.version = "0.0.1"
|
12
|
+
s.author = "Jakub Godawa, Łukasz Krystkowiak"
|
13
|
+
s.email = "jakub.godawa@gmail.com"
|
14
|
+
s.homepage = "http://github.com/vysogot/przelewy24"
|
15
|
+
s.platform = Gem::Platform::RUBY
|
16
|
+
s.summary = "Tool to deal with Przelewy24.pl payment service"
|
17
|
+
s.description = "Gem that can generate files necesary to be able to use Przelewy24.pl as your payment service."
|
18
|
+
s.files = PKG_FILES.to_a
|
19
|
+
s.has_rdoc = false
|
20
|
+
s.extra_rdoc_files = ["README"]
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Turn this plugin into a gem.'
|
24
|
+
Gem::PackageTask.new(spec) do |pkg|
|
25
|
+
pkg.gem_spec = spec
|
26
|
+
pkg.need_zip = true
|
27
|
+
pkg.need_tar = true
|
28
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Description:
|
2
|
+
Stubs out new model and controller for Przelewy24 payment service.
|
3
|
+
Pass the name of the model you want to be responsible for that.
|
4
|
+
|
5
|
+
Example:
|
6
|
+
./script/generate przelewy24 payment
|
7
|
+
|
8
|
+
This will create:
|
9
|
+
app/models/payment.rb
|
10
|
+
app/controllers/payments_controller.rb
|
11
|
+
app/views/payments/...
|
12
|
+
db/migration/create_payments.rb
|
@@ -0,0 +1,107 @@
|
|
1
|
+
class Przelewy24Generator < Rails::Generator::NamedBase
|
2
|
+
default_options :skip_migration => false
|
3
|
+
|
4
|
+
# from rails/scaffold_generator
|
5
|
+
attr_reader :controller_name,
|
6
|
+
:controller_class_path,
|
7
|
+
:controller_file_path,
|
8
|
+
:controller_class_nesting,
|
9
|
+
:controller_class_nesting_depth,
|
10
|
+
:controller_class_name,
|
11
|
+
:controller_underscore_name,
|
12
|
+
:controller_singular_name,
|
13
|
+
:controller_plural_name
|
14
|
+
alias_method :controller_file_name, :controller_underscore_name
|
15
|
+
alias_method :controller_table_name, :controller_plural_name
|
16
|
+
|
17
|
+
def initialize(runtime_args, runtime_options = {})
|
18
|
+
super
|
19
|
+
|
20
|
+
if @name == @name.pluralize && !options[:force_plural]
|
21
|
+
logger.warning "Plural version of the model detected, using singularized version. Override with --force-plural."
|
22
|
+
@name = @name.singularize
|
23
|
+
assign_names!(@name)
|
24
|
+
end
|
25
|
+
|
26
|
+
@controller_name = @name.pluralize
|
27
|
+
|
28
|
+
base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
|
29
|
+
@controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
|
30
|
+
@controller_singular_name=base_name.singularize
|
31
|
+
if @controller_class_nesting.empty?
|
32
|
+
@controller_class_name = @controller_class_name_without_nesting
|
33
|
+
else
|
34
|
+
@controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def manifest
|
39
|
+
record do |m|
|
40
|
+
# Check for class naming collisions
|
41
|
+
m.class_collisions("#{controller_class_name}Controller", "#{controller_class_name}Helper")
|
42
|
+
m.class_collisions(class_name)
|
43
|
+
|
44
|
+
# Model, controller, helpers and views directories
|
45
|
+
m.directory File.join('app/models', class_path)
|
46
|
+
m.directory File.join('app/controllers', controller_class_path)
|
47
|
+
m.directory File.join('app/helpers', controller_class_path)
|
48
|
+
m.directory File.join('app/views', controller_class_path, controller_file_name)
|
49
|
+
|
50
|
+
# Generate views
|
51
|
+
for action in p24_views
|
52
|
+
m.template(
|
53
|
+
"view_#{action}.html.erb",
|
54
|
+
File.join('app/views', controller_class_path, controller_file_name, "#{action}.html.erb")
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Generate controller
|
59
|
+
m.template(
|
60
|
+
'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
|
61
|
+
)
|
62
|
+
|
63
|
+
# Generate helper
|
64
|
+
m.template(
|
65
|
+
'helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb")
|
66
|
+
)
|
67
|
+
|
68
|
+
# Route
|
69
|
+
m.route_resources controller_file_name
|
70
|
+
|
71
|
+
migration_file_path = file_path.gsub(/\//, '_')
|
72
|
+
migration_name = class_name
|
73
|
+
if ActiveRecord::Base.pluralize_table_names
|
74
|
+
migration_name = migration_name.pluralize
|
75
|
+
migration_file_path = migration_file_path.pluralize
|
76
|
+
end
|
77
|
+
|
78
|
+
unless options[:skip_migration]
|
79
|
+
m.migration_template 'migration.rb', 'db/migrate', :assigns => {
|
80
|
+
:migration_name => "Create#{migration_name.gsub(/::/, '')}"
|
81
|
+
}, :migration_file_name => "create_#{migration_file_path}"
|
82
|
+
end
|
83
|
+
|
84
|
+
# Generate model
|
85
|
+
m.template(
|
86
|
+
'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
|
87
|
+
)
|
88
|
+
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
protected
|
93
|
+
|
94
|
+
def banner
|
95
|
+
"Usage: #{$0} #{spec.name} ModelName"
|
96
|
+
end
|
97
|
+
|
98
|
+
def add_options!(opt)
|
99
|
+
opt.separator("Options: ")
|
100
|
+
opt.on("--skip-migration", "Don't generate migration for Przelewy24")
|
101
|
+
end
|
102
|
+
|
103
|
+
def p24_views
|
104
|
+
%w( new index _form show verified error confirm )
|
105
|
+
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# responsible for transactions and connection with payments service
|
2
|
+
# Przelewy24.pl
|
3
|
+
class <%= controller_class_name %>Controller < ApplicationController
|
4
|
+
|
5
|
+
# requests from Przelewy24.pl
|
6
|
+
protect_from_forgery :except => [:ok, :error]
|
7
|
+
|
8
|
+
# If you want to use ssl, uncomment that line
|
9
|
+
# before_filter :require_ssl, :only => [:new, :confirm]
|
10
|
+
|
11
|
+
def index
|
12
|
+
@<%= table_name %> = <%= class_name %>.all
|
13
|
+
end
|
14
|
+
|
15
|
+
def show
|
16
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
17
|
+
end
|
18
|
+
|
19
|
+
def new
|
20
|
+
@<%= file_name %> = <%= class_name %>.new
|
21
|
+
end
|
22
|
+
|
23
|
+
# create new transaction with <%= file_name %> before verifing it with <%= file_name %> confirm form
|
24
|
+
def create
|
25
|
+
@<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
|
26
|
+
|
27
|
+
if @<%= file_name %>.save
|
28
|
+
flash[:notice] = t('transaction_created')
|
29
|
+
session[:<%= file_name %>_id] = @<%= file_name %>.id
|
30
|
+
|
31
|
+
redirect_to confirm_<%= file_name %>_url
|
32
|
+
else
|
33
|
+
render :action => 'new'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy
|
38
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
39
|
+
@<%= file_name %>.destroy
|
40
|
+
flash[:notice] = t('transaction_destroyed')
|
41
|
+
redirect_to <%= table_name %>_url
|
42
|
+
end
|
43
|
+
|
44
|
+
# transaction confirmation
|
45
|
+
def confirm
|
46
|
+
@<%= file_name %> = <%= class_name %>.find(session[:<%= file_name %>_id])
|
47
|
+
end
|
48
|
+
|
49
|
+
# first verification from Przelewy24.pl
|
50
|
+
def ok
|
51
|
+
@<%= file_name %> = <%= class_name %>.find_by_session_id(params[:<%= file_name %>_session_id])
|
52
|
+
if @<%= file_name %> && @<%= file_name %>.update_attribute(:order_id, params[:p24_order_id])
|
53
|
+
|
54
|
+
# verification with service - name in polish to be consistent with current PHP spec
|
55
|
+
przelewy24_weryfikuj
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def error
|
60
|
+
end
|
61
|
+
|
62
|
+
def verified
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
# Przelewy24.pl final verification process
|
68
|
+
def przelewy24_weryfikuj
|
69
|
+
|
70
|
+
# verification script url
|
71
|
+
url = URI.parse('https://secure.przelewy24.pl/transakcja.php')
|
72
|
+
|
73
|
+
# post request with '&' PHP connectors
|
74
|
+
req = Net::HTTP::Post.new(url.path)
|
75
|
+
req.set_form_data(@<%= file_name %>.attributes_for_verify, '&')
|
76
|
+
|
77
|
+
# create new http object with ssl usage
|
78
|
+
http = Net::HTTP.new(url.host, url.port)
|
79
|
+
http.use_ssl = true
|
80
|
+
|
81
|
+
# get the response from Przelewy24.pl
|
82
|
+
res = http.start {|http| http.request(req) }
|
83
|
+
|
84
|
+
case res
|
85
|
+
when Net::HTTPSuccess, Net::HTTPRedirection
|
86
|
+
results = res.body.split("\r\n")
|
87
|
+
if results[1] == "TRUE"
|
88
|
+
|
89
|
+
# check if transaction is not already used
|
90
|
+
unless @<%= file_name %>.is_verified
|
91
|
+
flash[:notice] = t('transaction_successfully_verified')
|
92
|
+
redirect_to accounts_url
|
93
|
+
return
|
94
|
+
else
|
95
|
+
error_desc = t('transaction_already_used')
|
96
|
+
end
|
97
|
+
else
|
98
|
+
error_desc = "#{results[2]} #{results[3]}"
|
99
|
+
end
|
100
|
+
else
|
101
|
+
error_desc = t('connection_error')
|
102
|
+
end
|
103
|
+
|
104
|
+
# display error flash and redirect to error action
|
105
|
+
flash[:error] = error_desc
|
106
|
+
redirect_to :action => :error
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class <%= migration_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
t.string :session_id
|
5
|
+
t.string :id_sprzedawcy
|
6
|
+
t.integer :kwota
|
7
|
+
t.string :klient
|
8
|
+
t.string :adres
|
9
|
+
t.string :kod
|
10
|
+
t.string :miasto
|
11
|
+
t.string :kraj
|
12
|
+
t.string :email
|
13
|
+
t.text :opis
|
14
|
+
t.integer :order_id
|
15
|
+
t.integer :order_id_full
|
16
|
+
t.string :error_code
|
17
|
+
t.string :language
|
18
|
+
t.integer :metoda
|
19
|
+
t.boolean :is_verified, :default => false
|
20
|
+
|
21
|
+
t.timestamps
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.down
|
26
|
+
drop_table :<%= table_name %>
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# responsible for process with payment service Przelewy24.pl
|
2
|
+
class <%= class_name %> < ActiveRecord::Base
|
3
|
+
|
4
|
+
before_create :set_session_id
|
5
|
+
|
6
|
+
SELLER_ID = 1000 # Put here you account login on przelewy24
|
7
|
+
COUNTRY = 'PL'
|
8
|
+
LANGUAGE = 'pl'
|
9
|
+
|
10
|
+
validates_presence_of :email, :klient, :adres, :kod, :miasto
|
11
|
+
validates_format_of :kod, :with => /[0-9]{2}-[0-9]{3}/ # polish post code check
|
12
|
+
|
13
|
+
# price to display - in db is in cents
|
14
|
+
def kwota_pln
|
15
|
+
kwota.to_f/100
|
16
|
+
end
|
17
|
+
|
18
|
+
# generate 64-char long key to przelewy24.pl
|
19
|
+
def self.generate_session_id
|
20
|
+
<%= class_name %>Tools::generate(64, 26, 97)
|
21
|
+
end
|
22
|
+
|
23
|
+
# attributes that are needed in second verification
|
24
|
+
def attributes_for_verify
|
25
|
+
{
|
26
|
+
'p24_session_id' => session_id,
|
27
|
+
'p24_order_id' => order_id,
|
28
|
+
'p24_id_sprzedawcy' => SELLER_ID,
|
29
|
+
'p24_kwota' => kwota
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# attibutes that are needed for first contact with przelewy24.pl
|
34
|
+
def attributes_for_p24
|
35
|
+
{
|
36
|
+
'p24_session_id' => session_id,
|
37
|
+
'p24_id_sprzedawcy' => SELLER_ID,
|
38
|
+
'p24_opis' => <%= class_name %>Tools::replace_polish_chars(opis),
|
39
|
+
'p24_kwota' => kwota,
|
40
|
+
'p24_klient' => <%= class_name %>Tools::replace_polish_chars(klient),
|
41
|
+
'p24_adres' => <%= class_name %>Tools::replace_polish_chars(adres),
|
42
|
+
'p24_kod' => kod,
|
43
|
+
'p24_miasto' => <%= class_name %>Tools::replace_polish_chars(miasto),
|
44
|
+
'p24_kraj' => COUNTRY,
|
45
|
+
'p24_email' => email,
|
46
|
+
'p24_language' => LANGUAGE
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# after the payment correct verification
|
51
|
+
def set_account
|
52
|
+
transaction do
|
53
|
+
unless is_verified
|
54
|
+
update_attribute(:is_verified, true)
|
55
|
+
|
56
|
+
# Here you should put what happen after correct verification process
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
# setting session id for connection with przelewy24
|
64
|
+
def set_session_id
|
65
|
+
self.session_id = <%= class_name %>.generate_session_id
|
66
|
+
end
|
67
|
+
|
68
|
+
class <%= class_name %>Tools
|
69
|
+
|
70
|
+
# Generate a string with given length from given ascii range
|
71
|
+
def self.generate(length, from, to)
|
72
|
+
string = ""
|
73
|
+
length.times { |i| string << (rand(from)+to).chr }
|
74
|
+
string
|
75
|
+
end
|
76
|
+
|
77
|
+
# Replace polish chars, so there will be no funny signs on Przelewy24 in transactions
|
78
|
+
def self.replace_polish_chars(string)
|
79
|
+
ascii = "acelnoszzACELNOSZZ"
|
80
|
+
cep = "\271\346\352\263\361\363\234\277\237\245\306\312\243\321\323\214\257\217"
|
81
|
+
string = Iconv.new("cp1250", "UTF-8").iconv(string)
|
82
|
+
string.tr(cep,ascii)
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<%% form_for @<%= singular_name %> do |f| %>
|
2
|
+
<%%= f.error_messages %>
|
3
|
+
<p>
|
4
|
+
<%%= f.label :email %><br />
|
5
|
+
<%%= f.text_field :email, :value => @<%= singular_name %>.email %>
|
6
|
+
</p>
|
7
|
+
<p>
|
8
|
+
<%%= f.label :klient %><br />
|
9
|
+
<%%= f.text_field :klient, :value => @<%= singular_name %>.klient %>
|
10
|
+
</p>
|
11
|
+
<p>
|
12
|
+
<%%= f.label :adres %><br />
|
13
|
+
<%%= f.text_field :adres, :value => @<%= singular_name %>.adres %>
|
14
|
+
</p>
|
15
|
+
<p>
|
16
|
+
<%%= f.label :kod %><br />
|
17
|
+
<%%= f.text_field :kod, :value => @<%= singular_name %>.kod %>
|
18
|
+
</p>
|
19
|
+
<p>
|
20
|
+
<%%= f.label :miasto %><br />
|
21
|
+
<%%= f.text_field :miasto, :value => @<%= singular_name %>.miasto %>
|
22
|
+
</p>
|
23
|
+
<p>
|
24
|
+
<%%= f.label :opis %><br />
|
25
|
+
<%%= f.text_field :opis, :value => @<%= singular_name %>.opis %>
|
26
|
+
</p>
|
27
|
+
<p>
|
28
|
+
<%%= f.label :kwota %><br />
|
29
|
+
<%%= f.text_field :kwota, :value => @<%= singular_name %>.kwota %>
|
30
|
+
</p>
|
31
|
+
<p><%%= f.submit t('submit') %></p>
|
32
|
+
<%% end %>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<%% form_tag 'https://secure.przelewy24.pl/index.php' do %>
|
2
|
+
|
3
|
+
<%% @<%= singular_name %>.attributes_for_p24.each do |key, value| %>
|
4
|
+
<%%= hidden_field_tag key, value %>
|
5
|
+
<%% end %>
|
6
|
+
|
7
|
+
<%%= hidden_field_tag :<%= singular_name %>_return_url_ok, ok_<%= plural_name %>_url %>
|
8
|
+
<%%= hidden_field_tag :<%= singular_name %>_return_url_error, error_<%= plural_name %>_url %>
|
9
|
+
|
10
|
+
<div id="confirm">
|
11
|
+
<p>
|
12
|
+
<strong>Email:</strong>
|
13
|
+
<%%=h @<%= singular_name %>.email %>
|
14
|
+
</p>
|
15
|
+
<p>
|
16
|
+
<strong>Klient:</strong>
|
17
|
+
<%%=h @<%= singular_name %>.klient %>
|
18
|
+
</p>
|
19
|
+
<p>
|
20
|
+
<strong>Adres:</strong>
|
21
|
+
<%%=h @<%= singular_name %>.adres %>
|
22
|
+
</p>
|
23
|
+
<p>
|
24
|
+
<strong>Kod:</strong>
|
25
|
+
<%%=h @<%= singular_name %>.kod %>
|
26
|
+
</p>
|
27
|
+
<p>
|
28
|
+
<strong>Miasto:</strong>
|
29
|
+
<%%=h @<%= singular_name %>.miasto %>
|
30
|
+
</p>
|
31
|
+
<p>
|
32
|
+
<strong>Opis:</strong>
|
33
|
+
<%%=h @<%= singular_name %>.opis %>
|
34
|
+
</p>
|
35
|
+
<p>
|
36
|
+
<strong>Kwota:</strong>
|
37
|
+
<%%=h @<%= singular_name %>.kwota %>
|
38
|
+
</p>
|
39
|
+
</div>
|
40
|
+
<p><%%= submit_tag t('submit_to_p24') %></p>
|
41
|
+
<%% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%% t('transactions') %>
|
2
|
+
|
3
|
+
<%% if @<%= plural_name %>.present? %>
|
4
|
+
<table>
|
5
|
+
<tr>
|
6
|
+
<th><%= singular_name %> id</th>
|
7
|
+
<th>Klient</th>
|
8
|
+
<th>Kwota</th>
|
9
|
+
<th>Email</th>
|
10
|
+
<th>Opis</th>
|
11
|
+
<th>Metoda</th>
|
12
|
+
<th>Verified</th>
|
13
|
+
</tr>
|
14
|
+
<%% for <%= singular_name %> in @<%= plural_name %> %>
|
15
|
+
<tr>
|
16
|
+
<td><%%=h <%= singular_name %>.order_id %></td>
|
17
|
+
<td><%%=h <%= singular_name %>.klient %></td>
|
18
|
+
<td><%%=h number_to_currency(<%= singular_name %>.kwota_pln) %></td>
|
19
|
+
<td><%%=h <%= singular_name %>.email %></td>
|
20
|
+
<td><%%=h <%= singular_name %>.opis %></td>
|
21
|
+
<td><%%=h <%= singular_name %>.metoda %></td>
|
22
|
+
<td><%%=h <%= singular_name %>.is_verified %></td>
|
23
|
+
<td><%%= link_to t('show'), <%= singular_name %> %></td>
|
24
|
+
<td><%%= link_to t('destroy'), <%= singular_name %>, :confirm => t('are_you_sure'), :method => :delete %></td>
|
25
|
+
</tr>
|
26
|
+
<%% end %>
|
27
|
+
</table>
|
28
|
+
<%% else %>
|
29
|
+
<p><%%= t('no_transactions') %></p>
|
30
|
+
<%% end %>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<%% t('transaction') %>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Session:</strong>
|
5
|
+
<%%=h @<%= singular_name %>.session_id %>
|
6
|
+
</p>
|
7
|
+
<p>
|
8
|
+
<strong>Id Sprzedawcy:</strong>
|
9
|
+
<%%=h @<%= singular_name %>.id_sprzedawcy %>
|
10
|
+
</p>
|
11
|
+
<p>
|
12
|
+
<strong>Kwota:</strong>
|
13
|
+
<%%=h @<%= singular_name %>.kwota %>
|
14
|
+
</p>
|
15
|
+
<p>
|
16
|
+
<strong>Klient:</strong>
|
17
|
+
<%%=h @<%= singular_name %>.klient %>
|
18
|
+
</p>
|
19
|
+
<p>
|
20
|
+
<strong>Adres:</strong>
|
21
|
+
<%%=h @<%= singular_name %>.adres %>
|
22
|
+
</p>
|
23
|
+
<p>
|
24
|
+
<strong>Kod:</strong>
|
25
|
+
<%%=h @<%= singular_name %>.kod %>
|
26
|
+
</p>
|
27
|
+
<p>
|
28
|
+
<strong>Miasto:</strong>
|
29
|
+
<%%=h @<%= singular_name %>.miasto %>
|
30
|
+
</p>
|
31
|
+
<p>
|
32
|
+
<strong>Kraj:</strong>
|
33
|
+
<%%=h @<%= singular_name %>.kraj %>
|
34
|
+
</p>
|
35
|
+
<p>
|
36
|
+
<strong>Email:</strong>
|
37
|
+
<%%=h @<%= singular_name %>.email %>
|
38
|
+
</p>
|
39
|
+
<p>
|
40
|
+
<strong>Opis:</strong>
|
41
|
+
<%%=h @<%= singular_name %>.opis %>
|
42
|
+
</p>
|
43
|
+
<p>
|
44
|
+
<strong>Order:</strong>
|
45
|
+
<%%=h @<%= singular_name %>.order_id %>
|
46
|
+
</p>
|
47
|
+
<p>
|
48
|
+
<strong>Order Id Full:</strong>
|
49
|
+
<%%=h @<%= singular_name %>.order_id_full %>
|
50
|
+
</p>
|
51
|
+
<p>
|
52
|
+
<strong>Error Code:</strong>
|
53
|
+
<%%=h @<%= singular_name %>.error_code %>
|
54
|
+
</p>
|
55
|
+
<p>
|
56
|
+
<strong>Language:</strong>
|
57
|
+
<%%=h @<%= singular_name %>.language %>
|
58
|
+
</p>
|
59
|
+
<p>
|
60
|
+
<strong>Metoda:</strong>
|
61
|
+
<%%=h @<%= singular_name %>.metoda %>
|
62
|
+
</p>
|
63
|
+
|
64
|
+
<p>
|
65
|
+
<%%= link_to t('destroy'), @<%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %> |
|
66
|
+
<%%= link_to t('view_all'), <%= singular_name %>s_path %>
|
67
|
+
</p>
|
@@ -0,0 +1 @@
|
|
1
|
+
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails-przelewy24
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- "Jakub Godawa, \xC5\x81ukasz Krystkowiak"
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-06-07 00:00:00 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Gem that can generate files necesary to be able to use Przelewy24.pl as your payment service.
|
17
|
+
email: jakub.godawa@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
files:
|
25
|
+
- Rakefile
|
26
|
+
- MIT-LICENSE
|
27
|
+
- README
|
28
|
+
- generators/przelewy24/USAGE
|
29
|
+
- generators/przelewy24/templates/model.rb
|
30
|
+
- generators/przelewy24/templates/view__form.html.erb
|
31
|
+
- generators/przelewy24/templates/view_verified.html.erb
|
32
|
+
- generators/przelewy24/templates/view_error.html.erb
|
33
|
+
- generators/przelewy24/templates/helper.rb
|
34
|
+
- generators/przelewy24/templates/view_confirm.html.erb
|
35
|
+
- generators/przelewy24/templates/view_new.html.erb
|
36
|
+
- generators/przelewy24/templates/migration.rb
|
37
|
+
- generators/przelewy24/templates/view_index.html.erb
|
38
|
+
- generators/przelewy24/templates/controller.rb
|
39
|
+
- generators/przelewy24/templates/view_show.html.erb
|
40
|
+
- generators/przelewy24/przelewy24_generator.rb
|
41
|
+
has_rdoc: true
|
42
|
+
homepage: http://github.com/vysogot/przelewy24
|
43
|
+
licenses: []
|
44
|
+
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: "0"
|
61
|
+
version:
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 1.3.5
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: Tool to deal with Przelewy24.pl payment service
|
69
|
+
test_files: []
|
70
|
+
|