Hallo Forum,
Ik ben nog immer bezig met een iDEAL script, en deze doet weer eens niet wat ik wil.
Via een form POST ik een 3 tal variabelen naar dit script, waaronder bv. de variabele $amount, na de bankkeuze en druk op de knop betaal wordt even contact gemaakt met de bank en komt het weer terug in dit zelfde script ( tenminste als ik alles goed begrijp), maar dan bestaat de ge-POSTe variabele niet meer en kijg ik foutmeldingen dat die variabele niet aanwezig zijn, hoe is dit te ondervangen dat deze variabele vast blijven staan totdat nieuwe worden gepost??
Wederom Bedankt,
code:
Ik ben nog immer bezig met een iDEAL script, en deze doet weer eens niet wat ik wil.
Via een form POST ik een 3 tal variabelen naar dit script, waaronder bv. de variabele $amount, na de bankkeuze en druk op de knop betaal wordt even contact gemaakt met de bank en komt het weer terug in dit zelfde script ( tenminste als ik alles goed begrijp), maar dan bestaat de ge-POSTe variabele niet meer en kijg ik foutmeldingen dat die variabele niet aanwezig zijn, hoe is dit te ondervangen dat deze variabele vast blijven staan totdat nieuwe worden gepost??
Wederom Bedankt,
code:
PHP:
$amount = ($_POST['amount']);
$description = ($_POST['description']);
$returnURL = ($_POST['returnURL']);
//Settings
$Osci = 0; # Accountnumber
$amount = ($_POST['amount']); # Amount in cents (minimum of 84)
$description = ($_POST['description']); # The description form the payment
$returnURL = ($_POST['returnURL']); # If the customer clicks on the "return to site" button it wil send him/her to this page
$reportURL = 'http://www.mijnsite.nl/reportfrombank.php'; # This link is under water, no one will see this, but it always will be called from the
# bank zo you always can handle the payment (recommended for sending the confimationemail).
# The form has been send
if( $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['issuer']) && $_POST['issuer'] != '' ) {
$iDEAL = new OvasSolutionsIdeal( $Osci );
$iDEAL->setIdealAmount( $amount );
$iDEAL->setIdealDescription( $description );
$iDEAL->setIdealissuer( $_POST['issuer'] );
$iDEAL->setIdealReturnUrl( $returnURL );
$iDEAL->setIdealReportUrl( $reportURL );
$aPayment = $iDEAL->startPayment(); # Start of the payment
$intTrxId = $aPayment[0]; # This is the transaction id
$strBankURL = $aPayment[1]; # This will be the bank url that will rederect to the bank.
header( "Location: ". $strBankURL );
}
# Handle the return from the bank
elseif( $_SERVER['REQUEST_METHOD'] != 'POST' && isset ( $_GET['ec'] ) && isset ( $_GET['trxid'] ) ) {
$iDEAL = new OvasSolutionsIdeal( $Osci );
$status = $iDEAL->validatePayment ( $_GET['trxid'],1,1 );
if( $status === true ) {
echo 'The payment was succesful';
}
else {
echo 'The payment was not (yet) succesful. Message: '. $status;
}
}
# Show the form
else {
?>
<form name="ideal" method="post">
<table>
<tr>
<td>Bank</td>
<td><select name="issuer"><script src="https://api.ovas.nl/ideal/issuers?lang=nl"></script></select></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="Betaal"></td>
</tr>
</table>
</form>
<?php
}
?>
Laatst bewerkt door een moderator: