コード例 #1
0
 function pay($amount, $description, $bank_id)
 {
     require_once 'ideal.class.php';
     //$amount      = 118;    // Het af te rekenen bedrag in centen (!!!)
     //$description = 'Testbetaling'; // Beschrijving die consument op zijn/haar afschrift ziet.
     $return_url = $this->return_url;
     // URL waarnaar de consument teruggestuurd wordt na de betaling
     $report_url = $this->report_url;
     // 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($this->partnerID);
     if ($this->testMode) {
         $iDEAL->setTestMode();
     }
     if (isset($bank_id) and !empty($bank_id)) {
         if ($iDEAL->createPayment($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. */
             $data = array('transactionId' => $iDEAL->getTransactionId(), 'bankUrl' => $iDEAL->getBankURL());
             return $data;
             //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. */
             $data = array('error' => true, 'msg' => $iDEAL->getErrorMessage());
             return $data;
         }
     }
 }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
ファイル: mollie_ideal.php プロジェクト: Ibrahim1/aec
 public function transmitRequestXML($xml, $request)
 {
     require_once dirname(__FILE__) . '/lib/cls.ideal.php';
     $response = array();
     $response['valid'] = false;
     $description = substr(AECToolbox::rewriteEngineRQ($this->settings['description'], $request), 0, 29);
     $report_url = AECToolbox::deadsureURL("index.php?option=com_acctexp&task=mollie_idealnotification");
     $return_url = $request->int_var['return_url'];
     $amount = $request->int_var['amount'] * 100;
     $mollieIdeal = new iDEAL_Payment($this->settings['partner_id']);
     if ($this->settings['testmode']) {
         $mollieIdeal->setTestmode(true);
     } else {
         $mollieIdeal->setTestmode(false);
     }
     if ($mollieIdeal->createPayment($request->int_var['params']['bank_id'], $amount, $description, $return_url, $report_url)) {
         // ...Request valid transaction id from Mollie and store it...
         $request->invoice->secondary_ident = $mollieIdeal->getTransactionId();
         $request->invoice->storeload();
         // Redirect to issuer bank
         aecRedirect($mollieIdeal->getBankURL());
     } else {
         // error handling
         $this->___logError("iDEAL_Payment::createPayment failed", $mollieIdeal->getErrorCode(), $mollieIdeal->getErrorMessage());
         return $response;
     }
     return null;
 }