Skip to content

Instantly share code, notes, and snippets.

@xrimpy
Created August 26, 2014 14:22
Show Gist options
  • Save xrimpy/8356eeb1c14d836cad71 to your computer and use it in GitHub Desktop.
Save xrimpy/8356eeb1c14d836cad71 to your computer and use it in GitHub Desktop.
CitrusPay - SSL Form Integration
<%
@vanityUrl = "quickcompany";
@currency = "INR";
@merchantTxnId = @cart.id.to_s
@orderAmount = "1231";
@apikey = ENV["CITRUS_APIKEY"]
@returnURL = "http://www.quickcompany.in/orders/" + @merchantTxnId
@data = @vanityUrl + @orderAmount + @merchantTxnId + @currency
@signature = Digest::HMAC.hexdigest(@data, @apikey, Digest::SHA1)
%>
<form method="post" action="https://sandbox.citruspay.com/<%= @vanityUrl %>">
<%= hidden_field_tag :merchantTxnId, @merchantTxnId %>
<%= hidden_field_tag :orderAmount , @orderAmount %>
<%= hidden_field_tag :secSignature, @signature %>
<%= hidden_field_tag :merchantTxnId, @merchantTxnId %>
<%= hidden_field_tag :returnUrl, @returnURL %>
<button type="submit">Proceed to Payment </button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment