Hey,
Ik was bezig met een wallie betaalmiddel via targetpay.com. Dit is allemaal gelukt etc maar er is één probleem. Als ik naar de wallie betaalmethode gaat dan krijg ik:
Transaction ID: 13036401
URL: https://www.targetpay.com/wallie/start.php?trxid=13036401
Dus dan zou je de URL moeten kopiëren om naar de betaal scherm te gaan?? Hoe zorg ik voor een redirect in dit script?? :
PHP
<?php
/**
* Ideal example on how to use the ideal class!
*
* SVE
*
* 11-01-2009
*
*/
ini_set ( 'display_errors', '1');
include ( 'TargetPayWallie.class.php');
# Set your rtlo ere
$iRtlo = 57591;
if ( !isset ( $_GET['ShoppingCartID'] ) ) {
# To initiate a payment, initiate the class
$oWallie = new TargetPayWallie ( $iRtlo );
# Set wallie amount in cents so 500 cent will be 5 euro
$oWallie->setWallieAmount ( 150 );
# Set wallie description
$oWallie->setWallieDescription ( 'Buy donator');
# Set return url, wich should return on succes
$oWallie->setWallieReturnUrl ( 'Linkweggehaald' );
/**
* OPTIONAL PARAMETERS FOR WALLIE
* UNCOMMENT IF YOU WANT TO USE
*/
$oWallie->setWallieCountry ( '31' ); // Set the country (optional)
$oWallie->setWallieLang ( 'NL' ); // Set wallie language (optional)
$oWallie->setWallieCurrency ( 'EUR '); // Set wallie currency ( optional )
# Now we can initiate the payment
$aReturn = $oWallie->startPayment();
# This is the transaction id
$intTrxId = $aReturn[0];
# this will be the bank url that will rederect to the bank.
$strURL = $aReturn[1];
# For check we can echo it here. (uncomment if you want to see. )
echo 'Transaction ID: '. $intTrxId . '<br/>URL: '. $strURL;
# Rederect your user now to:
header ( 'Location :'. $strURL );
}
/**
* This function will validate the payment
*
*/
# ?action=vtrxid= 'trxid'
if ( isset ( $_GET['ShoppingCartID'] ) ) {
# Init the class
$oWallie = new TargetPayWallie ( $iRtlo );
# Test mode? 1 = test mode, 0 = normal
$iTest = 0;
# Once, only validate the payment once?
$iOnce = 1;
if ( $oWallie->validatePayment ( $_GET['ShoppingCartID'], $iOnce, $iTest ) == true ) {
mysql_query("UPDATE `speldata` SET `cashmoney`=`cashmoney`+'2500000' WHERE `id`=".ID." LIMIT 1") or die(mysql_error());
mysql_query("UPDATE `status` SET `donateur`=`donateur`+'1' WHERE `id`=".ID." LIMIT 1") or die(mysql_error());
echo 'Your payment was successful';
}
else {
echo 'Payment failed.';
}
}
?>
Toon Meer
Alvast bedankt!