iDEAL, making it work

Hello there,

I have been working on getting iDEAL to work on my website for days now. :slight_smile:
Started off with Mollie, but decided later to go with ING.

I have tested several banks, but every option I've tried gets redirected to https://www.ideal-simulator.nl/lite.

So I'm thinking maybe the problem can be found in the following code (from the ideal.php file)

//setup bank specific urls
$test = ($settings['gateways']['ideal']['mode'] == 'test');
if ($settings['gateways']['ideal']['mode'] == 'ing')
$redirectURL = 'https://ideal' . ($test ? 'test' : '') . '.secure-ing.com/ideal/mpiPayInitIng.do?';
else if ($settings['gateways']['ideal']['mode'] == 'rabo')
$redirectURL = 'https://ideal' . ($test ? 'test' : '') . '.rabobank.nl/ideal/mpiPayInitRabo.do?';
else if ($settings['gateways']['ideal']['mode'] == 'fries')
$redirectURL = 'https://' . ($test ? 'test' : '') . 'idealkassa.frieslandbank.nl/ideal/mpiPayInitFriesland.do?';
else if ($settings['gateways']['ideal']['mode'] == 'abn')
$redirectURL = 'https://abnamro' . ($test ? '-test' : '') . '.ideal-payment.de/ideal/mpiPayInitFortis.do?';
else
$redirectURL = 'https://www.ideal-simulator.nl/lite/?';

Since none of the URLs work and they all rederict to the ideal-simulator website (It gives an error saying the Merchant ID is incorrect), I feel like there might be an error in the code here....
I'm sort of new with this. I have built a website using MarketPress light before. But the PhP thing is beyond my knowledge.

I'm really hoping to get this to work because my website depends on payment via iDEAL.

I've read before that the person who built this payment gateway doesn't have any possibility for testing it. If needed I'm willing to test any new ideas coming up.

