Hi,
Ik wil een Molie Wallie Api gebruiken , nu heb ik het maar hij stuurt je niet door naar de betaalscherm. Hoe los ik dit op?
Code
Ik wil een Molie Wallie Api gebruiken , nu heb ik het maar hij stuurt je niet door naar de betaalscherm. Hoe los ik dit op?
Code
require_once includes/class/Mollie/Wallie.php;
include includes/header.php;
$molliePartnerID = 0; // Fill in your own Mollie Partner ID!
// Get an instance of the Mollie_Wallie class
$wallie = new Mollie_Wallie($molliePartnerID);
if (!isset($_GET[transaction_id]) and !isset($_GET[amount])) {
// Create the payment, true on succes, false otherwise
// $amount = the total money amount that the user has to pay (in cents!)
// $siteReportUrl = the url where Mollie reports to when the payment is complete.
// Mollie will add payment_type=wallie&transaction_id=<transactionId>&amount=<amount> to this url!
// $siteReturnUrl = the url where Mollie returns to when the payment is complete.
// Mollie will add transaction_id=<transactionId>&amount=<amount> to this url!
$amount = 250;
$siteReportUrl = ROOT.vip/wallie;
$siteReturnUrl = ROOT.vip/wallie;
if ($wallie->createPayment($amount, $siteReportUrl, $siteReturnUrl)) {
// Payment created, You could(/should) save the payment information in your database
// Get the url of the chosen bank to redirect the user to,
// to complete the payment
header(location: . $wallie->getWallieUrl());
}
else {
// show message that the payment could not be created
// the function $wallie->getStatus() returns the status
// message that Mollie returns
}
}
// (Background) report from Mollie
elseif (isset($_GET[payment_type]) and $_GET[payment_type] == wallie and isset($_GET[transaction_id]) and isset($_GET[amount])) {
// Check if payment is OK.
$checkPayment = $wallie->checkPayment($_GET[transaction_id], $_GET[amount]);
// Mollie makes sure a transaction can only
// be used one time!
if ($checkPayment == true) {
// Get the amount of money the user has payed
$paymentAmount = $wallie->getAmount();
// Set in your database the paymentstatus to OK.
}
else {
// Payment failed
}
}
// Return of customer
else {
// Check in your database if the customer has payed using $_GET[transaction_id] parameter
// and show customer a thank you-page or a your order will be processed-page.
echo OK;
} 
Dat kan je aan de inspringingen al zien.