Example #1
0
function espresso_process_ideal_report($payment_data)
{
    $ideal_mollie_settings = get_option('event_espresso_ideal_mollie_settings');
    $payment_data['txn_type'] = 'iDeal Mollie';
    $payment_data['txn_details'] = serialize($_REQUEST);
    $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 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 
        }
    }
    $payment_data = apply_filters('filter_hook_espresso_get_total_cost', $payment_data);
    $payment_data = apply_filters('filter_hook_espresso_prepare_event_link', $payment_data);
    $payment_data = apply_filters('filter_hook_espresso_update_attendee_payment_data_in_db', $payment_data);
    do_action('action_hook_espresso_email_after_payment', $payment_data);
    return $payment_data;
}
 function check($transaction_id)
 {
     require_once 'ideal.class.php';
     $partner_id = $this->partnerID;
     // Uw mollie partner ID
     $iDEAL = new iDEAL_Payment($partner_id);
     if ($this->testMode) {
         $iDEAL->setTestMode();
     }
     $iDEAL->checkPayment($transaction_id);
     if ($iDEAL->getPaidStatus() == true) {
         /* De betaling is betaald, deze informatie kan opgeslagen worden (bijv. in de database).
            Met behulp van $iDEAL->getConsumerInfo(); kunt u de consument gegevens ophalen (de 
            functie returned een array). Met behulp van $iDEAL->getAmount(); kunt u het betaalde
            bedrag vergelijken met het bedrag dat afgerekend zou moeten worden. */
         $data = array('customerInfo' => $iDEAL->getConsumerInfo(), 'amount' => $iDEAL->getAmount());
         return $data;
     } else {
         $data = array('error' => true, 'msg' => 'Kon geen betaling vinden met deze transactie id.');
         return $data;
     }
 }
