integrate with Ideal pay method

Bob Basli

Avatar: Bob Basli

2008-10-02 12:37

Als er meer bekend is over de iDeal voor 3.x houd ik me ook aanbevolen!!

DaanVT

No avatar

2008-10-18 01:28

iemand nieuws?

dstar

Avatar: dstar

2008-11-07 11:59

Hallo iedereen, hello everybody!

NL: Ik lees op dit forum dat er veel mensen op zoek zijn naar een tutorial voor de de installatie van Ideal in de webshop van Quick.Cart v 3. Ikzelf was hier ook naar opzoek, maar kon alleen een tutje vinden van een oudere versie van Quick.Cart. Daarom ben ikzelf aan het rommelen geslagen en heb deze Quick & Dirty manier gevonden om Ideal te installeren in Quick.Cart v 3. Ik hoop dat dit hetgeen is waar jullie naar opzoek zijn, in mijn geval werkt het in ieder geval prima.

EN: I read on this forum that some of you are looking for a step-by-step tutorial for installation of Ideal in Quick.Cart version 3. I too was looking for one, but could only find a tutorial for older versions of Quick.Cart. Therefor I created my own Quick and Dirty technique to install ideal in Quick.Cart v 3. I hope this is what you all are looking for, in my case it works just fine!

/******************INSTALL IDEAL IN QUICK.CART v 3*************************/

There are only 3 files that need to be updated:

1) config/general.php
2) templates/orders_print.tpl
3) templates/payment.tpl

Also you need to make some modifications using your admin panel.

/******************STEP 1*************************/

Open: config/general.php and go to $aOuterPaymentOption (around line 143)

There you will see an array. Please add all your additional payment methods there. This is important because you will need to select a payment option in your admin later on. Note that I have included more payment options like Direct overschijven and Onder remnbours (this is Dutch only!)

$aOuterPaymentOption = Array( 1 => 'DotPay', 2 => 'Przelewy24', 3 => 'PayPal', 4 => 'Platnosci.pl', 5 => 'IDEAL', 6 => 'Direct overschrijven', 7 => 'Onder rembours' );

/******************STEP 2*************************/

Open: templates/orders_print.tpl and find $sPaymentDescription

This is just cosmetics! I wanted the Ideal pay button to appear below the personal data screen and the order details screen. So I moved $sPaymentDescription to line 32. The code looks something like this.

</dl>
<h4>$lang[Ordered_products]</h4>

$sOrderProducts

<script type="text/javascript">
<!--
AddOnload( delSavedUserData );
//-->
</script>
</div>
<div id="clear"><br/><br/></div>
$sPaymentDescription
<!-- END ORDER_PRINT -->

<!-- BEGIN ORDER_PRINT_PAYMENT -->
<div id="paymentDescription">
$aPayment[sDescription]
$sPaymentOuter
</div>
<!-- END ORDER_PRINT_PAYMENT -->

Remember that you can leave the page setup as it is. This won't effect the implementation of Ideal.

/******************STEP 3*************************/

Open: templates/payment.tpl and look at the forms displayed there. This are the forms for different paytment options. They are also numbered corresponding to the array we saw in the config/general.php file. We need to creat e our own. Right after form 4, after <!-- END PAYMENT_FORM_4 -->, you start with this code.

<!-- BEGIN PAYMENT_FORM_5 -->

<!-- CODE_START -->

<script type="text/javascript">
<!-- Begin

var Amount = "$aData[sOrderSummary]";
var PSPID = "IDEALIDEAL";
var AM;

if (isNaN(Amount))
{
alert("Amount not a number: " + Amount + " !");
AM = ""
}
else
{
AM = Math.round(parseFloat(Amount)*100);
}

