Set flash[:commerce_tracking] on success, and string HTML tags from product name and description sent to PayPal. [Fixes #85 #76]
This commit is contained in:
parent
4725846db0
commit
50684bbb1d
|
@ -173,8 +173,8 @@ module Spree
|
||||||
|
|
||||||
@order.finalize!
|
@order.finalize!
|
||||||
flash[:notice] = I18n.t(:order_processed_successfully)
|
flash[:notice] = I18n.t(:order_processed_successfully)
|
||||||
|
flash[:commerce_tracking] = "true"
|
||||||
redirect_to completion_route
|
redirect_to completion_route
|
||||||
|
|
||||||
else
|
else
|
||||||
payment.failure!
|
payment.failure!
|
||||||
order_params = {}
|
order_params = {}
|
||||||
|
@ -269,8 +269,8 @@ module Spree
|
||||||
def order_opts(order, payment_method_id, stage)
|
def order_opts(order, payment_method_id, stage)
|
||||||
items = order.line_items.map do |item|
|
items = order.line_items.map do |item|
|
||||||
price = (item.price * 100).to_i # convert for gateway
|
price = (item.price * 100).to_i # convert for gateway
|
||||||
{ :name => item.variant.product.name,
|
{ :name => item.variant.product.name.gsub(/<\/?[^>]*>/, ""),
|
||||||
:description => (item.variant.product.description[0..120] if item.variant.product.description),
|
:description => (item.variant.product.description[0..120].gsub(/<\/?[^>]*>/, "") if item.variant.product.description),
|
||||||
:number => item.variant.sku,
|
:number => item.variant.sku,
|
||||||
:quantity => item.quantity,
|
:quantity => item.quantity,
|
||||||
:amount => price,
|
:amount => price,
|
||||||
|
|
Loading…
Reference in New Issue