spree_checkout_ru 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +26 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +33 -0
- data/Rakefile +1 -0
- data/lib/_checkout_ru.html.erb +11 -0
- data/lib/checkout_controller_decorator.rb +119 -0
- data/lib/checkoutru.js +203 -0
- data/lib/generators/spree_checkout_ru/install_generator.rb +13 -0
- data/lib/spree_checkout_ru/version.rb +3 -0
- data/lib/spree_checkout_ru.rb +5 -0
- data/spree_checkout_ru.gemspec +23 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e9edd0dc3b0d6543142a78c198b56c2e10433089
|
4
|
+
data.tar.gz: d5cc3230d9e6f141e08ea0ba2fce95df3e71e13f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f95fd1ff0b4279e764b35d91de1309265632490ca62445a908a2a7d5a1788f6060ddb899fed7e4a536e565a59cc1f541d33a1f0a85a57d704d34ac37c1495761
|
7
|
+
data.tar.gz: 5d53799818ae9e7c7167862a365c48b60580bb940bb9e39c926e9150e3fe17265ba58647b68edf1ad9494d4b4b1a1c8739dae7cf641ca07abdd3599a9061ec15
|
data/.gitignore
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.sassc
|
19
|
+
.sass-cache
|
20
|
+
.DS_Store
|
21
|
+
/.bundle
|
22
|
+
/log/*
|
23
|
+
**.log
|
24
|
+
/tmp/*
|
25
|
+
*~
|
26
|
+
/.idea
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Denis Gabdrakhmanov
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# SpreeCheckoutRu
|
2
|
+
|
3
|
+
Checkout.ru integration for Spree Commerce
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'spree_checkout_ru'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
$ run rails g checkout_ru:install
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install spree_checkout_ru
|
19
|
+
$ run rails g checkout_ru:install
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
0. Dependencies jquery autocomplete!
|
24
|
+
1. Подключите checkoutru.js в нужной вам вьюхе
|
25
|
+
2. Добавьте <%= render :partial => 'spree/checkout/checkout_ru'%> на страницу, где хотите выбирать способ доставки
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
1. Fork it
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<input id="checkout_firstname" type="text" autocomplete="off" placeholder="Имя">
|
2
|
+
<input id="checkout_lastname" type="text" autocomplete="off" placeholder="Фамилия">
|
3
|
+
<input id="checkout_phone" type="text" autocomplete="off" placeholder="Телефон">
|
4
|
+
<div class="payment_change">
|
5
|
+
<label><input class="ship_method" type='radio' name='ship_method' value=1>Наличные</label>
|
6
|
+
<label><input class='ship_method' type='radio' name='ship_method' checked='checked' value=0>Предоплата</label>
|
7
|
+
</div>
|
8
|
+
<div class="ui-widget">
|
9
|
+
<input id="checkout_place" type="text" autocomplete="off" placeholder="Населенный пункт">
|
10
|
+
</div>
|
11
|
+
<input id="checkout_save" type="button" value="Сохранить">
|
@@ -0,0 +1,119 @@
|
|
1
|
+
Spree::CheckoutController.class_eval do
|
2
|
+
before_filter :get_ticket
|
3
|
+
|
4
|
+
def get_place_by_query
|
5
|
+
@res = Net::HTTP.get_response(URI('http://platform.checkout.ru/service/checkout/getPlacesByQuery?ticket='+session[:ticket]+'&place='+ params[:query]))
|
6
|
+
respond_to do |format|
|
7
|
+
format.js {render :json => @res.body}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_street_by_query
|
12
|
+
@res = Net::HTTP.get_response(URI('http://platform.checkout.ru/service/checkout/getStreetsByQuery?ticket='+session[:ticket]+'&placeId='+ params[:placeId]+'&street='+ params[:query]))
|
13
|
+
respond_to do |format|
|
14
|
+
format.js {render :json => @res.body}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def calculation
|
19
|
+
@weight = 0
|
20
|
+
@total_sum = current_order.item_total.to_f * params[:ship_method].to_i
|
21
|
+
current_order.line_items.each do |li|
|
22
|
+
@weight += li.variant.weight * li.quantity if li.variant.weight
|
23
|
+
end
|
24
|
+
@res = Net::HTTP.get_response(URI('http://platform.checkout.ru/service/checkout/calculation?ticket='+session[:ticket]+
|
25
|
+
'&placeId='+ params[:query]+
|
26
|
+
'&totalSum='+@total_sum.to_s+
|
27
|
+
'&assessedSum='+current_order.item_total.to_f.to_s+
|
28
|
+
'&totalWeight='+ @weight.to_f.to_s +
|
29
|
+
'&itemsCount='+current_order.item_count.to_s))
|
30
|
+
respond_to do |format|
|
31
|
+
format.js {render :json => @res.body}
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def create_checkout_order
|
37
|
+
items = []
|
38
|
+
current_order.line_items.each do |li|
|
39
|
+
good = {
|
40
|
+
"name" => li.product.name ,
|
41
|
+
"code"=> li.variant.sku,
|
42
|
+
"variantCode"=> li.variant.sku,
|
43
|
+
"quantity"=> li.quantity,
|
44
|
+
"assessedCost"=> li.price.to_f ,
|
45
|
+
"payCost"=> (li.price.to_f * params[:ship_method].to_i),
|
46
|
+
"weight"=> (li.variant.weight ).to_f,
|
47
|
+
}
|
48
|
+
items << good
|
49
|
+
end
|
50
|
+
ship_method = params[:ship_method]=='1' ? 'cash' : 'prepay'
|
51
|
+
if params[:deliveryMethod] == "express"
|
52
|
+
delivery = {
|
53
|
+
"deliveryId"=> params[:deliveryId],
|
54
|
+
"placeFiasId"=>params[:placeId],
|
55
|
+
"addressExpress" => {
|
56
|
+
"postindex" => "",
|
57
|
+
"streetFiasId" => params[:streetId],
|
58
|
+
"house" => params[:house],
|
59
|
+
"housing" => params[:housing],
|
60
|
+
"building" => params[:building],
|
61
|
+
"appartment" => params[:appartment]
|
62
|
+
},
|
63
|
+
"type" => params[:deliveryMethod],
|
64
|
+
"cost"=> params[:cost].to_f,
|
65
|
+
"minTerm" => params[:minTerm].to_i,
|
66
|
+
"maxTerm" => params[:maxTerm].to_i,
|
67
|
+
|
68
|
+
}
|
69
|
+
else
|
70
|
+
delivery = {
|
71
|
+
"deliveryId"=> params[:deliveryId],
|
72
|
+
"placeFiasId"=>params[:placeId],
|
73
|
+
"courierOptions" =>["none"],
|
74
|
+
"addressPvz" => params[:street],
|
75
|
+
"type" => params[:deliveryMethod],
|
76
|
+
"cost"=> params[:cost].to_f,
|
77
|
+
"minTerm" => params[:minTerm].to_i,
|
78
|
+
"maxTerm" => params[:maxTerm].to_i,
|
79
|
+
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
@order_request = {"apiKey" => Spree::Config[:checkout_store_key],
|
84
|
+
"order"=> {
|
85
|
+
"goods" => items,
|
86
|
+
"delivery" => delivery,
|
87
|
+
|
88
|
+
"user"=> {
|
89
|
+
"fullname"=> params[:firstname]+ " " + params[:lastname],
|
90
|
+
"email"=> current_order.user.email,
|
91
|
+
"phone"=> params[:phone]
|
92
|
+
},
|
93
|
+
|
94
|
+
"comment"=>"комментарий к заказу",
|
95
|
+
"shopOrderId"=> current_order.number,
|
96
|
+
"paymentMethod"=> ship_method
|
97
|
+
|
98
|
+
}}
|
99
|
+
json_headers = {"Content-Type" => "application/json",
|
100
|
+
"Accept" => "application/json"}
|
101
|
+
|
102
|
+
uri = URI.parse('http://platform.checkout.ru/service/order/create')
|
103
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
104
|
+
@res = http.post(uri.path, @order_request.to_json, json_headers)
|
105
|
+
respond_to do |format|
|
106
|
+
format.js do
|
107
|
+
render :js => {:body=>@res.body, :code=>@res.code}.to_json
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
private
|
113
|
+
|
114
|
+
def get_ticket
|
115
|
+
params.require(:order_info).permit! if params[:order_info]
|
116
|
+
res = Net::HTTP.get_response(URI('http://platform.checkout.ru/service/login/ticket/'+Spree::Config[:checkout_store_key]))
|
117
|
+
session[:ticket] = (JSON.parse res.body)["ticket"]
|
118
|
+
end
|
119
|
+
end
|
data/lib/checkoutru.js
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
$( document ).ready(function() {
|
2
|
+
$('body').on('keyup', '#checkout_place', function(){
|
3
|
+
delay(function(){
|
4
|
+
if ($('#checkout_place').val().length > 2) {
|
5
|
+
$('.ui-autocomplete').addClass('f-dropdown');
|
6
|
+
get_place_by_query($('#checkout_place').val())
|
7
|
+
}
|
8
|
+
}, 1000 );
|
9
|
+
|
10
|
+
});
|
11
|
+
|
12
|
+
$('body').on('change', '.select_delivery_checkout', function(){
|
13
|
+
var option = $('.delivery_check:checked').siblings('select').find('option:selected')
|
14
|
+
});
|
15
|
+
|
16
|
+
$('body').on('click', '.delivery_check', function(){
|
17
|
+
$(this).siblings().removeClass('hide')
|
18
|
+
$('.delivery_check:unchecked').siblings().addClass('hide')
|
19
|
+
});
|
20
|
+
|
21
|
+
$('body').on('keyup', '#checkout_street', function(){
|
22
|
+
delay(function(){
|
23
|
+
if ($('#checkout_street').val().length > 2) {
|
24
|
+
get_street_by_query($('#checkout_street').val())
|
25
|
+
}
|
26
|
+
}, 1000 );
|
27
|
+
});
|
28
|
+
|
29
|
+
$('body').on('click', '.ship_method', function(){
|
30
|
+
if ($('#checkout_place').attr('placeId')!=undefined){
|
31
|
+
calculation( $('#checkout_place').attr('placeId'))
|
32
|
+
}
|
33
|
+
})
|
34
|
+
$('body').on('click', '#checkout_save', function(){
|
35
|
+
var params = {}
|
36
|
+
params['firstname'] = $('#checkout_firstname').val()
|
37
|
+
params['lastname'] = $('#checkout_lastname').val()
|
38
|
+
params['phone'] = $('#checkout_phone').val()
|
39
|
+
var deliveryMethod = $('input[name=delivery]:checked').val()
|
40
|
+
params['ship_method'] = $('input[name=ship_method]:checked').val()
|
41
|
+
if ($.inArray(deliveryMethod,["pvz", "postamat"]) > -1){
|
42
|
+
var select = $("#select_"+deliveryMethod+"")
|
43
|
+
var option = select.find('option:selected')
|
44
|
+
params["deliveryMethod"] = deliveryMethod
|
45
|
+
params["placeId"] = select.data('place')
|
46
|
+
params["street"] = option.attr('place')
|
47
|
+
params["cost"] = option.attr('cost')
|
48
|
+
params["deliveryId"] = option.val()
|
49
|
+
params["minTerm"] = option.attr('min')
|
50
|
+
params["maxTerm"] = option.attr('max')
|
51
|
+
}
|
52
|
+
else
|
53
|
+
{
|
54
|
+
params["deliveryMethod"] = deliveryMethod
|
55
|
+
params["placeId"] = $('#express').attr('place')
|
56
|
+
params["streetId"] = $('#checkout_street').attr('streetId')
|
57
|
+
params["cost"] = $('#express').attr('cost')
|
58
|
+
params["deliveryId"] = $('#express').attr('delivery')
|
59
|
+
params["minTerm"] = $('#express').attr('min')
|
60
|
+
params["maxTerm"] = $('#express').attr('max')
|
61
|
+
params["house"] = $('#checkout_house').val()
|
62
|
+
params["housing"] = $('#checkout_housing').val()
|
63
|
+
params["building"] = $('#checkout_building').val()
|
64
|
+
params["appartment"] = $('#checkout_appartment').val()
|
65
|
+
}
|
66
|
+
$.ajax({
|
67
|
+
url: '/checkout/create_checkout_order',
|
68
|
+
type: 'POST',
|
69
|
+
data: params
|
70
|
+
}) .always(function( data ) {
|
71
|
+
if (JSON.parse(data.responseText).code != 200) {
|
72
|
+
$('<span class="wait">'+$(JSON.parse(data.responseText).body).find('u').get(0).innerHTML+'</span>').insertBefore('#checkout_save')
|
73
|
+
}
|
74
|
+
else{
|
75
|
+
$('<span class="wait">Заказ успешно создан</span>').insertBefore('#checkout_save')
|
76
|
+
}
|
77
|
+
});
|
78
|
+
return false
|
79
|
+
});
|
80
|
+
});
|
81
|
+
var delay = (function(){
|
82
|
+
var timer = 0;
|
83
|
+
return function(callback, ms){
|
84
|
+
clearTimeout (timer);
|
85
|
+
timer = setTimeout(callback, ms);
|
86
|
+
};
|
87
|
+
})();
|
88
|
+
|
89
|
+
get_place_by_query = function(text){
|
90
|
+
$('<span class="wait">Поиск населенного пункта</span>').insertAfter('#checkout_place')
|
91
|
+
$.ajax({
|
92
|
+
url: '/checkout/get_place_by_query',
|
93
|
+
type: 'POST',
|
94
|
+
data:{
|
95
|
+
query:encodeURIComponent(text)}
|
96
|
+
}) .always(function( data ) {
|
97
|
+
var items = [];
|
98
|
+
var placeIds = [];
|
99
|
+
request = JSON.parse(data.responseText);
|
100
|
+
for (var i in request['suggestions']) {
|
101
|
+
items.push(request['suggestions'][i]["fullName"])
|
102
|
+
placeIds.push(request['suggestions'][i]["id"])
|
103
|
+
}
|
104
|
+
|
105
|
+
$( "#checkout_place" ).autocomplete({
|
106
|
+
source: items,
|
107
|
+
minLength: 0,
|
108
|
+
select: function (item,place) {
|
109
|
+
i = jQuery.inArray(place.item.value , items)
|
110
|
+
var placeId
|
111
|
+
placeId = placeIds[i]
|
112
|
+
console.log(placeId)
|
113
|
+
$('#checkout_place').attr('placeId', placeId)
|
114
|
+
calculation(placeId)
|
115
|
+
}
|
116
|
+
});
|
117
|
+
$('body').on('click', '#checkout_place', function(){
|
118
|
+
$("#checkout_place").autocomplete("search", '');
|
119
|
+
});
|
120
|
+
$("#checkout_place").autocomplete("search", '');
|
121
|
+
$('.wait').remove()
|
122
|
+
});
|
123
|
+
}
|
124
|
+
|
125
|
+
get_street_by_query = function(text){
|
126
|
+
$('<span class="wait">Поиск улиц</span>').insertAfter('#checkout_street')
|
127
|
+
$.ajax({
|
128
|
+
url: '/checkout/get_street_by_query',
|
129
|
+
type: 'POST',
|
130
|
+
data:{
|
131
|
+
query:encodeURIComponent(text),
|
132
|
+
placeId: $('#express').attr('place')
|
133
|
+
}
|
134
|
+
}) .always(function( data ) {
|
135
|
+
var items = [];
|
136
|
+
var placeIds = [];
|
137
|
+
request = JSON.parse(data.responseText);
|
138
|
+
for (var i in request['suggestions']) {
|
139
|
+
items.push(request['suggestions'][i]["type"]+ '.' + request['suggestions'][i]["name"])
|
140
|
+
placeIds.push(request['suggestions'][i]["id"])
|
141
|
+
}
|
142
|
+
$( "#checkout_street" ).autocomplete({
|
143
|
+
source: items,
|
144
|
+
minLength: 0,
|
145
|
+
select: function (item,place) {
|
146
|
+
i = jQuery.inArray(place.item.value , items)
|
147
|
+
var placeId
|
148
|
+
placeId = placeIds[i]
|
149
|
+
$('#checkout_street').attr('streetId', placeId)
|
150
|
+
}
|
151
|
+
});
|
152
|
+
$("#checkout_street").autocomplete("search", '');
|
153
|
+
$('.wait').remove()
|
154
|
+
});
|
155
|
+
}
|
156
|
+
|
157
|
+
calculation = function(text){
|
158
|
+
$('<span class="wait">Расчет стоимости доставки</span>').insertAfter('#checkout_place')
|
159
|
+
var ship_method = $('input[name=ship_method]:checked').val()
|
160
|
+
$.ajax({
|
161
|
+
url: '/checkout/calculation',
|
162
|
+
type: 'POST',
|
163
|
+
data:{
|
164
|
+
query:encodeURIComponent(text),
|
165
|
+
ship_method: ship_method}
|
166
|
+
}) .always(function( data ) {
|
167
|
+
request = JSON.parse(data.responseText);
|
168
|
+
console.log(request)
|
169
|
+
console.log(data)
|
170
|
+
$('.wait').remove()
|
171
|
+
generate_delivery_method(request, text)
|
172
|
+
});
|
173
|
+
|
174
|
+
}
|
175
|
+
|
176
|
+
generate_delivery_method = function(text, placeId){
|
177
|
+
$('#postamat').remove()
|
178
|
+
$('#pvz').remove()
|
179
|
+
$('#express').remove()
|
180
|
+
if (request.postamat) {
|
181
|
+
var s = $("<select id='select_postamat' class='hide select_delivery_checkout' data-place="+placeId+">");
|
182
|
+
for(var val=0; val < request.postamat.addresses.length; val++) {
|
183
|
+
$("<option />", {value: request.postamat.deliveries[val],min: request.postamat.minTerms[val], max: request.postamat.maxTerms[val] ,place: request.postamat.addresses[val], cost: request.postamat.costs[val] , text: request.postamat.addresses[val] + " ("+request.postamat.costs[val]+" руб)"}).appendTo(s);
|
184
|
+
}
|
185
|
+
$( "#checkout_place").parent().append( "<div id = 'postamat'><input type='radio' class='delivery_check' name='delivery' value='postamat'>Постамат<br></div>" );
|
186
|
+
$("#postamat").append(s)
|
187
|
+
}
|
188
|
+
if (request.pvz) {
|
189
|
+
var s = $("<select id='select_pvz' class='hide select_delivery_checkout' data-place="+placeId+">");
|
190
|
+
for(var val=0; val < request.pvz.addresses.length; val++) {
|
191
|
+
$("<option />", {value: request.pvz.deliveries[val],min: request.pvz.minTerms[val], max: request.pvz.maxTerms[val],place: request.pvz.addresses[val], cost: request.pvz.costs[val], text: request.pvz.addresses[val]+ " ("+request.pvz.costs[val]+" руб)"}).appendTo(s);
|
192
|
+
}
|
193
|
+
$( "#checkout_place").parent().append( "<div id = 'pvz'><input type='radio' class='delivery_check' name='delivery' value='pvz'>PVZ<br></div>" );
|
194
|
+
$("#pvz").append(s)
|
195
|
+
}
|
196
|
+
if (request.express) {
|
197
|
+
$( "#checkout_place").parent().append( "<div id = 'express' place="+placeId+" delivery="+request.express.deliveryId+" min="+request.express.minDeliveryTerm+" max="+request.express.maxDeliveryTerm+" cost="+request.express.cost+"><input type='radio' class='delivery_check' name='delivery' value='express'>Курьер<br></div>" );
|
198
|
+
$("#express").append("<div class='ui-widget hide'><input id='checkout_street' type='text' autocomplete='off' placeholder='Улица'><input id='checkout_house' type='text' placeholder='Дом'><input id='checkout_housing' type='text' placeholder='Корпус'><input id='checkout_building' type='text' placeholder='Строение'><input id='checkout_appartment' type='text' placeholder='Квартира/офис'></div>")
|
199
|
+
}
|
200
|
+
if (request.emptyWithLimit){
|
201
|
+
$( "#checkout_place").parent().append( "<div class='wait'> К сожалению, в ваш населенный пункт возможна доставка заказов со стоимостью, не превышающей"+request.emptyWithLimit+"р. Выберите другой способ оплаты. </div>" );
|
202
|
+
}
|
203
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module CheckoutRu
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path("../../..", __FILE__)
|
5
|
+
def copy_files
|
6
|
+
copy_file "checkout_controller_decorator.rb", "app/controllers/spree/checkout_controller_decorator.rb"
|
7
|
+
copy_file "checkoutru.js", "app/assets/javascripts/spree/frontend/checkoutru.js"
|
8
|
+
copy_file "_checkout_ru.html.erb", "app/views/spree/checkout/_checkout_ru.html.erb"
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'spree_checkout_ru/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "spree_checkout_ru"
|
8
|
+
spec.version = SpreeCheckoutRu::VERSION
|
9
|
+
spec.authors = ["GENESIX"]
|
10
|
+
spec.email = ["contact@genesix.ru"]
|
11
|
+
spec.description = %q{Checkout.ru integration for Spree Commerce}
|
12
|
+
spec.summary = %q{Checkout.ru integration for Spree Commerce}
|
13
|
+
spec.homepage = "https://github.com/gsix/spree_checkout_ru"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spree_checkout_ru
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- GENESIX
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Checkout.ru integration for Spree Commerce
|
42
|
+
email:
|
43
|
+
- contact@genesix.ru
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/_checkout_ru.html.erb
|
54
|
+
- lib/checkout_controller_decorator.rb
|
55
|
+
- lib/checkoutru.js
|
56
|
+
- lib/generators/spree_checkout_ru/install_generator.rb
|
57
|
+
- lib/spree_checkout_ru.rb
|
58
|
+
- lib/spree_checkout_ru/version.rb
|
59
|
+
- spree_checkout_ru.gemspec
|
60
|
+
homepage: https://github.com/gsix/spree_checkout_ru
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.1.9
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: Checkout.ru integration for Spree Commerce
|
84
|
+
test_files: []
|