var orderID = "1";
mydate = new Date();
tv = mydate.getYear() % 10;
orderID = orderID + tv;
tv = (mydate.getMonth() * 31) + mydate.getDate();
orderID = orderID + ((tv < 10) ? '0' : '') + ((tv < 100) ? '0' : '') + tv;
tv = (mydate.getHours() * 3600) + (mydate.getMinutes() * 60) + mydate.getSeconds();
orderID = orderID + ((tv < 10) ? '0' : '') + ((tv < 100) ? '0' : '') + ((tv < 1000) ? '0' : '') + ((tv < 10000) ? '0' : '') + tv;
tvplus = Math.round(Math.random() * 9);
// End -->
</script>
<style type="text/css">
label {width: 120px; text-align: left;}
button.iDEALeasy {background-color: #FFFFFF;}
</style>



<form method="post" action="https://internetkassa.abnamro.nl/ncol/prod/orderstandard.asp" id="formPayment" name="form1">
<script type="text/javascript">
document.write("<input type=\"hidden\" NAME=\"PSPID\" value=\"" + PSPID + "\" />");
document.write("<input type=\"hidden\" NAME=\"orderID\" value=\"" + (orderID + ((tvplus + 1) % 10)) + "\" />");
document.write("<input type=\"hidden\" NAME=\"amount\" value=\"" + AM + "\" />");
</script>

<input type="hidden" name="currency" value="EUR" />
<input type="hidden" name="language" value="NL_NL" />
<input type="hidden" name="PM" value="iDEAL" />
<button class="iDEALeasy" type="submit" name="submit1" value="submit">
Klik hier om te betalen met<br />
<img src="https://internetkassa.abnamro.nl/images/iDEAL_easy.gif" alt="iDEAL" />
</button>
</form>
<!-- CODE_END -->

<!-- END PAYMENT_FORM_5 -->

Note that this is the easy Ideal setup. Also note that the amount is determined by $aData[sOrderSummary]. Remember to fill in the correct PSPID. Last but not least, it's important to give the form the id="formPayment". There will be some javascript redirect taking place and this wil only happen if you give the form the right id name!

TIP: if you don't want to show the Ideal icon, you can leave out the image+string:
Klik hier om te betalen met<br />
<img src="https://internetkassa.abnamro.nl/images/iDEAL_easy.gif" alt="iDEAL" />
Like said before there is a also a javascript re-direct taking place when you give the Ideal form id="formPayment".

/******************STEP 4*************************/

Go to your admin panel. Go to orders, new payment. Name your product "Ideal" and important, relate this option with "Ideal". This is the additional option we've created by adjusting the array!

In payment description please fill in some text. E.g. "You are about to pay with Ideal, please press Ideal Icon or wait for redirect". If you don't want any text, please fill in empty symbol: (&nbsp;), because I am not sure if all works when description field in empty. Also my ideal is connected thru a carrier. So one again, I am not sure if everything works when carrier is empty.

Please save your settings and start ordering a product thru the front-end of the website. Please note that in the personal data screen, you see payment option: Ideal. This will be reflected everywhere in the system, so also in the admin, automatic emails, etc. Below all details, you will see the Ideal icon. If you wait a few seconds you will be automaticly re-directed to the bankpage for payment. Enjoy!

Cheers :-)
DT

**Do note that this tutorial does not give any guarantees and using it will be at your own risk!
** Feel free to adjust, modify this tutorial for better results. Do share this with other users.

DT

Miano

No avatar

2008-11-13 08:19

what changes are required to be done in QC v3.2 to implement iDEAL payment? QC v1.2 it works fine but I am getting confused in QC v3.2 code. Please give me the solution.

Thanks

Maximiano fernandes

dstar

Avatar: dstar

2008-11-17 22:00

Hi Miano,

The above described tutorial was implemented in QuickCart 3.1. I am not sure how the updated QC 3.2 looks like, but the differences can't be that big. It should work for your version aswell.

Rg.
DT

DT

wxa

No avatar

2009-02-01 12:10

Hello, i am trying to integrate rabobank ideal lite using the description above.
I think i am doing something wrong or missing something.

When i check out i get the message that there are several fields not passed through like value, price etc.

Is there anyone how could help me with this please ?

crisligthart

Avatar: crisligthart

2009-04-24 14:58

same problem here!

dstar

Avatar: dstar

2009-05-07 18:56

Dear WXA and Crislighthart,

I am currently implementing Ideal lite from the Rabobank aswell for a webshop. I also have huge problems getting it to work. Above tutorial is for ANB'ns Ideal only. Rabobank has a different approach. It is relying on Hash value. Here is the code I have so far, maybe this helps you in the right direction:



<script type="text/javascript">
<!-- Begin

var Amount = "$aData[sOrderSummary]";
var Itemprice = "$aData[sPrice]";
var key = "----Put your key provided by your dashboard here---"
var subID = "0";
var paymentType = "ideal";
var merchantID = "----Put your merchantID provided by your dashboard here---";

//We now set the total amount to cents. This is done by multiplying the amout by *100

var AM;

if (isNaN(Amount))
{
alert("Amount not a number: " + Amount + " !");
AM = ""
}
else
{
AM = Math.round(parseFloat(Amount)*100);
}

//We now set the item price to cents. This is done by multiplying the amout by *100

var IP;

if (isNaN(Itemprice))
{
alert("Amount not a number: " + Itemprice + " !");
IP = ""
}
else
{
IP = Math.round(parseFloat(Itemprice)*100);
}

var purchaseID = "$aOrder[iOrder]";

