Leon Berenschot
June 21, 2013 at 5:14 am
Just fixed the mollie iDeal code because it was not processing the payments (getting the payment status only returns true once)
I don’t know if this is the best and securest way to do this but alas, it works for me now (php has been a long time for me, so bear with me)
to make it work:
copy the ideal folder from teh gateways folter to wp-content/uploads/espresso/gateways/
replace the content of report.php with this code:
function espresso_process_ideal_report($payment_data) {
$ideal_mollie_settings = get_option('event_espresso_ideal_mollie_settings');
$payment_data['txn_details'] = serialize($_REQUEST);
$payment_data['txn_type'] = 'iDeal Mollie';
if ($payment_data[‘payment_status’] != ‘Completed’) {
$payment_data[‘payment_status’] = ‘Incomplete’;
$payment_data[‘txn_id’] = 0;
require_once(‘ideal.class.php’);
$partner_id = $ideal_mollie_settings[‘ideal_mollie_partner_id’]; // Uw mollie partner ID
if (isset($_GET[‘transaction_id’])) {
$payment_data[‘txn_id’] = $_GET[‘transaction_id’];
$iDEAL = new Espresso_iDEAL_Payment($partner_id);
$iDEAL->checkPayment($_GET[‘transaction_id’]);
if ($iDEAL->getPaidStatus() == true) {
$payment_data[‘payment_status’] = “Completed”;
} else {
?>
?>
<?php
<!–?php }
}
}
//add_action(‘action_hook_espresso_email_after_payment’, ‘espresso_email_after_payment’);
return $payment_data;
}
Leon Berenschot
June 21, 2013 at 5:24 am
Add New Note to this Reply
<?php
function espresso_process_ideal_report($payment_data) {
$ideal_mollie_settings = get_option('event_espresso_ideal_mollie_settings');
$payment_data['txn_details'] = serialize($_REQUEST);
$payment_data['txn_type'] = 'iDeal Mollie';
if ($payment_data['payment_status'] != 'Completed') {
$payment_data['payment_status'] = 'Incomplete';
$payment_data['txn_id'] = 0;
require_once('ideal.class.php');
$partner_id = $ideal_mollie_settings['ideal_mollie_partner_id']; // Uw mollie partner ID
if (isset($_GET['transaction_id'])) {
$payment_data['txn_id'] = $_GET['transaction_id'];
$iDEAL = new Espresso_iDEAL_Payment($partner_id);
$iDEAL->checkPayment($_GET['transaction_id']);
if ($iDEAL->getPaidStatus() == true) {
$payment_data['payment_status'] = "Completed";
} else {
?>
<h2 style="color:#F00;"><?php _e('There was an error processing your transaction!', 'event_espresso'); ?></h2> <?php
}
}
}
//add_action('action_hook_espresso_email_after_payment', 'espresso_email_after_payment');
return $payment_data;
}
Dean
June 24, 2013 at 4:47 am
Add New Note to this Reply
Hi,
Thanks for posting this, it may be of use to people. I will also bring it to the developers attention.
Michael Nelson
June 24, 2013 at 3:12 pm
Add New Note to this Reply
@Leon Berenschot, I’m confused at why you posted your code for “espresso_process_ideal_report” twice… Do you mind explaining?
But I see the bug you fix. I’ve integrated your change into 3.1.35 (currently undergoing ALPHA testing) so it will be part of core after it’s gone through testing.
Leon Berenschot
June 24, 2013 at 3:23 pm
Add New Note to this Reply
post is exactly the same, first one screwed up the formatting a little… 😛
Josh
June 25, 2013 at 8:44 am
Add New Note to this Reply
Thanks for sharing the fix Leon!