Skip to content

Instantly share code, notes, and snippets.

@esmerino
Created June 16, 2014 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esmerino/c651eca5364486555d94 to your computer and use it in GitHub Desktop.
Save esmerino/c651eca5364486555d94 to your computer and use it in GitHub Desktop.
ActionView::Template::Error (undefined method `cost' for nil:NilClass):
1: <%= payment_service_for(
2: Time.now.strftime('%Y%m%d%H%M-') + current_user.id.to_s + '-' + @product.id.to_s,
3: Rails.configuration.payfast_merchant_id,
4: :amount => @product.selling_price.to_f + @product.ship_methods.last.cost.to_f,
5: :service => :pay_fast,
6: :credential2 => Rails.configuration.payfast_merchant_key,
7: :html => { :id => 'payment_form' } ) do |service| %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment