Ejemplo n.º 1
0
 private function parseResponse($content, $rebill = false)
 {
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_osemsc' . DS . 'libraries' . DS . 'class.connection.php';
     if ($rebill == false) {
         $resArray['ePayTrxnNumber'] = OSECONNECTOR::substring_between($content, '<ePayTrxnNumber>', '</ePayTrxnNumber>');
         $resArray['ePayTrxnStatus'] = OSECONNECTOR::substring_between($content, '<ePayTrxnStatus>', '</ePayTrxnStatus>');
         $resArray['ePayTrxnReference'] = OSECONNECTOR::substring_between($content, '<ePayTrxnReference>', '</ePayTrxnReference>');
         $resArray['ePayAuthCode'] = OSECONNECTOR::substring_between($content, '<ePayAuthCode>', '</ePayAuthCode>');
         $resArray['ePayReturnAmount'] = OSECONNECTOR::substring_between($content, '<ePayReturnAmount>', '</ePayReturnAmount>');
         $resArray['ePayTrxnError'] = OSECONNECTOR::substring_between($content, '<ePayTrxnError>', '</ePayTrxnError>');
     } else {
         $resArray['Result'] = OSECONNECTOR::substring_between($content, '<Result>', '</Result>');
         $resArray['ErrorSeverity'] = OSECONNECTOR::substring_between($content, '<ErrorSeverity>', '</ErrorSeverity>');
         $resArray['ErrorDetails'] = OSECONNECTOR::substring_between($content, '<ErrorDetails>', '</ErrorDetails>');
     }
     return $resArray;
 }
Ejemplo n.º 2
0
 function parse_return($content)
 {
     $refId = OSECONNECTOR::substring_between($content, '<refId>', '</refId>');
     $resultCode = OSECONNECTOR::substring_between($content, '<resultCode>', '</resultCode>');
     $code = OSECONNECTOR::substring_between($content, '<code>', '</code>');
     $text = OSECONNECTOR::substring_between($content, '<text>', '</text>');
     $subscriptionId = OSECONNECTOR::substring_between($content, '<subscriptionId>', '</subscriptionId>');
     $Status = OSECONNECTOR::substring_between($content, '<Status>', '</Status>');
     if (!empty($Status)) {
         return array($refId, $resultCode, $code, $text, $subscriptionId, $Status);
     } else {
         return array($refId, $resultCode, $code, $text, $subscriptionId);
     }
 }
Ejemplo n.º 3
0
 function BeanStreamDeleteProfile($orderInfo, $params = array())
 {
     require_once OSEMSC_B_LIB . DS . 'class.connection.php';
     //$orderInfo = oseRegistry::call('payment')->getOrder(array('order_id'=>319),'obj');
     $pConfig = oseRegistry::call('msc')->getConfig('payment', 'obj');
     $merchant_id = $pConfig->beanstream_merchant_id;
     $passcode = $pConfig->beanstream_passcode;
     $orderInfoParams = oseJson::decode($orderInfo->params);
     $postVar = array();
     $postVar['serviceVersion'] = '1.0';
     $postVar['operationType'] = 'M';
     $postVar['merchantId'] = $merchant_id;
     $postVar['passcode'] = $passcode;
     $postVar['rbAccountID'] = $orderInfo->payment_serial_number;
     $postVar['rbBillingState'] = 'C';
     $postVar['processBackPayments'] = '0';
     $postVar['ref5'] = '';
     $hostname = 'www.beanstream.com';
     $workstring = http_build_query($postVar);
     $uri = "/scripts/recurring_billing.asp";
     $res = OSECONNECTOR::send_request_via_fsockopen($hostname, $uri, $workstring, 'urlencoded');
     $res = stristr($res, "\r\n\r\n");
     $res = trim($res);
     //$post = array();
     //parse_str($res,$post);
     $result = array();
     $code = OSECONNECTOR::substring_between($res, '<code>', '</code>');
     $message = OSECONNECTOR::substring_between($res, '<message>', '</message>');
     $result['success'] = $code == 1 ? true : false;
     $result['title'] = JText::_('Cancel');
     $result['content'] = $code == 1 ? JText::_('Your membership subscription is cancelled.') : JText::_('Error') . ':' . $message;
     return $result;
 }