//This is the part where things get messy. Trying to recreate the Hashkey by putting different values in a string. Mind you this is not the correct approach. If some one has an idea how to go about this, please let me know.

var shastring = key + merchantID + subID + AM + purchaseID + paymentType + "2009-05-07T17:00:00.SSSZ" + purchaseID + "Testproduct" + "1" + "100";

</script>

<br/>
<br/>
<!-- NOW WE PASS ALL VALUES THRU THE FORM -->

<FORM METHOD="POST" ACTION="https://idealtest.rabobank.nl/ideal/mpiPayInitRabo.do" id="form1" name="form1">

<script type="text/javascript">
//document.write("<input type=\"hidden\" NAME=\"acceptantID\" value=\"" + acceptantID + "\" />");
document.write("<input type=\"hidden\" NAME=\"merchantID\" value=\"" + merchantID + "\" />");
document.write("<input type=\"hidden\" NAME=\"subID\" value=\"" + subID + "\" />");
document.write("<input type=\"hidden\" NAME=\"amount\" value=\"" + AM + "\" />");
document.write("<input type=\"hidden\" NAME=\"purchaseID\" value=\"" + purchaseID + "\" />");
</script>
<INPUT type="hidden" NAME="language" VALUE="nl">
<INPUT type="hidden" NAME="currency" VALUE="EUR">
<INPUT type="hidden" NAME="description" VALUE="$aData[sName]">

<script type="text/javascript">
document.write("<input type=\"hidden\" NAME=\"hash\" value=\"" + shastring + "\" />");
document.write("<input type=\"hidden\" NAME=\"itemPrice1\" value=\"" + IP + "\" />");
document.write("<input type=\"hidden\" NAME=\"paymentType\" value=\"" + paymentType + "\" />");
//document.write("<input type=\"hidden\" NAME=\"validUntil\" value=\"" + date + "\" />");
</script>

<INPUT type="hidden" NAME="validUntil" VALUE="2007-01-01T12:00:00.SSSZ">
<INPUT type="hidden" NAME="itemNumber1" VALUE="$aData[iQuantity]">
<INPUT type="hidden" NAME="itemDescription1" VALUE="$aData[sName]">
<INPUT type="hidden" NAME="itemQuantity1" VALUE="$aData[iQuantity]">

<INPUT type="hidden" NAME="urlCancel" VALUE="?cancel,176">
<INPUT type="hidden" NAME="urlSuccess" VALUE="?succes,177">
<INPUT type="hidden" NAME="urlError" VALUE="?error,178">

<button class="iDEALeasy" type="submit" name="submit1" value="submit" style="text-align:center;">
Klik hier om te betalen met<br />
<input type="image" src="https://internetkassa.abnamro.nl/images/iDEAL_easy.gif" value="Bevestig bestelling" id="submit2" name="submit2">
</button>
</form>

All is good, except the HashKey. I am looking for a way to make this happen using javascript. But i am not that good with Javascript and constructing a hashkey is also new to me. If anybody has an idea(l):-) how to go about this please let me know....

DTE

compie

Avatar: compie

2009-09-13 21:06

is dit een optie?

http://www.mollie.nl/geavanceerd/ideal/

er zit een php script bij
ideal-php5-v1.03 met een viertal bestanden, heb zelf even lopen klooien met includen maar dit werkte niet

mollie rekent 0,99 per transactie en heeft alle banken in huis.

alleen coderen daar ben ik geen ster in, maar dit lijkt me een perfecte optie

deus187

No avatar

2009-10-18 02:23

ik heb een aantal van de mogelijkheden die in deze post staan aan de praat gekregen maar ik ben op zoek achter iDeal van de ING. Als iemand deze kan integreren in een QC v3 , ben bereid voor de geleverde arbeid éénmalig een bedrag te betalen.

Mocht er nog niemand zijn, je kan wel het script uit mollie trekken maar als het beste idee hak & plak werk zal worden, ga dan naar de beste bron (behalve de banken zelf, die werken toch niet mee) en dat is naar mijn weten http://www.ideal-simulator.nl/ bijna alle soorten ideal aansluitingen zijn er vermeld en de code en een test server, wordt je in hapklare brokken aangereikt.

Voor alle andere oplossingen verzoek ik ook iedereen contact op te nemen.

remoteuser.logmein@gmail.com

ronin75

No avatar

2009-10-19 15:07

hey dstar thank you for your tutorial, i have followed it and found it to be a great help. however, i am using a South African gateway called paygate and i have changed some of the values in your tutorial. once i checkout, i get an error called: 'No sBlock: PAYMENT_FORM_5 in file: templates/payment.tpl ', and it does not redirect to the gateway. could you please shed some light on this....

jans

Avatar: jans

2010-07-28 10:53

Have someone ideal integrade in QC 3.5 version,?

Trouwen

Avatar: Trouwen

2010-11-28 12:52

Weet iemand hoe ik Ideal kan implementeren in de laatste versie van Quick Cart???

Jaap

beholder

Avatar: beholder

2011-03-22 03:08

I've just made full integration of Rabo iDEAL Lite into Quick Cart, if anyone is interested, I can give pointers. It's just difficult to comment on the code posted above since I don't have time to analyze it.

http://www.cicmanec.sk/easyplugins/

Silencer116

Avatar: Silencer116

2011-06-23 10:27

Beholder, I'm interested, could you tell me what I need to do to integrate iDeal in the latest version of Quick cart? v.4.1 ?

I noticed differences when trying to integrate as dstars tutorial.

beholder

Avatar: beholder

2011-06-24 03:26

is it QC 4.1 free or EXT? because if you have EXT, I have no problem sharing this because you have a lot of good code in place.
But if you have only free QC, there would be too much code and it would be a complete mess here to post the code.

If you just need quick pointers, then here they are:
1. you need to make hash creating function which concatenates all the required strings from the order and encodes them
2. you need to prepare a special products list of inputs which will be later added to the submit form for the gateway. There is a small problem to be dealt with in products listing that is in iDeal form, because the order summary must be equal to the sum of all product prices listed in the form that is submitted. So the payment+shipping price must be taken as a product which will be listed among normal products and then the sum of the product prices will be equal to order summary. The implementation notes are not very clear about this, I had to find out by trial-and-error. Hope it helps you.
3. you need to prepare the return URLs for the customers who return back to shop from gateway
3. you need to prepare the form that submits the order to the payment gateway with fields the gateway requires, this form includes the three things from above
4. you need to have a test account and do the 7 special tests
5. you need to switch the test account for normal account. Done.

This is just about what I remember, I don't even have the code now as only my NL customer has it. As you can see this is no trivial implementation and you should not do this by yourself; I've implemented multiple gateways and should not have any problems with it.

P.S.: I've found this overkill-of-implementation ( http://www.ideal-checkout.nl/ideal-voor-quickcart.html ), it's got all possible iDeal bank gates in there but it's just too much, they have even their own classes and shit. And the implementation hacks the QC code very badly while also relying on MySql? WTF? I added just a few template blocks, modified some code, edited one function and added another one. Very clean-cut, very nice.

http://cicmanec.sk/easyplugins/

jans

Avatar: jans

2011-06-24 07:34

Hello,

I have integrate iDeal in QC 1.4, but i will it olso in QC 3.6 and QC 4.0
But there is in QC 3.6 and 4.0 in actions_client no orders.php where set the code for the


#################################
STEP 2: actions_client/orders.php
#################################

$aData = throwOrder( $iOrder );
$sBasketList = listBasket( $iOrder, 'orders_summary.tpl' );
if( !empty( $sBasketList ) ){
$aData['fSummary'] = tPrice( $aData['fCourierPrice'] + $aList['fSummary'] );
//--------- Start ideal code
$aData['fSummaryideal'] = ereg_replace( '\.', '', $aData['fSummary'] );
//--------- End ideal code
$aData['sSummary'] = changePriceFormat( $aData['fSummary'] );
$sBasketList .= $tpl->tbHtml( 'orders_summary.tpl', 'COURIER' );
}
//--------- Start ideal code
$content .= $tpl->tbHtml( 'messages.tpl', 'ORDER_IDEAL' );
//--------- End ideal code
$content .= $tpl->tbHtml( 'orders_summary.tpl', 'SHOW' );
unset( $_SESSION['iOrderSession_'.LANGUAGE] );

Greet

Silencer116

Avatar: Silencer116

2011-06-24 10:07

Actually, I do have the free version. I try to understand your explanation. What do you suggest I should do?

beholder

Avatar: beholder

2011-06-24 13:30

Hmm.. you better contact OpenSolution or me for paid assistance. In case you contact them, they'll offer you a very good EXT version, possibly with your gateway already integrated, but it actually depends on the deal you make with them, make sure you ask specifically for iDeal.
If you contact me, I can only offer one modification: just so that iDeal works on your QC Free.

http://cicmanec.sk/easyplugins/

beholder

Avatar: beholder

2011-06-24 13:32

Jans: that code is outdated, please don't use it for QC 3.x or 4.x. I know this is bad news, sorry for being bad messenger.
If you understand PHP, use my guide to implement the gateway or ask for paid assistance.

http://cicmanec.sk/easyplugins/

Back to top
about us | contact