Kind regards,
Jolanda

  • aecnu
    • WP Unicorn

    Greetings Jolanda,

    Thank you for letting me know it is greatly appreciated.

    I am not a coder myself and do not see anything unusual in the code you submitting, but of course that is coming from an untrained eye for php.

    Therefore I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Jolandak
    • Site Builder, Child of Zeus

    Hi Aaron,

    Thanks for that!
    I have actually seen several posts about this subject. Even one about building one of their own. Seems that they might have given up!
    Anyway, I can't imagine anyone from Holland building a webshop targeted on customers in Holland without offering iDEAL. It's the most used payment method online in Holland.

    Do you have any idea how long it's going to take before this update is here? As I said before, I need it to work before my site goes live, because it depends on it.

    Greetings Jolanda

  • Jolandak
    • Site Builder, Child of Zeus

    One more thing:
    I'm thinking about adding Mollie. During the process of the last days I have already done it, but when it didn't work I decided to switch to ING.

    But if this new version works I can probably get it to work with Mollie as well... Mollie is cheaper for small webshops.

    If it works, can you include my changes in the next update?

    (That is IF it works :slight_smile: I might be a little too enthousiastic)

    Best regards!

  • Jolandak
    • Site Builder, Child of Zeus

    Happy to let you know it's working!! (ING)

    There is one thing: I needed to test it by sending several test payments to my bank. First € 1,00, then € 2,00, € 3,00 etc. As it turns out, it doesn't work properly when using TAX. I kept gettng an error: * "Totaalbedrag niet juist" (Total amount incorrect). I'm guessing (and read somewhere) that this could have to do with the way the total amount is calculated in the file. When using discounts, or in this case TAX, it's possible to get a difference in the total amount.
    So I set TAX to 0% and it did the trick.

    I'll keep you updated!

  • Jolandak
    • Site Builder, Child of Zeus

    I'm going through the documentation right now, but haven't found it yet. It surely isn't anywhere in the FAQ.

    I do have a guide (from ING) which contains an example php file (like our ideal.php). I've noticed that it is in some parts different from our file. If you want I can send it to you.

    This might be a very stupid question, but I'm not sure how it works:
    does the php recalculate the total amount? So the total amount shown in your cart needs to be exactly te same as the amount calculated in the file? I've read somewhere that in Europe numbers get calculated with 2 decimals, while the Americans use 1 decimal. This could explain the error?

  • Jolandak
    • Site Builder, Child of Zeus

    Hi there!

    I couldn't fnd any information about discounts.
    So I've been testing it in my shop.
    The only way iDEAL payment works is if I don't use TAX and also I can't use discounts.
    If I add either one I get "Total amount incorrect" error.

    Any ideas?

    Kind regards Jolanda

    Ps: Can I put my responses here or do I need to create a new topic??

  • Jolandak
    • Site Builder, Child of Zeus

    Goodmorning!!

    Getting a new error message:
    "A technical error occurred. Produkt nummer1 is verplicht."
    (Product nr 1 is required)

    I'm hoping to be able to send you an e-mail because the possible solution I have is posted on a different website, I'm not sure I can post that kind of link here.

    Please advise!

    Kind regards,
    Jolanda

  • Aaron
    • CTO

    "A technical error occurred. Produkt nummer1 is verplicht."
    (Product nr 1 is required)

    That would be because a product in the cart doesn't have an sku. Need to handle that gracefully.

    I'll see what I can adjust for next release. Still gotta figure our sales prices, as the api doesn't support that.

  • Jolandak
    • Site Builder, Child of Zeus

    This what I get with the new gateway:

    A technical error occurred.

    Produkt nummer1 is verplicht.
    Omschrijving Produkt 1 is verplicht.
    Aantal Produkt 1 is verplicht.
    Prijs Produkt 1 is verplicht.

    (Product number 1 is required
    Description Product 1 is required
    Quantity Product 1 is required
    Price Product 1 is required)

  • Jolandak
    • Site Builder, Child of Zeus

    Yes. There are 2 options... First is to use the productlist. Second is to use hashcoding.

    The manual says:
    The easiest method is to use he product list. BUT:
    It's possible (using productslist) to order 6 pieces of article A, but not 1 article A and 1 article B)
    If your store demands different types of products to be sold in one order you need to use hascoding.

    I figured I needed hascoding.

    Tell me what you need translated and I'll do it for you! I don't mean to cause you stress :wink:

  • Jolandak
    • Site Builder, Child of Zeus

    Hi there!

    So.. I've been working on this constantly. It seems that whenever I solve one problem a new one occurs...

    So far I've been able to solve the problem with the discounts, so this works. The TAX problem is the next thing I'm working on and I think I'll eventually have this fixed too.

    But... I came across another issue.
    When I add a discount, the shopping cart does the following (see picture):
    The price of the product is EUR 5,00. The discount is EUR 2,00. So the total amount should be EUR 3,00. TAX included.
    The cart however, starts with the product price, minus taxes, and then takes the discount off the price without TAX.
    I end up with a Total amount of EUR 2,62 which is not correct.

    FIY: The "product nr1 is required" issue is solved. I only get "Total amount incorrect" errors. Constantly.

    Best regards,
    Jolanda

  • Jolandak
    • Site Builder, Child of Zeus

    Hi Aaron!

    Well, I still need some help with my last issue. So I would appreciate it if you can look at my php file once more.
    You can download the file here: http://wtrns.fr/05t5a4AnWvA38g

    This is the error message I receive from my bank:

    &subID=0
    &itemPrice3=128
    &itemQuantity1=1
    &itemNumber3=99999999
    &paymentType=ideal
    &itemPrice2=750
    &itemDescription3=Belasting
    &validUntil=2012-09-18T17:09:08Z
    &itemNumber1=POM00010016V-L
    &itemDescription2=Verzenden
    &itemQuantity3=1
    &urlError=http://www.arte-dal-fiume.com/store/shopping-cart/checkout/?err=1
    &itemNumber2=99999998
    &itemDescription1=Schaalvierkant16x16cm
    &language=nl
    &urlSuccess=http://www.arte-dal-fiume.com/store/shopping-cart/confirm-checkout/
    &currency=EUR
    &itemQuantity2=1
    &itemPrice1=800
    &urlCancel=http://www.arte-dal-fiume.com/store/shopping-cart/checkout/?cancel=1
    &hash=*deleted by me*
    &merchantID=*deleted by me*
    &amount=1550
    &purchaseID=66b83856007a
    &description=Arte dal fiume Store Purchase -

    So, The product price is 800 (TAX included), Shipping is 750 (no TAX is being calculated over shipping). Total 1550.
    This all seems correct, but I still get "Total amount incorrect".
    I'm thinking the problem is: &itemPrice3=128
    Because this is the TAX price. But I can't figure out how to fix it.

    Can you?

  • Jolandak
    • Site Builder, Child of Zeus

    THANK YOU!!!!!! It works! It was actually not that difficult, I just could not see it....
    I deleted:
    //Add tax as separate product
    $items[] = array(
    'itemNumber'.$i => '99999999', // Product number
    'itemDescription'.$i => __('Tax', 'mp'), // Description
    'itemQuantity'.$i => 1, // Quantity
    'itemPrice'.$i => round($tax_price,2) * 100 // Product price in cents
    );

    That was it.

    Please download this version and include in the next update:
    http://wtrns.fr/Slbo57cR3gH5Uta

    Best regards,
    Jolanda

  • Jolandak
    • Site Builder, Child of Zeus

    Hi Aaron,

    Still experiencing a problem with iDEAL / coupons.

    I have to add the amount of the coupon ex VAT. (For example, I sell a coupon worth € 10,00 TAX included, I put in my system € 8,40, so that the right amount is being calculated). My cart doesn't calculate the right amount, see image:

    Item €9,50 + shipping €7,50 = €17,00
    When adding the coupon (-€10,00) the result should be € 7,00, but it's calculated to € 7,50.

    I'm not sure if this is directly related to iDEAL, but in this situation iDEAL gives the "Total amount incorrect" error.

    Please advise!

    Kind regards,
    Jolanda

  • Jolandak
    • Site Builder, Child of Zeus

    Yes that's what I said before....
    Still the maths aren't correct.

    Before tax € 7,98 - coupon € 8,40 = -€ 0,42

    + Tax (19%): -€ 0,50
    + shipping € 7,50

    Total: € 7,00

    Not € 7,50...........

    Calculating with tax included doesn't make a difference: Item €9,50 + shipping: € 7,50 = €17,00
    Minus the coupon € 10,00

    Total: € 7,00

    Maybe I'm not seeing it, but I simply don't understand where €7,50 comes from.

  • Jolandak
    • Site Builder, Child of Zeus

    Yes of course! Please note that this was tested succesfully only with ING. It's probably suitable for other banks as well.
    Also; it only works when VAT is set to 0%.

    If you have any questions, or need me to test something for you, please let me know.

  • zeepschuur
    • WPMU DEV Initiate

    Hi Question,
    I have the same problem with tax, haven't test the discount yet. I use Rabo Ideal Lite.
    I can't set tax to 0% though because my custemors won't like that.
    How can I solve the tax problem, I also ghet the message total ammount is incorrect.

    Where can I find the code Jolanda deleted?

    Kind regards,
    Esther (from the Netherlands)

  • Jolandak
    • Site Builder, Child of Zeus

    Hi Esther,

    It seemed for me that no matter what I tried I couldn't get the total amount to add up properly.
    That is why eventually I set Tax to 0%.
    If you do want to show TAX in your shop I might be able to help you. You can add it to your shoppingcart without taking all the numbers to Ideal, but by using only the amount with TAX included.
    However, you will have to make some adjustments to the template functions file, meaning you have to be careful when you update MarketPress because these changes will be overwritten.

    Best regards,
    Jolanda

  • zeepschuur
    • WPMU DEV Initiate

    Hi Jolanda,
    It's a bit strange because when you set prices exclusive VAt it works perfectly. It only doesn't seem to work when you set prices to inclusive VAT.
    I tried it at my store and when prices are set to exclusive vat it works fine, I went through the Ideal payment perfectly...

  • Jolandak
    • Site Builder, Child of Zeus

    Yes I know, and I've tried everything :slight_smile:

    If you simply want to inform people about the TAX, you can add it to the shoppingcart. Or for example, add a line to all the prices in the shop "inclusief 21% BTW".
    Would that work for you?

  • Jolandak
    • Site Builder, Child of Zeus

    I think I know already :wink:

    Find: wordpress-ecommerce > marketpress-includes > template-functions.php

    I would advise to copy the file in case something goes wrong...

    Open file and search for:

    /*
    * Displays the product price (and sale price)
    *
    * @param bool $echo Optional, whether to echo
    * @param int $post_id The post_id for the product. Optional if in the loop
    * @param sting $label A label to prepend to the price. Defaults to "Price: "
    */
    function mp_product_price( $echo = true, $post_id = NULL, $label = true ) {
    global $id, $mp;
    $post_id = ( NULL === $post_id ) ? $id : $post_id;

    $label = ($label === true) ? __('Price: ', 'mp') : $label;

    $settings = get_option('mp_settings');
    $meta = get_post_custom($post_id);
    //unserialize
    foreach ($meta as $key => $val) {
    $meta[$key] = maybe_unserialize($val[0]);
    if (!is_array($meta[$key]) && $key != "mp_is_sale" && $key != "mp_track_inventory" && $key != "mp_product_link" && $key != "mp_file" && $key != "mp_price_sort")
    $meta[$key] = array($meta[$key]);
    }

    if ((is_array($meta["mp_price"]) && count($meta["mp_price"]) == 1) || !empty($meta["mp_file"])) {
    if ($meta["mp_is_sale"]) {
    $price = '<span class="mp_special_price"><del class="mp_old_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</del>';
    $price .= '<span class="mp_current_price">'.$mp->format_currency('', $meta["mp_sale_price"][0]).'</span></span>';
    } else {
    $price = '<span class="mp_normal_price"><span class="mp_current_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</span></span>';
    }
    } else {
    return '';
    }

    $price = apply_filters( 'mp_product_price_tag', '<span class="mp_product_price">' . $label . $price . '</span>', $post_id, $label );

    if ($echo)
    echo $price;
    else
    return $price;
    }

  • Jolandak
    • Site Builder, Child of Zeus

    Then add: <span> (incl. 21% BTW) </span> like this:

    /*
    * Displays the product price (and sale price)
    *
    * @param bool $echo Optional, whether to echo
    * @param int $post_id The post_id for the product. Optional if in the loop
    * @param sting $label A label to prepend to the price. Defaults to "Price: "
    */
    function mp_product_price( $echo = true, $post_id = NULL, $label = true ) {
    global $id, $mp;
    $post_id = ( NULL === $post_id ) ? $id : $post_id;

    $label = ($label === true) ? __('Price: ', 'mp') : $label;

    $settings = get_option('mp_settings');
    $meta = get_post_custom($post_id);
    //unserialize
    foreach ($meta as $key => $val) {
    $meta[$key] = maybe_unserialize($val[0]);
    if (!is_array($meta[$key]) && $key != "mp_is_sale" && $key != "mp_track_inventory" && $key != "mp_product_link" && $key != "mp_file" && $key != "mp_price_sort")
    $meta[$key] = array($meta[$key]);
    }

    if ((is_array($meta["mp_price"]) && count($meta["mp_price"]) == 1) || !empty($meta["mp_file"])) {
    if ($meta["mp_is_sale"]) {
    $price = '<span class="mp_special_price"><del class="mp_old_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</del>';
    $price .= '<span class="mp_current_price">'.$mp->format_currency('', $meta["mp_sale_price"][0]).'</span><span> (incl. 21% BTW) </span></span>';
    } else {
    $price = '<span class="mp_normal_price"><span class="mp_current_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</span><span> (incl. 21% BTW) </span></span>';
    }
    } else {
    return '';
    }

    $price = apply_filters( 'mp_product_price_tag', '<span class="mp_product_price">' . $label . $price . '</span>', $post_id, $label );

    if ($echo)
    echo $price;
    else
    return $price;
    }

  • zeepschuur
    • WPMU DEV Initiate

    Must say this is the edited version:

    /*
    * Displays the product price (and sale price)
    *
    * @param bool $echo Optional, whether to echo
    * @param int $post_id The post_id for the product. Optional if in the loop
    * @param sting $label A label to prepend to the price. Defaults to "Price: "
    */
    function mp_product_price( $echo = true, $post_id = NULL, $label = true ) {
    global $id, $mp;
    $post_id = ( NULL === $post_id ) ? $id : $post_id;

    $label = ($label === true) ? __('Price: ', 'mp') : $label;

    $settings = get_option('mp_settings');
    $meta = get_post_custom($post_id);
    //unserialize
    foreach ($meta as $key => $val) {
    $meta[$key] = maybe_unserialize($val[0]);
    if (!is_array($meta[$key]) && $key != "mp_is_sale" && $key != "mp_track_inventory" && $key != "mp_product_link" && $key != "mp_file" && $key != "mp_price_sort")
    $meta[$key] = array($meta[$key]);
    }

    if ((is_array($meta["mp_price"]) && count($meta["mp_price"]) == 1) || !empty($meta["mp_file"])) {
    if ($meta["mp_is_sale"]) {
    $price = '<span class="mp_special_price"><del class="mp_old_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</del>';
    $price .= '<span class="mp_current_price">'.$mp->format_currency('', $meta["mp_sale_price"][0]).'</span><span> (incl. 21% BTW) </span></span>';
    } else {
    $price = '<span class="mp_normal_price"><span class="mp_current_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</span><span> (incl. 21% BTW) </span></span>';
    }
    } else {
    return '';
    }

    $price = apply_filters( 'mp_product_price_tag', '<span class="mp_product_price">' . $label . $price . '</span>', $post_id, $label );

    if ($echo)
    echo $price;
    else
    return $price;
    }

  • Jolandak
    • Site Builder, Child of Zeus

    Zoek in je template-functions:

    } else if ($type == 'widget') {

    hieronder staat iets van:

    $content .= '<table class="mp_cart_contents_widget"><thead><tr>';
    $content .= '<th class="mp_cart_col_product" colspan="2">'.__('Item:', 'mp').'</th>';
    $content .= '<th class="mp_cart_col_quant">'.__('Qty:', 'mp').'</th>';
    $content .= '<th class="mp_cart_col_price">'.__('Price:', 'mp').'</th></tr></thead><tbody>';

    $totals = array();
    foreach ($selected_cart as $bid => $cart) {

    if (is_multisite())
    switch_to_blog($bid);

    foreach ($cart as $product_id => $variations) {
    foreach ($variations as $variation => $data) {
    $totals[] = $data['price'] * $data['quantity'];
    $content .= '<tr>';
    $content .= ' <td class="mp_cart_col_thumb">' . mp_product_image( false, 'widget', $product_id, 25 ) . '</td>';
    $content .= ' <td class="mp_cart_col_product_table">' . apply_filters('mp_product_name_display_in_cart', $data['name'], $product_id) . '' . '</td>'; // Added WPML
    $content .= ' <td class="mp_cart_col_quant">' . number_format_i18n($data['quantity']) . '</td>';
    $content .= ' <td class="mp_cart_col_price">' . $mp->format_currency('', $data['price'] * $data['quantity']) . '</td>';
    $content .= '</tr>';
    }
    }
    }

    if (is_multisite())
    switch_to_blog($current_blog_id);

    $total = array_sum($totals);

    $content .= '<tr>';
    $content .= ' <td class="mp_cart_subtotal_lbl" colspan="3">' . __('Subtotal:', 'mp') . '</td>';
    $content .= ' <td class="mp_cart_col_total">' . $mp->format_currency('', $total) . '</td>';
    $content .= '</tr>';

    $content .= '</tbody></table>';
    }

    if ($echo) {
    echo $content;
    } else {
    return $content;
    }
    }

    Veranderen (toevoegen taxes en totaal) in het laatste gedeelte:

    $content .= '<tr>';
    $content .= ' <td class="mp_cart_subtotal_lbl" colspan="3">' . __('Subtotal:', 'mp') . '</td>';
    $content .= ' <td class="mp_cart_col_total">' . $mp->format_currency('', $total) . '</td>';
    $content .= '</tr>';
    $content .= '<tr>';
    $content .= ' <td class="mp_cart_col_tax" colspan="3">' . __('Taxes:', 'mp') . '</td>';
    $content .= ' <td class="mp_cart_col_total">' . $mp->format_currency('', $total*1.21-$total) . '</td>';
    $content .= '</tr>';
    $content .= '<tr>';
    $content .= ' <td class="mp_cart_col_tax" colspan="3">' . __('Total (ex. shipping costs):', 'mp') . '</td>';
    $content .= ' <td class="mp_cart_col_total">' . $mp->format_currency('', $total*1.21) . '</td>';
    $content .= '</tr>';

    $content .= '</tbody></table>';
    }

    if ($echo) {
    echo $content;
    } else {
    return $content;
    }
    }

    Moet je alleen even zien welke tekst je gebruikt (is nu engels)

    Ik kijk even naar PayPal, hoor je zo

  • zeepschuur
    • WPMU DEV Initiate

    Ja paypal was een fluitje van een cent inderdaad... nog één dingetje he, ik wil eigenlijk de navigatie aan de bovenkant van de winkelwagen veranderen: deze lijn bedoel ik:
    Review Cart»Verzenden»Checkout»Confirm»Thankyou

    Ik kan echt geen enkel bestand vinden waar je dat kunt aanpassen. Vooral omdat er engels en nederlands door elkaar gebruikt wordt...

  • Jolandak
    • Site Builder, Child of Zeus

    Goedemorgen!

    Die navigatie is nieuw, zit er pas sinds de laatste update in. Ik heb het dus zelf ook nog niet veranderd. Ik vermoed dat het in het vertaalbestand Nederlands zit. Je kunt eens kijken bij het mapje languages.

  • zeepschuur
    • WPMU DEV Initiate

    I couldn't wait and had to test it but it goes wrong but not in the way it went the other times. I can pay with Ideal when I have VAT set to 21% and inclusive. But....
    When I go to Ideal the ammount is not correct I must pay less then what the cart says. I will attach the screenshots of the cart and of the Ideal interface.

  • zeepschuur
    • WPMU DEV Initiate

    Oke I know what the problem is... it's the shipping. I use flat rate and when you set no vat to shipping it works ok. So that needs some adjustment.

    I have tested it and the ammount was correct when I used no vat on shipping.

    I will add the screenshot of the store again. I see on the previous post it was to big.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.