Implementatie
Neem de belangrijkste regels code uit "step2.php" over in jou script.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
include(dirname(__FILE__) . '/ideallite.cls.php');
$oIdeal = new IdealLite();
// Set account details
$oIdeal->setMerchantId('002XXXXXX');
$oIdeal->setHashKey('YourSecretHashKey');
$oIdeal->setUrlBank('https://idealtest.rabobank.nl/ideal/mpiPayInitRabo.do');
// Set shop details
$oIdeal->setUrlCancel('http://www.domain.tld/ideal/step3.php?ideal[order]=NL_123456789&ideal[status]=cancel');
$oIdeal->setUrlError('http://www.domain.tld/ideal/step3.php?ideal[order]=NL_123456789&ideal[status]=error');
$oIdeal->setUrlSuccess('http://www.domain.tld/ideal/step3.php?ideal[order]=NL_123456789&ideal[status]=success');
// Set order details
$oIdeal->setAmount(49.95);
$oIdeal->setOrderId('NL_123456789');
$oIdeal->setOrderDescription('Omschrijving van uw bestelling');
// Customize submit button
$oIdeal->setButton('Betalen met iDEAL');
// Generate form
echo '<p>Uw bestelling direct afrekenen!</p>' . $oIdeal->createForm();
?>
include(dirname(__FILE__) . '/ideallite.cls.php');
$oIdeal = new IdealLite();
// Set account details
$oIdeal->setMerchantId('002XXXXXX');
$oIdeal->setHashKey('YourSecretHashKey');
$oIdeal->setUrlBank('https://idealtest.rabobank.nl/ideal/mpiPayInitRabo.do');
// Set shop details
$oIdeal->setUrlCancel('http://www.domain.tld/ideal/step3.php?ideal[order]=NL_123456789&ideal[status]=cancel');
$oIdeal->setUrlError('http://www.domain.tld/ideal/step3.php?ideal[order]=NL_123456789&ideal[status]=error');
$oIdeal->setUrlSuccess('http://www.domain.tld/ideal/step3.php?ideal[order]=NL_123456789&ideal[status]=success');
// Set order details
$oIdeal->setAmount(49.95);
$oIdeal->setOrderId('NL_123456789');
$oIdeal->setOrderDescription('Omschrijving van uw bestelling');
// Customize submit button
$oIdeal->setButton('Betalen met iDEAL');
// Generate form
echo '<p>Uw bestelling direct afrekenen!</p>' . $oIdeal->createForm();
?>
Enkele overige opmerkingen m.b.t. de implementatie:
- Stel je MERCHANT_ID, HASH_KEY en de URLs goed in.
- Zorg dat je hash key niet te raden is (dûh)
- Zorg dat de ORDER_ID uniek is. IDEAL accepteert niet 2x hetzelfde ORDER_ID.
- Zorg dat de ORDER_DESCRIPTION maximaal 32 karakters lang is (dit wordt in de class afgekapt).
Net als in andere versies is de testprocedure van 1, 2, 3, 4, 5 en 7 euro verplicht!
« vorige pagina | volgende pagina »