Skip to content

Instantly share code, notes, and snippets.

@aquajach
Created September 18, 2010 16:01
Show Gist options
  • Save aquajach/585787 to your computer and use it in GitHub Desktop.
Save aquajach/585787 to your computer and use it in GitHub Desktop.
#Encrypt the transaction information
cert_id =YAML.load(File.open("#{RAILS_ROOT}/config/paypal.yml"))[ENV["RAILS_ENV"]]['paypal']['cert_id']
paypal_params = {:cert_id=>cert_id}
service.form_fields.collect do |field, value|
paypal_params.merge!({field=>value})
end
result << hidden_field_tag(:cmd, "_s-xclick")
result << "\n"
result << hidden_field_tag(:encrypted, encrypt_for_paypal(paypal_params))
# result << service.form_fields.collect do |field, value|
# hidden_field_tag(field, encrypt_for_paypal(encrypted_value))
# end.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment