public function process()
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Currencies = Registry::get('Currencies');
     if (!isset($_SESSION['Shop']['PM']['PAYPAL']['EC']['TOKEN'])) {
         $this->initializeExpressCheckout();
     }
     $params = array('TOKEN' => $_SESSION['Shop']['PM']['PAYPAL']['EC']['TOKEN'], 'PAYERID' => $_SESSION['Shop']['PM']['PAYPAL']['EC']['PAYERID'], 'AMT' => $OSCOM_ShoppingCart->getTotal(), 'CURRENCYCODE' => $OSCOM_Currencies->getCode());
     if ($OSCOM_ShoppingCart->hasShippingAddress()) {
         $params['SHIPTONAME'] = $OSCOM_ShoppingCart->getShippingAddress('firstname') . ' ' . $OSCOM_ShoppingCart->getShippingAddress('lastname');
         $params['SHIPTOSTREET'] = $OSCOM_ShoppingCart->getShippingAddress('street_address');
         $params['SHIPTOCITY'] = $OSCOM_ShoppingCart->getShippingAddress('city');
         $params['SHIPTOSTATE'] = $OSCOM_ShoppingCart->getShippingAddress('zone_code');
         $params['SHIPTOCOUNTRYCODE'] = $OSCOM_ShoppingCart->getShippingAddress('country_iso_code_2');
         $params['SHIPTOZIP'] = $OSCOM_ShoppingCart->getShippingAddress('postcode');
     }
     $response_array = $this->doExpressCheckoutPayment($params);
     if ($response_array['ACK'] != 'Success' && $response_array['ACK'] != 'SuccessWithWarning') {
         OSCOM::redirect(OSCOM::getLink(null, 'Cart', 'error_message=' . stripslashes($response_array['L_LONGMESSAGE0']), 'SSL'));
     }
     $this->_order_id = Order::insert();
     Order::process($this->_order_id, $this->_order_status);
     unset($_SESSION['Shop']['PM']['PAYPAL']);
 }
Ejemplo n.º 2
0
 public function process()
 {
     $this->_order_id = Order::insert();
     Order::process($this->_order_id, $this->_order_status);
 }