4
5
6
7
8
9
10
11
12
13
14
|
# File 'app/controllers/spree/alipay_controller.rb', line 4
def partner_trade
logger.debug "go to alipayment #{params.to_yaml}"
order = current_order || raise(ActiveRecord::RecordNotFound)
order.line_items.each do |item|
@product_name=item.variant.product.name
end
payment = Spree::Payment.create({:order_id => order.id, :amount => order.amount, :payment_method_id=> payment_method.id})
payment.started_processing!
partner_trade = payment_method.set_partner_trade( payment.number, order, spree.order_url(order) , notify_alipay_url, {:subject=> "#{current_store.name} #{@product_name} #{order.number}"})
redirect_to partner_trade
end
|