Created
August 26, 2014 14:22
-
-
Save xrimpy/8356eeb1c14d836cad71 to your computer and use it in GitHub Desktop.
CitrusPay - SSL Form Integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
@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