protected function callbackInit($request) { if (preg_match($this->pattern, ifset($request['ik_pm_no']), $matches)) { $this->app_id = $matches[1]; $this->merchant_id = $matches[2]; } return parent::callbackInit($request); }
protected function callbackInit($request) { $this->raw_xml = base64_decode(ifempty($request['operation_xml'], 'PHJlc3BvbnNlLz4=')); if ($this->raw_xml && ($this->xml = @simplexml_load_string($this->raw_xml))) { if (preg_match($this->pattern, (string) $this->xml->order_id, $matches)) { $this->app_id = $matches[1]; $this->merchant_id = $matches[2]; } } return parent::callbackInit($request); }
protected function callbackInit($request) { $this->request = $request; $pattern = '/^([a-z]+)_(.+)_(.+)$/'; if (!empty($request['orderNumber']) && preg_match($pattern, $request['orderNumber'], $match)) { $this->app_id = $match[1]; $this->merchant_id = $match[2]; $this->order_id = $match[3]; } return parent::callbackInit($request); }
protected function callbackInit($request) { if (!empty($request['merchants_id'])) { $this->app_id = $request[app_id]; $this->merchant_id = $request[merchants_id]; list($this->order_id, ) = explode(self::ORDER_SEPARATOR, $request['order_id']); } else { throw new waPaymentException('Invalid invoice number'); } return parent::callbackInit($request); }
protected function callbackInit($request) { if (!empty($request['LMI_PAYMENT_NO']) && !empty($request['wa_app']) && !empty($request['wa_merchant_contact_id'])) { $this->app_id = $request['wa_app']; $this->merchant_id = $request['wa_merchant_contact_id']; } else { self::log($this->id, array('error' => 'empty required field(s)')); throw new waException('Empty required field(s)'); } return parent::callbackInit($request); }
protected function callbackInit($request) { if (isset($request['item_number']) && preg_match('/^(.+)_(.+)_(.+)$/', $request['item_number'], $match)) { $this->app_id = $match[1]; $this->merchant_id = $match[2]; $this->order_id = $match[3]; } else { throw new waPaymentException('Invalid invoice number'); } return parent::callbackInit($request); }
protected function callbackInit($request) { if (empty($request['x_invoice_num']) || empty($request['wa_app_id']) || empty($request['wa_merchant_id'])) { self::log($this->id, 'Invalid transaction data'); throw new waException('Invalid transaction data'); } else { $this->app_id = $request['wa_app_id']; $this->merchant_id = $request['wa_merchant_id']; } return parent::callbackInit($request); }
public function callbackInit($request) { $pattern = '/^([a-z]+)_(.+)$/'; if (!empty($request['OrderId']) && preg_match($pattern, $request['OrderId'], $match)) { $this->app_id = $match[1]; $this->merchant_id = ifempty($request['wa_merchant_id'], ''); $this->order_id = $match[2]; } elseif (!empty($request['app_id'])) { $this->app_id = $request['app_id']; } return parent::callbackInit($request); }
protected function callbackInit($request) { $pattern = '/^([a-z]+)_(.+)_(.+)$/'; $data = array(); parse_str(ifset($request['payment']), $data); if (!empty($data['order']) && preg_match($pattern, $data['order'], $match)) { $this->app_id = $match[1]; $this->merchant_id = $match[2]; $this->order_id = $match[3]; } return parent::callbackInit($request); }
protected function callbackInit($request) { if (!empty($request['orderId']) && !empty($request['params'])) { $params = json_decode(base64_decode($request['params']), true); if (!empty($params['app_id']) && !empty($params['merchant_id'])) { $this->app_id = $params['app_id']; $this->merchant_id = $params['merchant_id']; } $this->order_id = $request['orderId']; } elseif (!empty($request['app_id'])) { $this->app_id = $request['app_id']; } return parent::callbackInit($request); }
/** * Plugin initialization for processing callbacks received from payment gateway. * * To process callback URLs of the form /payments.php/paypal/*, * corresponding app and id must be determined for correct initialization of plugin settings. * @param array $request Request data array ($_REQUEST) * @return waPayment * @throws waPaymentException */ protected function callbackInit($request) { // parsing data to obtain order id as well as ids of corresponding app and plugin setup instance responsible // for callback processing if (isset($request['item_number']) && preg_match('/^(.+)_(.+)_(.+)$/', $request['item_number'], $match)) { $this->app_id = $match[1]; $this->merchant_id = $match[2]; $this->order_id = $match[3]; } else { throw new waPaymentException('Invalid invoice number'); } // calling parent's method to continue plugin initialization return parent::callbackInit($request); }
/** * @param array $request * @return waPayment */ public function callbackInit($request) { $this->request = $request; if (!empty($request['tx_code'])) { $unpack = $this->unpackTransactionCode($request['tx_code']); $this->app_id = $unpack[0]; $this->merchant_id = $unpack[1]; $this->order_id = $unpack[2]; } return parent::callbackInit($request); }
protected function callbackInit($request) { $pattern = '/^([a-z]+)_(.+)$/'; if (!empty($request['InvId']) && intval($request['InvId'])) { $this->app_id = ifempty($request['shp_wa_app_id']); $this->merchant_id = ifempty($request['shp_wa_merchant_id']); $this->order_id = intval($request['InvId']); } elseif (!empty($request['app_id'])) { $this->app_id = $request['app_id']; } return parent::callbackInit($request); }
/** * @param array $request * @return waPayment */ public function callbackInit($request) { $this->request = $request; if (!empty($request['sessionId'])) { $unpack = $this->unpackSessionId($request['sessionId']); $this->app_id = $unpack[0]; $this->merchant_id = $unpack[1]; $this->order_id = $unpack[2]; } return parent::callbackInit($request); }
protected function callbackInit($request) { $pattern = "@^(_TEST_)?([a-z]+)_(\\d+)_(.+)\$@"; $this->post = !empty($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : null; /** * * Request * @var SimpleXMLElement */ if ($this->post && empty($request['bill_id'])) { $xml = new SimpleXMLElement($this->post); if ($txn_xpath = $xml->xpath('/soap:Envelope/soap:Body[1]/*[1]/txn[1]')) { $txn = (string) reset($txn_xpath); if ($txn && preg_match($pattern, $txn, $match)) { $this->app_id = $match[2]; $this->merchant_id = $match[3]; $this->order_id = $match[4]; $this->callback_test = !empty($match[1]); } if ($update_bill = $xml->xpath('/soap:Envelope/soap:Body[1]/*[1]')) { self::log($this->id, reset($update_bill)->asXml()); } } $this->callback_protocol = self::SOAP; } elseif (!empty($request['order']) && preg_match($pattern, $request['order'], $match)) { $this->app_id = $match[2]; $this->merchant_id = $match[3]; $this->order_id = $match[4]; } elseif (!empty($request['bill_id']) && preg_match($pattern, $request['bill_id'], $match)) { if (empty($match[1]) || $this->test) { $this->app_id = $match[2]; $this->merchant_id = $match[3]; $this->order_id = $match[4]; $this->callback_test = !empty($match[1]); } else { self::log($this->id, 'Ignore test request from QIWI', array('app_id' => $match[2], 'merchant_id' => $match[3], 'order_id' => $match[4])); } $this->callback_protocol = self::REST; } elseif (isset($request['wsdl'])) { $this->callback_protocol = self::SOAP; } return parent::callbackInit($request); }
protected function callbackInit($request) { $this->request = $request; $this->app_id = $request['M_app_id']; $this->merchant_id = $request['M_merchant_id']; $this->order_id = $request['M_order_id']; return parent::callbackInit($request); }
protected function callbackInit($request) { $this->post = !empty($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : null; /** * * Request * @var SimpleXMLElement */ if ($this->post) { $xml = new SimpleXMLElement($this->post); if ($txn_xpath = $xml->xpath('/soap:Envelope/soap:Body[1]/*[1]/txn[1]')) { $txn = (string) reset($txn_xpath); $pattern = "@^([a-z]+)_(\\d+)_(.+)\$@"; if ($txn && preg_match($pattern, $txn, $match)) { $this->app_id = $match[1]; $this->merchant_id = $match[2]; $this->order_id = $match[3]; } if ($update_bill = $xml->xpath('/soap:Envelope/soap:Body[1]/*[1]')) { self::log($this->id, reset($update_bill)->asXml()); } } } return parent::callbackInit($request); }
protected function callbackInit($request) { if (!empty($request['InvId']) && intval($request['InvId'])) { $this->app_id = ifempty($request['shp_wa_app_id']); $this->merchant_id = ifempty($request['shp_wa_merchant_id']); $this->request_testmode = ifempty($request['shp_wa_testmode']); $this->order_id = intval($request['InvId']); } elseif (!empty($request['app_id'])) { $this->app_id = $request['app_id']; } return parent::callbackInit($request); }