Example #3
0
function mollieideal_link($params)
{
    $gatewaypartnerid = $params['partnerid'];
    if (empty($params['customDescription'])) {
        $gatewaydescription = $params['description'];
    }
    $return_url = $params['returnurl'];
    $report_url = $params['systemurl'] . "/modules/gateways/callback/mollieideal.php?invoiceid=" . urlencode($params['invoiceid']) . "&amount=" . urlencode($params['amount']) . "&fee=" . urlencode($params['fee']);
    $invoiceid = $params['invoiceid'];
    $description = $params['description'];
    $amount = $params['amount'];
    $currency = $params['currency'];
    $firstname = $params['clientdetails']['firstname'];
    $lastname = $params['clientdetails']['lastname'];
    $email = $params['clientdetails']['email'];
    $address1 = $params['clientdetails']['address1'];
    $address2 = $params['clientdetails']['address2'];
    $city = $params['clientdetails']['city'];
    $state = $params['clientdetails']['state'];
    $postcode = $params['clientdetails']['postcode'];
    $country = $params['clientdetails']['country'];
    $phone = $params['clientdetails']['phonenumber'];
    $companyname = $params['companyname'];
    $systemurl = $params['systemurl'];
    $currency = $params['currency'];
    if (!in_array("ssl", stream_get_transports())) {
        $code = "<h1>Foutmelding</h1>";
        $code .= "<p>Uw PHP installatie heeft geen SSL ondersteuning. SSL is nodig voor de communicatie met de Mollie iDEAL API.</p>";
        return $code;
    }
    $iDEAL = new iDEAL_Payment($gatewaypartnerid);
    if (isset($_POST['bank_id']) && !empty($_POST['bank_id'])) {
        $idealAmount = $amount * 100;
        if ($iDEAL->createPayment($_POST['bank_id'], $idealAmount, $gatewaydescription, $return_url, $report_url)) {
            header("Location: " . $iDEAL->getBankURL());
            exit;
        } else {
            $code = "<p>De betaling kon niet aangemaakt worden.</p>";
            $code .= "<p><strong>Foutmelding:</strong> " . $iDEAL->getErrorMessage() . "</p>";
            return $code;
        }
    }
    $bank_array = $iDEAL->getBanks();
    if ($bank_array == false) {
        return "<p>Er is een fout opgetreden bij het ophalen van de banklijst: " . $iDEAL->getErrorMessage() . "</p>";
    }
    $code = "<form method=\"post\">\n\t<select name=\"bank_id\">\n\t\t<option value=\"\">Kies uw bank</option>";
    foreach ($bank_array as $bank_id => $bank_name) {
        $code .= "<option value=\"" . $bank_id . "\">" . $bank_name . "</option>";
    }
    $code .= "</select>\n\t<input type=\"submit\" name=\"submit\" value=\"Betaal via iDEAL\" />\n</form>";
    return $code;
}
Example #4
0
$partner_id = '00000';
// Uw mollie partner ID
$amount = 118;
// Het af te rekenen bedrag in centen (!!!)
$description = 'Testbetaling';
// Beschrijving die consument op zijn/haar afschrift ziet.
$return_url = 'http://www.domein.nl/return.php';
// URL waarnaar de consument teruggestuurd wordt na de betaling
$report_url = 'http://www.domein.nl/report.php';
// URL die Mollie aanvraagt (op de achtergrond) na de betaling om de status naar op te sturen
if (!in_array('ssl', stream_get_transports())) {
    echo "<h1>Foutmelding</h1>";
    echo "<p>Uw PHP installatie heeft geen SSL ondersteuning. SSL is nodig voor de communicatie met de Mollie iDEAL API.</p>";
    exit;
}
$iDEAL = new iDEAL_Payment($partner_id);
//$iDEAL->setTestMode();
if (isset($_POST['bank_id']) and !empty($_POST['bank_id'])) {
    if ($iDEAL->createPayment($_POST['bank_id'], $amount, $description, $return_url, $report_url)) {
        /* Hier kunt u de aangemaakte betaling opslaan in uw database, bijv. met het unieke transactie_id
           Het transactie_id kunt u aanvragen door $iDEAL->getTransactionId() te gebruiken. Hierna wordt 
           de consument automatisch doorgestuurd naar de gekozen bank. */
        header("Location: " . $iDEAL->getBankURL());
        exit;
    } else {
        /* Er is iets mis gegaan bij het aanmaken bij de betaling. U kunt meer informatie 
           vinden over waarom het mis is gegaan door $iDEAL->getErrorMessage() en/of 
           $iDEAL->getErrorCode() te gebruiken. */
        echo '<p>De betaling kon niet aangemaakt worden.</p>';
        echo '<p><strong>Foutmelding:</strong> ', $iDEAL->getErrorMessage(), '</p>';
        exit;
Example #5
0
 /**
  * Get list of banks for ideal payment plugin
  * @return array
  */
 public static function getBankLists()
 {
     $idealPlugin = os_payments::loadPaymentMethod('os_ideal');
     $params = new JRegistry($idealPlugin->params);
     $partnerId = $params->get('partner_id');
     $ideal = new iDEAL_Payment($partnerId);
     if (!$params->get('ideal_mode', 0)) {
         $ideal->setTestmode(true);
     }
     $bankLists = $ideal->getBanks();
     return $bankLists;
 }
 function showEndForm($pmconfigs, $order)
 {
     $mainframe =& JFactory::getApplication();
     $jshopConfig =& JSFactory::getConfig();
     $item_name = sprintf(_JSHOP_PAYMENT_NUMBER, $order->order_number);
     $notify_url = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_ideal&no_lang=1";
     $return = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_ideal";
     $cancel_return = JURI::root() . "index.php?option=com_jshopping&controller=checkout&task=step7&act=cancel&js_paymentclass=pm_ideal";
     $params_data = $order->getPaymentParamsData();
     $bank_id = $params_data['bank_id'];
     $amount = intval($order->order_total * 100);
     $iDEAL = new iDEAL_Payment($pmconfigs['partnerid']);
     if ($pmconfigs['testmode']) {
         $iDEAL->setTestMode();
     }
     if ($iDEAL->createPayment($bank_id, $amount, $item_name, $return, $notify_url)) {
         $order1 =& JTable::getInstance('order', 'jshop');
         $order1->load($order->order_id);
         $order1->transaction = $iDEAL->getTransactionId();
         $order1->store();
         header("Location: " . $iDEAL->getBankURL());
         exit;
     } else {
         saveToLog("payment.log", "Error: Order ID " . $order->order_id . ". CODE: " . $iDEAL->getErrorCode() . ". MSG: " . $iDEAL->getErrorMessage());
         JError::raiseWarning("", $iDEAL->getErrorMessage());
         $mainframe->redirect(SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5', 0, 1, $jshopConfig->use_ssl));
         exit;
     }
 }
Example #7
0
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$gatewaymodule = "mollieideal";
$GATEWAY = getGatewayVariables($gatewaymodule);
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$invoiceid = urldecode($_GET['invoiceid']);
$transid = $_GET['transaction_id'];
$amount = urldecode($_GET['amount']);
$fee = urldecode($_GET['fee']);
checkCbTransID($transid);
if (isset($transid)) {
    $iDEAL = new iDEAL_Payment($GATEWAY['partnerid']);
    $iDEAL->checkPayment($_GET['transaction_id']);
    if ($iDEAL->getPaidStatus() == true) {
        addInvoicePayment($invoiceid, $transid, $amount, $fee, $gatewaymodule);
        logTransaction($GATEWAY['name'], $_GET, "Successful");
        return 1;
    }
    logTransaction($GATEWAY['name'], $_GET, "Unsuccessful");
}
Example #8
0
 public function validateNotification($response, $post, $invoice)
 {
     require_once dirname(__FILE__) . '/lib/cls.ideal.php';
     $response = array();
     $response['valid'] = false;
     $transaction_id = aecGetParam('transaction_id', '', true, array('word', 'string', 'clear_nonalnum'));
     if (strlen($transaction_id)) {
         $mollieIdeal = new iDEAL_Payment($this->settings['partner_id']);
         $mollieIdeal->checkPayment($transaction_id);
         if ($mollieIdeal->getPaidStatus()) {
             $response['valid'] = true;
         } else {
             // error handling
             $response['error'] = true;
             $response['errormsg'] = 'iDEAL_Payment::checkPayment failed';
             $this->___logError("iDEAL_Payment::checkPayment failed", $mollieIdeal->getErrorCode(), $mollieIdeal->getErrorMessage());
         }
     }
     return $response;
 }
Example #9
0
function espresso_process_ideal($payment_data)
{
    global $org_options, $wpdb;
    $ideal_mollie_settings = get_option('event_espresso_ideal_mollie_settings');
    require_once 'ideal.class.php';
    $partner_id = $ideal_mollie_settings['ideal_mollie_partner_id'];
    $payment_data = apply_filters('filter_hook_espresso_prepare_payment_data_for_gateways', $payment_data);
    $payment_data = apply_filters('filter_hook_espresso_get_total_cost', $payment_data);
    //amount needs to be in cents
    $amount = (int) ($payment_data['total_cost'] * 100);
    $iDEAL = new iDEAL_Payment($partner_id);
    if ($ideal_mollie_settings['ideal_mollie_use_sandbox']) {
        $iDEAL->setTestMode();
    }
    if ($ideal_mollie_settings['force_ssl_return']) {
        $home = str_replace("http://", "https://", home_url());
    } else {
        $home = home_url();
    }
    if (!empty($_POST['bank_id'])) {
        $return_url = $home . '/?page_id=' . $org_options['return_url'] . '&id=' . $payment_data['attendee_id'] . '&r_id=' . $payment_data['registration_id'] . '&type=ideal';
        $report_url = $home . '/?page_id=' . $org_options['notify_url'] . '&id=' . $payment_data['attendee_id'] . '&r_id=' . $payment_data['registration_id'] . '&event_id=' . $payment_data['event_id'] . '&attendee_action=post_payment&form_action=payment&ideal=1';
        //Find the correct amount so that unsavory characters don't change it in the previous form
        $description = stripslashes_deep($payment_data['event_name']);
        if ($iDEAL->createPayment($_POST['bank_id'], $amount, $description, $return_url, $report_url)) {
            header("Location: " . $iDEAL->getBankURL());
            exit;
        } else {
            echo '<p>De betaling kon niet aangemaakt worden.</p>';
            echo '<p><strong>Foutmelding:</strong> ', $iDEAL->getErrorMessage(), '</p>';
        }
    } elseif (isset($_POST['bank_id']) && $_POST['bank_id'] == '') {
        echo "<p>" . __("Please use your browser's back button and select a bank.", 'event_espresso');
    }
    $bank_array = $iDEAL->getBanks();
    if ($bank_array == false) {
        echo '<p>Er is een fout opgetreden bij het ophalen van de banklijst: ', $iDEAL->getErrorMessage(), '</p>';
    }
    ?>
<div id="ideal-payment-option-dv" class="payment-option-dv">

	<a id="ideal-payment-option-lnk" class="payment-option-lnk display-the-hidden" rel="ideal-payment-option-form" style="cursor:pointer;">
		<img alt="Pay using a Credit Card" src="<?php 
    echo EVENT_ESPRESSO_PLUGINFULLURL;
    ?>
gateways/pay-by-credit-card.png">
	</a>	

	<div id="ideal-payment-option-form-dv" class="hide-if-js">	
		<div class="event-display-boxes">
		<div class = "event_espresso_form_wrapper">
			<form id="ideal-mollie-form" class="ee-forms" method="post" action="<?php 
    echo $home . '/?page_id=' . $org_options['notify_url'];
    ?>
">
			
				<fieldset id="ideal-billing-info-dv">
					<h4 class="section-title"><?php 
    _e('Select Bank', 'event_espresso');
    ?>
</h4>
					<p>
						<select id ="bank_id" name="bank_id" class="required">
							<option value=''>Kies uw bank</option>

							<?php 
    foreach ($bank_array as $bank_id => $bank_name) {
        ?>
								<option value="<?php 
        echo $bank_id;
        ?>
"><?php 
        echo $bank_name;
        ?>
</option>
							<?php 
    }
    ?>

						</select>
					</p>
				</fieldset>
				<input name="amount" type="hidden" value="<?php 
    echo $amount;
    ?>
" />
				<input name="ideal" type="hidden" value="1" />
				<input name="id" type="hidden" value="<?php 
    echo $payment_data['attendee_id'];
    ?>
" />
				<p class="event_form_submit">
					<input id="submit_ideal" type="submit" class="submit-payment-btn" name="submit" value="Betaal via iDEAL" />
				</p>
			</form>
		</div>

		<br/>
		<p class="choose-diff-pay-option-pg">
			<a class="hide-the-displayed" rel="ideal-payment-option-form" style="cursor:pointer;"><?php 
    _e('Choose a different payment option', 'event_espresso');
    ?>
</a>
		</p>

	</div>
	</div>
</div>
<?php 
}
function espresso_process_ideal($payment_data)
{
    global $org_options, $wpdb;
    $ideal_mollie_settings = get_option('event_espresso_ideal_mollie_settings');
    require_once 'ideal.class.php';
    $partner_id = $ideal_mollie_settings['ideal_mollie_partner_id'];
    $payment_data = apply_filters('filter_hook_espresso_prepare_payment_data_for_gateways', $payment_data);
    $payment_data = apply_filters('filter_hook_espresso_get_total_cost', $payment_data);
    //amount needs to be in cents
    $amount = (int) ($payment_data['total_cost'] * 100);
    $iDEAL = new iDEAL_Payment($partner_id);
    if ($ideal_mollie_settings['ideal_mollie_use_sandbox']) {
        $iDEAL->setTestMode();
    }
    if (isset($_POST['bank_id']) and !empty($_POST['bank_id'])) {
        $return_url = home_url() . '/?page_id=' . $org_options['return_url'] . '&id=' . $payment_data['attendee_id'];
        $report_url = home_url() . '/?page_id=' . $org_options['notify_url'] . '&id=' . $payment_data['attendee_id'] . '&event_id=' . $payment_data['event_id'] . '&attendee_action=post_payment&form_action=payment&ideal=1';
        //Find the correct amount so that unsavory characters don't change it in the previous form
        $description = stripslashes_deep($payment_data['event_name']);
        if ($iDEAL->createPayment($_POST['bank_id'], $amount, $description, $return_url, $report_url)) {
            header("Location: " . $iDEAL->getBankURL());
            exit;
        } else {
            echo '<p>De betaling kon niet aangemaakt worden.</p>';
            echo '<p><strong>Foutmelding:</strong> ', $iDEAL->getErrorMessage(), '</p>';
        }
    } elseif (isset($_POST['bank_id']) && $_POST['bank_id'] == '') {
        echo "<p>" . __("Please use your browser's back button and select a bank.", 'event_espresso');
    }
    $bank_array = $iDEAL->getBanks();
    if ($bank_array == false) {
        echo '<p>Er is een fout opgetreden bij het ophalen van de banklijst: ', $iDEAL->getErrorMessage(), '</p>';
    }
    ?>
	<div class="event-display-boxes">
		<form id="ideal-mollie-form" class="ee-forms" method="post" action="<?php 
    echo home_url() . '/?page_id=' . $org_options['notify_url'];
    ?>
">
			<select id ="bank_id" name="bank_id" class="required">
				<option value=''>Kies uw bank</option>

				<?php 
    foreach ($bank_array as $bank_id => $bank_name) {
        ?>
					<option value="<?php 
        echo $bank_id;
        ?>
"><?php 
        echo $bank_name;
        ?>
</option>
				<?php 
    }
    ?>

			</select>
			<input name="amount" type="hidden" value="<?php 
    echo $amount;
    ?>
" />
			<input name="ideal" type="hidden" value="1" />
			<input name="id" type="hidden" value="<?php 
    echo $payment_data['attendee_id'];
    ?>
" />
			<input id="submit" type="submit" class="btn_event_form_submit payment-submit" name="submit" value="Betaal via iDEAL" />
		</form>
	</div>
	<?php 
}