class Stall::Payments::ManualPaymentGateway::Response
Public Instance Methods
cart()
click to toggle source
# File lib/stall/payments/manual_payment_gateway.rb, line 76 def cart @cart ||= ProductList.find_by_token(request.params[:cart][:token]) end
cart_params()
click to toggle source
# File lib/stall/payments/manual_payment_gateway.rb, line 80 def cart_params @cart_params ||= request.params[:cart] end
rendering_options()
click to toggle source
# File lib/stall/payments/manual_payment_gateway.rb, line 48 def rendering_options redirect_location = Stall::Payments::UrlsConfig.new(cart).payment_success_return_url { redirect_location: redirect_location } end
success?()
click to toggle source
# File lib/stall/payments/manual_payment_gateway.rb, line 55 def success? true end
valid?()
click to toggle source
To allow manual payment method we verify that the provided checksum corresponds to the one we can calculate with the provided params in the form.
This avoids forging a request with `manual_payment` in the URL for a cart which was not set to use this method, thus allowing people to validate orders without paying them.
# File lib/stall/payments/manual_payment_gateway.rb, line 67 def valid? calculated_checksum = calculate_checksum_for( cart_params[:token], cart_params[:reference], cart_params[:timestamp] ) provided_checksum = cart_params[:checksum] calculated_checksum == provided_checksum end