Forum Replies Created
- AuthorPosts
- April 10, 2019 at 7:07 pm in reply to: Select menu condition and restriction + payment gateway #29009
Goran
ParticipantThat was FAST!
I’ve sent you email.
hear you thereRegards
GoranApril 10, 2019 at 2:06 pm in reply to: Select menu condition and restriction + payment gateway #29000Goran
ParticipantHow shall we do this? I need to hire you ASAP since client is sitting on my neck (as they usually do).
Regards
GoranApril 10, 2019 at 11:44 am in reply to: Select menu condition and restriction + payment gateway #28999Goran
ParticipantYes, ofcourse I am willing to pay for your time. Thats no problem.
April 10, 2019 at 9:49 am in reply to: Populate select menu from radio buttons if value = 'Yes' #28989Goran
ParticipantHI, I had similar problem so maybe I can help
can you provide link to your form?
April 9, 2019 at 3:30 pm in reply to: Select menu condition and restriction + payment gateway #28974Goran
ParticipantThanks Ally,
both suggestions work! You are lifesaver!I got gateway to work but the last thing remains – Signature.
I have public key from bank and there is PHP code provided:
1: <html> 2: <head></head> 3: <body> 4: <?php 5: // variables – webshop log keys 6: $MerchantID="1752441"; 7: $TerminalID="E7880241"; 8: session_start(); 9: $OrderID="123456"; // for each transaction ID needs to be unique 10: $CurrencyID="980"; 11: $Amount=100; // fixed amount of transaction 12: 13: $ses = session_id(); 14: 15: //preparing data 16: $PurchaseTime = date("ymdHis"); 17: $data = "$MerchantID;$TerminalID;$PurchaseTime;$OrderID;$CurrencyID;$Amount;$ses;"; 18: //reas RSA key from webshop 19: $fp = fopen("$MerchantID.pem", "r"); 20: $priv_key = fread($fp, 8192); 21: fclose($fp); 22: $pkeyid = openssl_get_privatekey($priv_key); 23: //generating signature 24: openssl_sign($data, $signature, $pkeyid); 25: //delete RSA key from memory 26: openssl_free_key($pkeyid); 27: //Coding value in BASE64 28: $b64sign = base64_encode($signature); 29: ?> 30: <form action="https://secure.rba.hr/ecgtesthr/enter" method="POST"> 31: <input type="hidden" name="Version" value="1" > 32: <input type="hidden" name="MerchantID" value="<?php echo $MerchantID; ?>"> 33: <input type="hidden" name="TerminalID" value="<?php echo $TerminalID; ?>"> 34: <input type="hidden" name="PurchaseTime" value="<? echo $PurchaseTime;?>"> 35: <input type="hidden" name="OrderID" value="<?php echo $OrderID; ?>"> 36: <input type="hidden" name="Currency" value="<?php echo $CurrencyID; ?>"> 37: <input type="hidden" name="TotalAmount" value="<?php echo $Amount; ?>"> 38: <input type="hidden" name="SD" value="<? echo $ses;?>"> 39: <input type="hidden" name="locale" value="hr"> 40: <input type="hidden" name="PurchaseDesc" value="Description"> 41: <input type="hidden" name="Signature" value="<? echo $b64sign; ?>"> 42: <input name="submit" type="submit" value="Confirm order" class="sbmt"> 43: </form> 44: </body> 45: </html>
Is there a way to run php script on submit and insert $b64sign into Signature value in form that you helped me make some time ago:
jQuery(function ($) { $('.quform-form-3').on('quform:successStart', function () { var $form = $(this); var form = document.createElement('form'); form.action = 'https://uat.rba.hr/rba/enter'; form.method = 'post'; var fields = [ { name: 'Version', value: '1' }, { name: 'MerchantID', value: '1832338' }, { name: 'TerminalID', value: '12360951' }, { name: 'TotalAmount', value: $form.find('.quform-field-3_24').val() }, { name: 'Currency', value: '980' }, { name: 'Locale', value: 'en' }, { name: 'OrderID', value: $form.find('.quform-field-3_272').val() }, { name: 'PurchaseTime', value: kendo.toString(new Date(), 'yyMMddHHmmss') }, { name: 'PurchaseDesc', value: 'three islands cruise' }, { name: 'Signature', value: 'baNuGbnzOFh9H6unKTTyJw01ASO7+8Rwgwrm/URuAl1zNtJKJDox88MODpOZyxN5GebOVeyaTro7cgNiTZDEKonCaKkF4BcdQ6C/S2EsXmm0DaEAXZPxOh5b00N/H2hgeYYoLIC/zTpXNk/+cMwU8lLup8/hlTLBkpe/zblOvCY=' } ]; for (var i = 0; i < fields.length; i++) { var input = document.createElement('input'); input.type = 'hidden'; input.name = fields[i].name; input.value = fields[i].value; form.appendChild(input); } document.body.appendChild(form); form.submit(); }); });
April 3, 2019 at 1:12 pm in reply to: Select menu condition and restriction + payment gateway #28946Goran
ParticipantOne last thing
In form form
under book now
i have “departure time” and “return time” as select menu’sclient is asking,
when user chooses “departure time” (lets say 15:00)
to block “return times” (all before 15:00) that are before chosen “departure time”is there an easy way? rather than making hundreds of additional select menus which are conditionally hidden.
Regards,
GoranDUApril 3, 2019 at 1:01 pm in reply to: Select menu condition and restriction + payment gateway #28942Goran
ParticipantHi Ally,
Moving custom message works beautifully!!
THANKS!for the RBA
Finnaly I have code:
<code> jQuery(function ($) { $('.quform-form-3').on('quform:successStart', function () { var $form = $(this); var form = document.createElement('form'); form.action = 'https://uat.rba.hr/rba/enter'; form.method = 'post'; var fields = [ { name: 'Version', value: '1' }, { name: 'MerchantID', value: '12360951' }, { name: 'TerminalID', value: '1832338' }, { name: 'TotalAmount', value: $form.find('.quform-field-3_24').val() }, { name: 'Currency', value: '980' }, { name: 'Locale', value: 'en' }, { name: 'OrderID', value: $form.find('.quform-field-3_272').val() }, { name: 'PurchaseTime', value: kendo.toString(new Date(), 'yyMMddHHmmssZ') }, { name: 'PurchaseDesc', value: 'description' } ]; for (var i = 0; i < fields.length; i++) { var input = document.createElement('input'); input.type = 'hidden'; input.name = fields[i].name; input.value = fields[i].value; form.appendChild(input); } document.body.appendChild(form); form.submit(); }); }); </code>
I am getting error ” wrong values”. Do you think my values are just fine, I mean does it sent as it should with code above.
(I am not allowed to place mID and tID public).
I will check with bank and get back to you.March 25, 2019 at 12:09 pm in reply to: Select menu condition and restriction + payment gateway #28878Goran
ParticipantQUESTION 2
Thanx for explanation!
Sorry, You got 404 because Merchant and Terminal ID are placeholders. Today the owner will send me those details
I’ve added the code
$('.quform-field-3_24').val(totaltic);
the value is sent to bank as calculated on page is in HRK but it needs to be sent multiplied by 100 (if price is 290 sent value should be 29000)
I assume it would be enough to change the code to$('.quform-field-3_24').val(totaltic * 100);
ORDERID
'OrderID', value: 'AAAAA002'
it is order ID.
In documentation I’ve red that Giving each submission a unique reference number is way to go.
Is there a way to create unique ID trough mentioned ref number and send it to gateway as order ID?PURCHASETIME
{ name: 'PurchaseTime', value: '080826093914' },
PurchaseTime = yyMMddHHmmssZ- yy – year
- MM – month
- dd – day
- HH – hour (0-23)
- mm – minute
- ss- seconds
- Z – time zone (RFC)
in example that I’ve sent you time is
<p><input name="PurchaseTime" value="080826093914">
meaning it is yyMMddHHmmss and there is no Z since it is optional.
Is it possible to fill value with “real time” on submit?Mandatory filed to send to gateway are
MerchantId;
TerminalId;
PurchaseTime;
OrderId;
Amount;but my pathetic coding “skills” are enough to alter/remove fields as needed.
March 25, 2019 at 11:15 am in reply to: Select menu condition and restriction + payment gateway #28877Goran
ParticipantHi Ally,
Sorry for the late reply, I was away from project for weekend.QUESTION 1
It works flawlessly, thanks!!!
If I want to show warning under group of meals which is:
<div class="quform-element quform-element-row quform-element-row-3_225 quform-3-columns quform-element-row-size-fixed quform-responsive-columns-phone-landscape">
changing3_20
wont works since it is class and not ID. Is there an easy workaround in code to show it under class rather than ID. If not, dont bother, you did more than any support ever.
p.s. If there is way to tip you for saving me days of headache pls let me know.March 17, 2019 at 8:47 pm in reply to: I would like to control the time with the date in my form #28796Goran
ParticipantYou can do that with conditional logic and hide/show fields
- AuthorPosts