Select menu condition and restriction + payment gateway

Home Forums Quform WordPress Select menu condition and restriction + payment gateway

This topic is: not resolved

This topic contains 17 replies, has 2 voices, and was last updated by  Goran 1 week, 3 days ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #28847

    Goran
    Participant

    Hi,

    I have 2 questions/problems and it is pretty urgent.

    on web page when you click BOOK NOW there is a Quform 2.

    QUESTION 1
    —————
    Select date is revealed. When you select any date, other fields are revealed.
    when you select number of ADULTS/CHILDREN/CHILDREN up to 5 years
    and then any DEPARTURE POINT
    NUMBER OF MEALS are revealed.

    I need to resctrict number of meals chosen by number of passengers:

    Example:
    2 Adults and 3 Children(5-12y) and 1 Children (up to 5 years) are chosen… that is 6 passengers total
    I need to restrict user to pick 6 meals total from 3 select menus (lets say 3 Chicken, 2 fish and 1 vegetarian)

    Is that possible?

    QUESTION 2
    —————

    Also I need to send some info for gateway payment for Raiffeisen bank and they will return some “response”

    this is what they sent me as example to send them::

    <code>
    1:	<form name="ordersend" action="https://secure.rba.hr/ecgtesthr/enter" method="post"   >
    2:	        <p><input name="Version" value="1" >
    3:	        <p><input name="MerchantID" value="1752081"  >
    4:	        <p><input name="TerminalID" value="E7879881"  >
    5:	        <p><INPUT name="TotalAmount" value="10000">
    6:	        <p><INPUT name="Currency" value="980" >
    7:	        <p><INPUT name="Locale" value="en">
    8:	        <p><input name="SD" value="7248667" >
    9:	        <p><input name="OrderID" value="AAAAA002"  >
    10:	      <p><input name="PurchaseTime" value="080826093914">  
    11:	      <p><input name="PurchaseDesc" value="description" >
    12:	      <p><input name="Signature" value="baNuGbnzOFh9H6unKTTyJw01ASO7+8Rwgwrm/URuAl1zNtJKJDox88MODpOZyxN5GebOVeyaTro7cgNiTZDEKonCaKkF4BcdQ6C/S2EsXmm0DaEAXZPxOh5b00N/H2hgeYYoLIC/zTpXNk/+cMwU8lLup8/hlTLBkpe/zblOvCY=" >
    13:	      <p><input type="submit" value="submit" name="submit" />
    14:	</form>
    

    and they will return

    1: <FORM action="http://shop.mojastranica.com/checkout_finish.php" method ="POST" name="back">
    2: <p><input name="Version" value="1" >
    3: <p><input name="MerchantID" value="1752081" >
    4: <p><input name="TerminalID" value="E7879881" >
    5: <p><INPUT name="TotalAmount" value="10000">
    6: <p><INPUT name="Currency" value="980" >
    7: <p><INPUT name="Locale" value="en">
    8: <p><input name="SD" value="7248667" >
    9: <p><input name="OrderID" value="AAAAA002" >
    10: <p><input name="PurchaseTime" value="080826093914">
    11: <p><input name="PurchaseDesc" value="description" >
    12: <p><input name="Signature" value="NfROZLDTkznm3NAHGgm6MaO8EX8DGIFZ0rLDntyzOXFQ2q8X9igCzJalfkA2IqcOLlk3Da9j6Nz2uyig4/8VFR23iBtQe084alJKc4mmoTGBYbfAYWsob7rKe/q+ULRKUERdRbylDGJP6cqvYzQ90BO9qIDRjSks3UzFpTdzsc0=" >
    13: </FORM>
    14: <noscript>
    15: <h1>Returing processing results</h1>
    16: <h2>Your browser dosen't support JavaScript or JavaScript is disabled</h2>
    17: <h3>Click "Submit" to continue with transaction !</h3>
    18: <input type="Submit">
    19: </FORM>
    20: <script language="javascript">
    21: <!--
    document.back.submit();
    22: --></script>

    I’ve been struggling with this form for over a month so any help would be appreciated.

    • This topic was modified 1 month ago by  Goran.
    • This topic was modified 1 month ago by  Goran. Reason: adding code tags
    • This topic was modified 1 month ago by  Goran.
    #28866

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28867

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28877

    Goran
    Participant

    Hi 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">

    changing 3_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.

    #28878

    Goran
    Participant

    QUESTION 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.

    • This reply was modified 3 weeks, 6 days ago by  Goran.
    • This reply was modified 3 weeks, 6 days ago by  Goran.
    #28886

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28899

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    • This reply was modified 3 weeks, 2 days ago by  Ally.
    #28942

    Goran
    Participant

    Hi 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.

    • This reply was modified 2 weeks, 4 days ago by  Goran.
    • This reply was modified 2 weeks, 4 days ago by  Goran.
    #28946

    Goran
    Participant

    One last thing

    In form form
    under book now
    i have “departure time” and “return time” as select menu’s

    client 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,
    GoranDU

    #28955

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28957

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28974

    Goran
    Participant

    Thanks 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();
        });
    });
    
    • This reply was modified 1 week, 4 days ago by  Goran.
    • This reply was modified 1 week, 4 days ago by  Goran.
    #28996

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28999

    Goran
    Participant

    Yes, ofcourse I am willing to pay for your time. Thats no problem.

    #29000

    Goran
    Participant

    How shall we do this? I need to hire you ASAP since client is sitting on my neck (as they usually do).
    Regards
    Goran

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.

Be inspired. © 2018 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy