本文整理汇总了PHP中osC_Order::process方法的典型用法代码示例。如果您正苦于以下问题:PHP osC_Order::process方法的具体用法?PHP osC_Order::process怎么用?PHP osC_Order::process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osC_Order
的用法示例。
在下文中一共展示了osC_Order::process方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: osC_Checkout_Process
function osC_Checkout_Process()
{
global $osC_Session, $osC_ShoppingCart, $osC_Customer, $osC_NavigationHistory, $osC_Payment;
if ($osC_ShoppingCart->hasContents() === false) {
osc_redirect(osc_href_link(FILENAME_CHECKOUT, null, 'SSL'));
}
// if no shipping method has been selected, redirect the customer to the shipping method selection page
if ($osC_ShoppingCart->hasShippingMethod() === false && $osC_ShoppingCart->getContentType() != 'virtual') {
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
}
if ($osC_ShoppingCart->hasBillingMethod()) {
// load selected payment module
include 'includes/classes/payment.php';
$osC_Payment = new osC_Payment($osC_ShoppingCart->getBillingMethod('id'));
}
include 'includes/classes/order.php';
if ($osC_ShoppingCart->hasBillingMethod()) {
$osC_Payment->process();
} else {
$orders_id = osC_Order::insert();
osC_Order::process($orders_id, ORDERS_STATUS_PAID);
}
$osC_ShoppingCart->reset(true);
// unregister session variables used during checkout
unset($_SESSION['comments']);
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'success', 'SSL'));
}
示例2: callback
//.........这里部分代码省略.........
}
if ($check) {
$Qcheck = $osC_Database->query('select orders_status, currency, currency_value from :table_orders where orders_id = :orders_id');
$Qcheck->bindTable(':table_orders', TABLE_ORDERS);
$Qcheck->bindInt(':orders_id', $_POST['invoice']);
$Qcheck->bindInt(':customers_id', $_POST['custom']);
$Qcheck->execute();
if ($Qcheck->numberOfRows() > 0) {
$order = $Qcheck->toArray();
$Qtotal = $osC_Database->query('select value from :table_orders_total where orders_id = :orders_id and class = "total" limit 1');
$Qtotal->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
$Qtotal->bindInt(':orders_id', $_POST['invoice']);
$Qtotal->execute();
$total = $Qtotal->toArray();
if (number_format($_POST['invoice_amount'], $osC_Currencies->getDecimalPlaces($order['currency'])) != number_format($total['value'] * $order['currency_value'], $osC_Currencies->getDecimalPlaces($order['currency']))) {
$check = false;
$result = 'Inpay transaction value (' . osc_output_string_protected($_POST['invoice_amount']) . ') does not match order value (' . number_format($total['value'] * $order['currency_value'], $osC_Currencies->get_decimal_places($order['currency'])) . ')';
}
}
}
if ($check) {
// check status
$delivered_status = 7;
if ($order['orders_status'] == MODULE_PAYMENT_INPAY_COMP_ORDER_STATUS_ID || $order['orders_status'] == $delivered_status) {
$check = false;
$result = 'Status already in level' . $order['orders_status'];
}
}
if ($check) {
$invoice_status = $this->get_invoice_status($_POST);
$check = false;
if (($invoice_status == "pending" || $invoice_status == "created") && ($_POST["invoice_status"] == "pending" || $POST["invoice_status"] == "created")) {
$check = true;
} else {
if ($invoice_status == "approved" && $_POST["invoice_status"] == "approved") {
$check = true;
} else {
if ($invoice_status == "sum_too_low" && $_POST["invoice_status"] == "sum_too_low") {
$check = true;
}
}
}
if (!$check) {
$result = 'Bad invoice status:' . $invoice_status;
}
}
// Validate request end
if ($result == 'VERIFIED') {
$invoice_approved = false;
$invoice_created = false;
$invoice_partial = false;
switch ($_POST['invoice_status']) {
case 'created':
case 'pending':
$msg = "customer has been asked to pay " . $_POST['invoice_amount'] . ' ' . $_POST['invoice_currency'] . ' with reference: ' . $_POST['invoice_reference'] . ' via his online bank';
$order_status_id = MODULE_PAYMENT_INPAY_CREATE_ORDER_STATUS_ID;
$invoice_created = true;
break;
case "approved":
$msg = "Inpay has confirmed that the payment of " . $_POST['invoice_amount'] . " " . $_POST['invoice_currency'] . " has been received";
$order_status_id = MODULE_PAYMENT_INPAY_COMP_ORDER_STATUS_ID;
$invoice_approved = true;
break;
case "sum_too_low":
$msg = "Partial payment received by inpay. Reference: " . $_POST['invoice_reference'];
$order_status_id = MODULE_PAYMENT_INPAY_SUM_TOO_LOW_ORDER_STATUS_ID;
$invoice_partial = true;
break;
}
$comments = 'Inpay ' . ucfirst($_POST['invoice_status']) . '[' . $msg . ']';
if ($invoice_approved || $invoice_created || $invoice_partial) {
osC_Order::process($_POST['order_id'], $order_status_id, $comments);
osC_Order::insertOrderStatusHistory($_POST['order_id'], $order_status_id, $comments);
} else {
if (defined('MODULE_PAYMENT_INPAY_DEBUG_EMAIL')) {
$email_body = 'INPAY_DEBUG_POST_DATA:' . "\n\n";
reset($_POST);
foreach ($_POST as $key => $value) {
$email_body .= $key . '=' . $value . "\n";
}
$email_body .= "\n" . 'INPAY_DEBUG_GET_DATA:' . "\n\n";
reset($_GET);
foreach ($_GET as $key => $value) {
$email_body .= $key . '=' . $value . "\n";
}
osc_email('', MODULE_PAYMENT_INPAY_DEBUG_EMAIL, 'Inpay Invalid Process', $email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
if (isset($_POST['order_id']) && is_numeric($_POST['order_id']) && $_POST['order_id'] > 0) {
$Qcheck = $osC_Database->query('select orders_id from :table_orders where orders_id=:orders_id');
$Qcheck->bindTable(':table_orders', TABLE_ORDERS);
$Qcheck->bindInt('orders_id', $_POST['order_id']);
$Qcheck->execute();
if ($Qcheck->numberOfRows() > 0) {
$comments = 'Inpay Invalid [' . $result . ']';
osC_Order::insertOrderStatusHistory($_POST['order_id'], $order_status_id, $comments);
}
}
}
}
}
示例3: process
function process()
{
$this->_order_id = osC_Order::insert();
osC_Order::process($this->_order_id, $this->order_status);
}
示例4: process
function process()
{
global $osC_Currencies, $osC_ShoppingCart, $messageStack, $osC_Session;
header('Processing, please wait..');
$error = false;
if (isset($_POST['x_response_code']) && $_POST['x_response_code'] == '1') {
if (MODULE_PAYMENT_AUTHORIZENET_CC_SIM_MD5_HASH != NULL && (isset($_POST['x_MD5_Hash']) && $_POST['x_MD5_Hash'] != strtoupper(md5(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_MD5_HASH . MODULE_PAYMENT_AUTHORIZENET_CC_SIM_API_LOGIN_ID . $_POST['x_trans_id'] . $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal()))))) {
$error = 'verification';
} else {
if (isset($_POST['x_amount']) && $_POST['x_amount'] != $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal())) {
$error = 'verification';
}
}
} else {
if ($_POST['x_response_code'] == '2') {
$error = 'declined';
} else {
$error = 'general';
}
}
if ($error != false) {
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout&sid=' . $_POST['sid'] . '&error=' . $error, '', false, false, true));
} else {
$orders_id = osC_Order::insert();
osC_Order::process($orders_id, $this->order_status);
$osC_ShoppingCart->reset(true);
// unregister session variables used during checkout
unset($_SESSION['comments']);
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'success&sid=' . $osC_Session->getID(), 'SSL'));
}
}
示例5: process
function process()
{
global $osC_Database, $osC_MessageStack, $osC_Customer, $osC_Language, $osC_Currencies, $osC_ShoppingCart;
$this->_verifyData();
$this->_order_id = osC_Order::insert();
$params = array('x_version' => '3.1', 'x_delim_data' => 'TRUE', 'x_delim_char' => ',', 'x_encap_char' => '"', 'x_relay_response' => 'FALSE', 'x_login' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN_ID, 'x_tran_key' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TRANSACTION_KEY, 'x_amount' => $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $osC_Currencies->getCode()), 'x_currency_code' => $osC_Currencies->getCode(), 'x_method' => 'ECHECK', 'x_bank_aba_code' => $_POST['authorizenet_echeck_routing_code'], 'x_bank_acct_num' => $_POST['authorizenet_echeck_account_number'], 'x_bank_acct_type' => $_POST['authorizenet_echeck_account_type'], 'x_bank_name' => $_POST['authorizenet_echeck_bank_name'], 'x_bank_acct_name' => $_POST['authorizenet_echeck_owner'], 'x_echeck_type' => 'WEB', 'x_type' => 'AUTH_ONLY', 'x_first_name' => $osC_ShoppingCart->getBillingAddress('firstname'), 'x_last_name' => $osC_ShoppingCart->getBillingAddress('lastname'), 'x_company' => $osC_ShoppingCart->getBillingAddress('company'), 'x_address' => $osC_ShoppingCart->getBillingAddress('street_address'), 'x_city' => $osC_ShoppingCart->getBillingAddress('city'), 'x_state' => $osC_ShoppingCart->getBillingAddress('state'), 'x_zip' => $osC_ShoppingCart->getBillingAddress('postcode'), 'x_country' => $osC_ShoppingCart->getBillingAddress('country_iso_code_2'), 'x_cust_id' => $osC_Customer->getID(), 'x_customer_ip' => osc_get_ip_address(), 'x_invoice_num' => $this->_order_id, 'x_email' => $osC_Customer->getEmailAddress(), 'x_email_customer' => 'FALSE', 'x_ship_to_first_name' => $osC_ShoppingCart->getShippingAddress('firstname'), 'x_ship_to_last_name' => $osC_ShoppingCart->getShippingAddress('lastname'), 'x_ship_to_company' => $osC_ShoppingCart->getShippingAddress('company'), 'x_ship_to_address' => $osC_ShoppingCart->getShippingAddress('street_address'), 'x_ship_to_city' => $osC_ShoppingCart->getShippingAddress('city'), 'x_ship_to_state' => $osC_ShoppingCart->getShippingAddress('state'), 'x_ship_to_zip' => $osC_ShoppingCart->getShippingAddress('postcode'), 'x_ship_to_country' => $osC_ShoppingCart->getShippingAddress('country_iso_code_2'));
if (ACCOUNT_TELEPHONE > -1) {
$params['x_phone'] = $osC_ShoppingCart->getBillingAddress('telephone_number');
}
if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_TRANSACTION_TEST_MODE == '1') {
$params['x_test_request'] = 'TRUE';
}
if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_VERIFY_WITH_WF_SS == '1') {
$params['x_customer_organization_type'] = $_POST['authorizenet_echeck_org_type'];
$params['x_customer_tax_id'] = $_POST['authorizenet_echeck_tax_id'];
}
$post_string = '';
foreach ($params as $key => $value) {
$post_string .= $key . '=' . urlencode(trim($value)) . '&';
}
$post_string = substr($post_string, 0, -1);
$this->_transaction_response = $this->sendTransactionToGateway($this->_gateway_url, $post_string);
if (empty($this->_transaction_response) === false) {
$regs = preg_split("/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/", $this->_transaction_response);
foreach ($regs as $key => $value) {
$regs[$key] = substr($value, 1, -1);
// remove double quotes
}
} else {
$regs = array('-1', '-1', '-1');
}
$error = false;
if ($regs[0] == '1') {
if (!osc_empty(MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5_HASH)) {
if (strtoupper($regs[37]) != strtoupper(md5(MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5_HASH . MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN_ID . $regs[6] . $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $osC_Currencies->getCode())))) {
$error = $osC_Language->get('payment_authorizenet_echeck_error_general');
}
}
} else {
switch ($regs[2]) {
case '9':
$error = $osC_Language->get('payment_authorizenet_echeck_error_invalid_routing_code');
break;
case '10':
$error = $osC_Language->get('payment_authorizenet_echeck_error_invalid_account');
break;
case '77':
$error = $osC_Language->get('payment_authorizenet_echeck_error_invalid_tax_id');
break;
default:
$error = $osC_Language->get('payment_authorizenet_echeck_error_general');
break;
}
}
if ($error === false) {
osC_Order::process($this->_order_id, $this->order_status);
$Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
$Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
$Qtransaction->bindInt(':orders_id', $this->_order_id);
$Qtransaction->bindInt(':transaction_code', 1);
$Qtransaction->bindValue(':transaction_return_value', $this->_transaction_response);
$Qtransaction->bindInt(':transaction_return_status', 1);
$Qtransaction->execute();
} else {
osC_Order::remove($this->_order_id);
$osC_MessageStack->add('checkout_payment', $error, 'error');
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment&authorizenet_echeck_owner=' . $_POST['authorizenet_echeck_owner'] . '&authorizenet_echeck_account_type=' . $_POST['authorizenet_echeck_account_type'] . '&authorizenet_echeck_bank_name=' . $_POST['authorizenet_echeck_bank_name'] . '&authorizenet_echeck_routing_code=' . $_POST['authorizenet_echeck_routing_code'], 'SSL'));
}
}
示例6: process
function process()
{
global $osC_Database, $osC_Customer, $osC_Currencies, $osC_ShoppingCart, $osC_Language, $osC_MessageStack, $osC_CreditCard;
$this->_verifyData();
$this->_order_id = osC_Order::insert();
$params = array('spPassword' => MODULE_PAYMENT_SAFERPAY_CC_PASSWORD, 'ACCOUNTID' => MODULE_PAYMENT_SAFERPAY_CC_ACCOUNT_ID, 'ORDERID' => $this->_order_id, 'NAME' => $osC_CreditCard->getOwner(), 'PAN' => $osC_CreditCard->getNumber(), 'EXP' => $osC_CreditCard->getExpiryMonth() . substr($osC_CreditCard->getExpiryYear(), -2), 'AMOUNT' => $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $osC_Currencies->getCode()) * 100, 'CURRENCY' => $osC_Currencies->getCode());
if (MODULE_PAYMENT_SAFERPAY_CC_VERIFY_WITH_CVC == '1') {
$params['CVC'] = $osC_CreditCard->getCVC();
}
$post_string = '';
foreach ($params as $key => $value) {
$post_string .= $key . '=' . urlencode(trim($value)) . '&';
}
$post_string = substr($post_string, 0, -1);
$this->_transaction_response = $this->sendTransactionToGateway('https://support.saferpay.de/scripts/Execute.asp', $post_string);
$error = false;
if (substr($this->_transaction_response, 0, 3) == 'OK:') {
$this->_transaction_response = trim(substr($this->_transaction_response, 3));
$osC_XML = new osC_XML($this->_transaction_response);
$result = $osC_XML->toArray();
switch ($result['IDP attr']['RESULT']) {
case '0':
//success
break;
case '62':
case '63':
case '64':
$error = $osC_Language->get('payment_saferpay_cc_error_' . (int) $result['IDP attr']['RESULT']);
break;
default:
$error = $osC_Language->get('payment_saferpay_cc_error_general');
break;
}
} else {
$error = $osC_Language->get('payment_saferpay_cc_error_general');
}
if ($error === false) {
osC_Order::process($this->_order_id, $this->order_status);
$Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
$Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
$Qtransaction->bindInt(':orders_id', $this->_order_id);
$Qtransaction->bindInt(':transaction_code', 1);
$Qtransaction->bindValue(':transaction_return_value', $this->_transaction_response);
$Qtransaction->bindInt(':transaction_return_status', 1);
$Qtransaction->execute();
} else {
osC_Order::remove($this->_order_id);
$osC_MessageStack->add('checkout_payment', $error, 'error');
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment&saferpay_cc_owner=' . $osC_CreditCard->getOwner() . '&saferpay_cc_expires_month=' . $osC_CreditCard->getExpiryMonth() . '&saferpay_cc_expires_year=' . $osC_CreditCard->getExpiryYear() . (MODULE_PAYMENT_SAFERPAY_CC_VERIFY_WITH_CVC == '1' ? '&saferpay_cc_cvc=' . $osC_CreditCard->getCVC() : ''), 'SSL'));
}
}
示例7: callback
function callback()
{
global $osC_Database;
if (isset($_POST['invoice']) && is_numeric($_POST['invoice']) && isset($_POST['receiver_email']) && $_POST['receiver_email'] == MODULE_PAYMENT_PAYPAL_IPN_ID && isset($_POST['verify_sign']) && empty($_POST['verify_sign']) === false && isset($_POST['txn_id']) && empty($_POST['txn_id']) === false) {
if (!osc_empty(MODULE_PAYMENT_PAYPAL_IPN_SECRET_KEY)) {
if (isset($_GET['secret']) && $_GET['secret'] == MODULE_PAYMENT_PAYPAL_IPN_SECRET_KEY) {
$pass = true;
} else {
$pass = false;
}
} else {
$pass = true;
}
if ($pass === true && osC_Order::getStatusID($_POST['invoice']) === ORDERS_STATUS_PREPARING) {
$post_string = 'cmd=_notify-validate&';
foreach ($_POST as $key => $value) {
$post_string .= $key . '=' . urlencode($value) . '&';
}
$post_string = substr($post_string, 0, -1);
$this->_transaction_response = $this->sendTransactionToGateway($this->form_action_url, $post_string);
$post_array = array('root' => $_POST);
$post_array['root']['transaction_response'] = trim($this->_transaction_response);
$osC_XML = new osC_XML($post_array);
if (strtoupper(trim($this->_transaction_response)) == 'VERIFIED') {
osC_Order::process($_POST['invoice'], $this->order_status);
}
$Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
$Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
$Qtransaction->bindInt(':orders_id', $_POST['invoice']);
$Qtransaction->bindInt(':transaction_code', 1);
$Qtransaction->bindValue(':transaction_return_value', $osC_XML->toXML());
$Qtransaction->bindInt(':transaction_return_status', strtoupper(trim($this->_transaction_response)) == 'VERIFIED' ? 1 : 0);
$Qtransaction->execute();
}
}
}
示例8: process
function process()
{
global $osC_Database, $osC_Customer, $osC_Currencies, $osC_ShoppingCart, $osC_Language, $messageStack, $osC_CreditCard;
$this->_verifyData();
$this->_order_id = osC_Order::insert();
$post_string = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<WIRECARD_BXML xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:noNamespaceSchemaLocation="wirecard.xsd">' . "\n" . ' <W_REQUEST>' . "\n" . ' <W_JOB>' . "\n" . ' <JobID>Job 1</JobID>' . "\n" . ' <BusinessCaseSignature>' . MODULE_PAYMENT_WIRECARD_CC_BUSINESS_SIGNATURE . '</BusinessCaseSignature>' . "\n" . ' <FNC_CC_PREAUTHORIZATION>' . "\n" . ' <FunctionID>Preauthorization 1</FunctionID>' . "\n" . ' <CC_TRANSACTION mode="' . MODULE_PAYMENT_WIRECARD_CC_TRANSACTION_MODE . '">' . "\n" . ' <TransactionID>' . $this->_order_id . '</TransactionID>' . "\n" . ' <CommerceType>eCommerce</CommerceType>' . "\n" . ' <Amount>' . $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $osC_Currencies->getCode()) * 100 . '</Amount>' . "\n" . ' <Currency>' . $osC_Currencies->getCode() . '</Currency>' . "\n" . ' <CountryCode>' . osC_Address::getCountryIsoCode2(STORE_COUNTRY) . '</CountryCode>' . "\n" . ' <Usage>' . STORE_NAME . '</Usage>' . "\n" . ' <RECURRING_TRANSACTION>' . "\n" . ' <Type>Single</Type>' . "\n" . ' </RECURRING_TRANSACTION>' . "\n" . ' <CREDIT_CARD_DATA>' . "\n" . ' <CreditCardNumber>' . $osC_CreditCard->getNumber() . '</CreditCardNumber>' . "\n";
if (MODULE_PAYMENT_WIRECARD_CC_VERIFY_WITH_CVC == '1') {
$post_string .= ' <CVC2>' . $osC_CreditCard->getCVC() . '</CVC2>' . "\n";
}
$post_string .= ' <ExpirationYear>' . $osC_CreditCard->getExpiryYear() . '</ExpirationYear>' . "\n" . ' <ExpirationMonth>' . $osC_CreditCard->getExpiryMonth() . '</ExpirationMonth>' . "\n" . ' <CardHolderName>' . $osC_CreditCard->getOwner() . '</CardHolderName>' . "\n" . ' </CREDIT_CARD_DATA>' . "\n" . ' <CONTACT_DATA>' . "\n" . ' <IPAddress>' . osc_get_ip_address() . '</IPAddress>' . "\n" . ' </CONTACT_DATA>' . "\n" . ' <CORPTRUSTCENTER_DATA>' . "\n" . ' <ADDRESS>' . "\n" . ' <FirstName>' . $osC_ShoppingCart->getBillingAddress('firstname') . '</FirstName>' . "\n" . ' <LastName>' . $osC_ShoppingCart->getBillingAddress('lastname') . '</LastName>' . "\n" . ' <Address1>' . $osC_ShoppingCart->getBillingAddress('street_address') . '</Address1>' . "\n" . ' <City>' . $osC_ShoppingCart->getBillingAddress('city') . '</City>' . "\n" . ' <ZipCode>' . $osC_ShoppingCart->getBillingAddress('postcode') . '</ZipCode>' . "\n";
if (osc_empty($osC_ShoppingCart->getBillingAddress('zone_code')) === false) {
$post_string .= ' <State>' . $osC_ShoppingCart->getBillingAddress('zone_code') . '</State>' . "\n";
}
$post_string .= ' <Country>' . $osC_ShoppingCart->getBillingAddress('country_iso_code_2') . '</Country>' . "\n" . ' <Phone>' . $osC_ShoppingCart->getBillingAddress('telephone_number') . '</Phone>' . "\n" . ' <Email>' . $osC_Customer->getEmailAddress() . '</Email>' . "\n" . ' </ADDRESS>' . "\n" . ' </CORPTRUSTCENTER_DATA>' . "\n" . ' </CC_TRANSACTION>' . "\n" . ' </FNC_CC_PREAUTHORIZATION>' . "\n" . ' </W_JOB>' . "\n" . ' </W_REQUEST>' . "\n" . '</WIRECARD_BXML>';
$this->_transaction_response = $this->sendTransactionToGateway($this->_gateway_url, $post_string, array('Content-type: text/xml'));
if (empty($this->_transaction_response) === false) {
$osC_XML = new osC_XML($this->_transaction_response);
$result = $osC_XML->toArray();
} else {
$result = array();
}
$error = false;
if (isset($result['WIRECARD_BXML']['W_RESPONSE']['W_JOB']['FNC_CC_PREAUTHORIZATION']['CC_TRANSACTION']['PROCESSING_STATUS']['FunctionResult'])) {
if ($result['WIRECARD_BXML']['W_RESPONSE']['W_JOB']['FNC_CC_PREAUTHORIZATION']['CC_TRANSACTION']['PROCESSING_STATUS']['FunctionResult'] != 'ACK') {
$errno = $result['WIRECARD_BXML']['W_RESPONSE']['W_JOB']['FNC_CC_PREAUTHORIZATION']['CC_TRANSACTION']['PROCESSING_STATUS']['ERROR']['Number'];
switch ($errno) {
case '14':
case '20109':
$error = $osC_Language->get('payment_wirecard_cc_error_unkown_card');
break;
case '33':
case '20071':
$error = $osC_Language->get('payment_wirecard_cc_error_' . (int) $errno);
break;
default:
$error = $osC_Language->get('payment_wirecard_cc_error_general');
break;
}
}
} else {
$error = $osC_Language->get('payment_wirecard_cc_error_general');
}
if ($error === false) {
osC_Order::process($this->_order_id, $this->order_status);
$Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
$Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
$Qtransaction->bindInt(':orders_id', $this->_order_id);
$Qtransaction->bindInt(':transaction_code', 1);
$Qtransaction->bindValue(':transaction_return_value', $this->_transaction_response);
$Qtransaction->bindInt(':transaction_return_status', 1);
$Qtransaction->execute();
} else {
osC_Order::remove($this->_order_id);
$messageStack->add_session('checkout_payment', $error, 'error');
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment&wirecard_cc_owner=' . $osC_CreditCard->getOwner() . '&wirecard_cc_expires_month=' . $osC_CreditCard->getExpiryMonth() . '&wirecard_cc_expires_year=' . $osC_CreditCard->getExpiryYear() . (MODULE_PAYMENT_WIRECARD_CC_VERIFY_WITH_CVC == '1' ? '&wirecard_cc_cvc=' . $osC_CreditCard->getCVC() : ''), 'SSL'));
}
}
示例9: process
function process()
{
global $osC_Currencies, $osC_ShoppingCart, $osC_Customer, $osC_Language, $messageStack;
if (isset($_GET['crypt']) && osc_not_null($_GET['crypt'])) {
$transaction_response = $this->simpleXor($this->base64Decode($_GET['crypt']), MODULE_PAYMENT_SAGE_PAY_FORM_ENCRYPTION_PASSWORD);
$string_array = explode('&', $transaction_response);
$return = array('Status' => null);
foreach ($string_array as $string) {
if (strpos($string, '=') != false) {
$parts = explode('=', $string, 2);
$return[trim($parts[0])] = trim($parts[1]);
}
}
if ($return['Status'] != 'OK' && $return['Status'] != 'AUTHENTICATED' && $return['Status'] != 'REGISTERED') {
$error = $this->getErrorMessageNumber($return['StatusDetail']);
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout' . osc_not_null($error) ? '&error=' . $error : '', 'SSL'));
}
if (isset($return['VPSTxId'])) {
$orders_id = osC_Order::insert();
$sagepay_comments = 'Sage Pay Reference ID: ' . $return['VPSTxId'] . (osc_not_null($_SESSION['comments']) ? "\n\n" . $_SESSION['comments'] : '');
osC_Order::process($orders_id, $this->order_status, $sagepay_comments);
}
} else {
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout', 'SSL'));
}
}
示例10: process
function process()
{
global $osC_Language, $osC_Customer, $osC_ShoppingCart, $_POST, $_GET, $messageStack, $osC_Database;
$authority = $_REQUEST['au'];
$status = $_REQUEST['rs'];
$this->_order_id = osC_Order::insert(ORDERS_STATUS_PREPARING);
$order = $this->_order_id;
// order id for reversal
if ($authority) {
// here we update our database
if ($status == '0') {
//curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
//$page = curl_exec ($ch);
if (MODULE_PAYMENT_PEC_GATEWAY == 'pec-shaparak') {
$client = new nusoap_client('https://pec.shaparak.ir/pecpaymentgateway/eshopservice.asmx?wsdl', 'wsdl');
} elseif (MODULE_PAYMENT_PEC_GATEWAY == 'pec24') {
$client = new nusoap_client('https://www.pec24.com/pecpaymentgateway/eshopservice.asmx?wsdl', 'wsdl');
} else {
$client = new nusoap_client('https://www.pecco24.com:27635/pecpaymentgateway/eshopservice.asmx?wsdl', 'wsdl');
}
///////////////// INQUIRY REQUEST
$inquiryauthority = $authority;
$inquirystatus = 1;
// default status
// Check for an error
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
die;
}
$parameters = array('pin' => MODULE_PAYMENT_PEC_PIN, 'authority' => $inquiryauthority, 'status' => $inquirystatus);
// Call the SOAP method
$result = $client->call('PinPaymentEnquiry', $parameters);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault1</h2><pre>';
print_r($result);
echo '</pre>';
die;
} else {
$resultStr = $result;
$status = $resultStr['status'];
if ($status == '0') {
//$status==0 --> $status==a2l2i for test
// this is a succcessfull payment
// we update our DataBase
// save transaction_id to database
$osC_Database->simpleQuery("update `" . DB_TABLE_PREFIX . "online_transactions` set transaction_id = '{$authority}',transaction_date = '" . date("YmdHis") . "' where 1 and ( receipt_id = '{$authority}' )");
//
$Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
$Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
$Qtransaction->bindInt(':orders_id', $order);
$Qtransaction->bindInt(':transaction_code', 1);
$Qtransaction->bindValue(':transaction_return_value', $authority);
$Qtransaction->bindInt(':transaction_return_status', 1);
$Qtransaction->execute();
//
$this->_order_id = osC_Order::insert();
$comments = $osC_Language->get('payment_pec_method_authority') . '[' . $authority . ']';
osC_Order::process($this->_order_id, $this->order_status, $comments);
} else {
$err = $client->getError();
if ($err) {
//$err --> $err='ali' for test
///////////////// REVERSAL REQUEST
$order = $this->_order_id;
// order id for reversal
$orderid = $order;
$reversaltoreversal = $order;
$reversalstatus = 1;
// default status
// Check for an error
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
die;
}
$parameters = array('pin' => MODULE_PAYMENT_PEC_PIN, 'orderId' => $orderid, 'orderToReversal' => $reversaltoreversal, 'status' => $reversalstatus);
// Call the SOAP method
$result = $client->call('PinReversal', $parameters);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault3</h2><pre>';
print_r($result);
echo '</pre>';
die;
} else {
$resultStr = $result;
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
die;
} else {
// Update Table, Save Reversal Status
// Note: Successful Reversal means that sale is reversed.
//echo "<script>alert('Reversal Response is : " . $resultStr . "');</script>";
// echo "Reversal Response is : " . $resultStr;
// delete receipt id from database
$osC_Database->simpleQuery("delete from `" . DB_TABLE_PREFIX . "online_transactions` where 1 and ( receipt_id = '{$authority}' ) and ( orders_id = '{$order}' )");
//.........这里部分代码省略.........
示例11: callback
function callback()
{
$md5sign = strtoupper(md5($_POST['merchant_id'] . $_POST['transaction_id'] . strtoupper(md5(MODULE_PAYMENT_MONEYBOOKERS_SECRET_WORD)) . $_POST['mb_amount'] . $_POST['mb_currency'] . $_POST['status']));
$comment = 'Moneybookers Verified: ' . $_POST['status'];
if ($md5sign == $_POST['md5sig'] && intval($_POST['status']) == 2) {
osC_Order::process($_POST['transaction_id'], $this->order_status, $comment);
}
}
示例12: process
function process()
{
if (is_numeric($_GET['referenceId'])) {
osC_Order::process($_GET['referenceId'], ORDERS_STATUS_PENDING);
}
}
示例13: process
function process()
{
global $osC_ShoppingCart, $osC_Currencies, $messageStack, $osC_Language, $osC_Database;
if (!isset($_SESSION['ppe_token'])) {
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'callback&module=paypal_express', 'NOSSL', false));
}
$params = array('TOKEN' => $_SESSION['ppe_token'], 'PAYERID' => $_SESSION['ppe_payerid'], 'AMT' => $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal()), 'CURRENCYCODE' => $osC_Currencies->getCode());
if ($osC_ShoppingCart->hasShippingAddress()) {
$params['SHIPTONAME'] = $osC_ShoppingCart->getShippingAddress('firstname') . ' ' . $osC_ShoppingCart->getShippingAddress('lastname');
$params['SHIPTOSTREET'] = $osC_ShoppingCart->getShippingAddress('street_address');
$params['SHIPTOCITY'] = $osC_ShoppingCart->getShippingAddress('city');
$params['SHIPTOSTATE'] = $osC_ShoppingCart->getShippingAddress('zone_code');
$params['SHIPTOZIP'] = $osC_ShoppingCart->getShippingAddress('postcode');
$params['SHIPTOCOUNTRYCODE'] = $osC_ShoppingCart->getShippingAddress('country_iso_code_2');
}
$response_array = $this->doExpressCheckoutPayment($params);
if ($response_array['ACK'] != 'Success' && $response_array['ACK'] != 'SuccessWithWarning') {
$messageStack->add_session('shopping_cart', $osC_Language->get('payment_paypal_express_error_title') . ' <strong>' . stripslashes($response_array['L_LONGMESSAGE0']) . '</strong>');
osc_redirect(osc_href_link(FILENAME_CHECKOUT, '', 'SSL'));
} else {
//get the response string
$response = '';
if (count($response_array) > 0) {
foreach ($response_array as $key => $value) {
$response .= $key . '=' . $value . "\n";
}
}
$orders_id = osC_Order::insert();
osC_Order::process($orders_id, $this->order_status);
$pp_result = 'Payer Status: ' . osc_output_string_protected($_SESSION['ppe_payerstatus']) . "\n" . 'Address Status: ' . osc_output_string_protected($_SESSION['ppe_addressstatus']) . "\n\n" . 'Payment Status: ' . osc_output_string_protected($response_array['PAYMENTSTATUS']) . "\n" . 'Payment Type: ' . osc_output_string_protected($response_array['PAYMENTTYPE']) . "\n" . 'Pending Reason: ' . osc_output_string_protected($response_array['PENDINGREASON']) . "\n" . 'Reversal Code: ' . osc_output_string_protected($response_array['REASONCODE']);
$Qstatus = $osC_Database->query('insert into :table_orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values (:orders_id, :orders_status_id, now(), :customer_notified, :comments)');
$Qstatus->bindTable(':table_orders_status_history', TABLE_ORDERS_STATUS_HISTORY);
$Qstatus->bindInt(':orders_id', $orders_id);
$Qstatus->bindInt(':orders_status_id', MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID);
$Qstatus->bindInt(':customer_notified', '0');
$Qstatus->bindValue(':comments', $pp_result);
$Qstatus->execute();
$Qstatus->freeResult();
//process the transaction history
$Qtransaction_status = $osC_Database->query('select count(*) as total from :table_orders_transactions_status where status_name = :status_name');
$Qtransaction_status->bindTable(':table_orders_transactions_status', TABLE_ORDERS_TRANSACTIONS_STATUS);
$Qtransaction_status->bindValue(':status_name', $response_array['PAYMENTSTATUS']);
$Qtransaction_status->execute();
$transaction_status = $Qtransaction_status->toArray();
$Qtransaction_status->freeResult();
//verify whether there is already the specific transactions status
if ($transaction_status['total'] == 0) {
//get the max status id
$Qtransaction_status_max = $osC_Database->query('select max(id) as max_id from :table_orders_transactions_status');
$Qtransaction_status_max->bindTable(':table_orders_transactions_status', TABLE_ORDERS_TRANSACTIONS_STATUS);
$Qtransaction_status_max->execute();
$transaction_status_max = $Qtransaction_status_max->toArray();
$Qtransaction_status_max->freeResult();
//insert the specific transaction status for this module
foreach ($osC_Language->getAll() as $l) {
$Qinsert_transaction_status = $osC_Database->query('insert into :table_orders_transactions_status values (:id, :language_id, :status_name)');
$Qinsert_transaction_status->bindTable(':table_orders_transactions_status', TABLE_ORDERS_TRANSACTIONS_STATUS);
$Qinsert_transaction_status->bindInt(':id', $transaction_status_max['max_id'] + 1);
$Qinsert_transaction_status->bindInt(':language_id', $l['id']);
$Qinsert_transaction_status->bindValue(':status_name', $response_array['PAYMENTSTATUS']);
$Qinsert_transaction_status->execute();
}
}
//get the transaction status id
$Qtransaction_satus_id = $osC_Database->query('select id from :table_orders_transactions_status where language_id = :language_id and status_name = :status_name limit 1');
$Qtransaction_satus_id->bindTable(':table_orders_transactions_status', TABLE_ORDERS_TRANSACTIONS_STATUS);
$Qtransaction_satus_id->bindInt(':language_id', $osC_Language->getID());
$Qtransaction_satus_id->bindValue(':status_name', $response_array['PAYMENTSTATUS']);
$Qtransaction_satus_id->execute();
$transaction_satus_id = $Qtransaction_satus_id->toArray();
$Qtransaction_satus_id->freeResult();
//insert the order transactions history
$Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
$Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
$Qtransaction->bindInt(':orders_id', $orders_id);
$Qtransaction->bindInt(':transaction_code', $transaction_satus_id['id']);
$Qtransaction->bindValue(':transaction_return_value', $response);
$Qtransaction->bindInt(':transaction_return_status', 1);
$Qtransaction->execute();
$Qtransaction->freeResult();
}
unset($_SESSION['ppe_token']);
unset($_SESSION['ppe_payerid']);
unset($_SESSION['ppe_payerstatus']);
unset($_SESSION['ppe_addressstatus']);
}
示例14: process
function process()
{
global $osC_Currencies, $osC_ShoppingCart, $osC_Language, $messageStack;
$currency = $osC_Currencies->getCode();
if (isset($_POST['cc_owner']) && !empty($_POST['cc_owner']) && isset($_POST['cc_type']) && isset($this->cc_types[$_POST['cc_type']]) && isset($_POST['cc_number_nh-dns']) && !empty($_POST['cc_number_nh-dns'])) {
$params = array('USER' => MODULE_PAYMENT_PAYPAL_UK_DIRECT_USERNAME || MODULE_PAYMENT_PAYPAL_UK_DIRECT_VENDOR, 'VENDOR' => MODULE_PAYMENT_PAYPAL_UK_DIRECT_VENDOR, 'PARTNER' => MODULE_PAYMENT_PAYPAL_UK_DIRECT_PARTNER, 'PWD' => MODULE_PAYMENT_PAYPAL_UK_DIRECT_PASSWORD, 'TENDER' => 'C', 'TRXTYPE' => MODULE_PAYMENT_PAYPAL_UK_DIRECT_TRANSACTION_METHOD == 'Sale' ? 'S' : 'A', 'AMT' => $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal() - $osC_ShoppingCart->getShippingMethod('cost'), $currency), 'CURRENCY' => $currency, 'NAME' => $_POST['cc_owner'], 'STREET' => $osC_ShoppingCart->getBillingAddress('street_address'), 'CITY' => $osC_ShoppingCart->getBillingAddress('city'), 'STATE' => $osC_ShoppingCart->getBillingAddress('state'), 'COUNTRY' => $osC_ShoppingCart->getBillingAddress('country_iso_code_2'), 'ZIP' => $osC_ShoppingCart->getBillingAddress('postcode'), 'CLIENTIP' => osc_get_ip_address(), 'EMAIL' => $osC_ShoppingCart->getBillingAddress('email_address'), 'ACCT' => $_POST['cc_number_nh-dns'], 'ACCTTYPE' => $_POST['cc_type'], 'CARDSTART' => $_POST['cc_starts_month'] . $_POST['cc_starts_year'], 'EXPDATE' => $_POST['cc_expires_month'] . $_POST['cc_expires_year'], 'CVV2' => $_POST['cc_cvc_nh-dns'], 'BUTTONSOURCE' => 'tomatcart');
if ($_POST['cc_type'] == 'SWITCH' || $_POST['cc_type'] == 'SOLO') {
$params['ISSUENUMBER'] = $_POST['cc_issue_nh-dns'];
}
if ($osC_ShoppingCart->hasShippingAddress()) {
$params['SHIPTONAME'] = $osC_ShoppingCart->getShippingAddress('firstname') . ' ' . $osC_ShoppingCart->getShippingAddress('lastname');
$params['SHIPTOSTREET'] = $osC_ShoppingCart->getShippingAddress('street_address');
$params['SHIPTOCITY'] = $osC_ShoppingCart->getShippingAddress('city');
$params['SHIPTOSTATE'] = $osC_ShoppingCart->getShippingAddress('zone_code');
$params['SHIPTOCOUNTRYCODE'] = $osC_ShoppingCart->getShippingAddress('country_iso_code_2');
$params['SHIPTOZIP'] = $osC_ShoppingCart->getShippingAddress('postcode');
}
$post_string = '';
foreach ($params as $key => $value) {
$post_string .= $key . '=' . urlencode(trim($value)) . '&';
}
$post_string = substr($post_string, 0, -1);
$response = $this->sendTransactionToGateway($this->api_url, $post_string);
$response_array = array();
parse_str($response, $response_array);
if ($response_array['RESULT'] != '0') {
switch ($response_array['RESULT']) {
case '1':
case '26':
$error_message = $osC_Language->get('payment_paypal_uk_direct_error_cfg_error');
break;
case '7':
$error_message = $osC_Language->get('payment_paypal_uk_direct_error_address');
break;
case '12':
$error_message = $osC_Language->get('payment_paypal_uk_direct_error_declined');
break;
case '23':
case '24':
$error_message = $osC_Language->get('payment_paypal_uk_direct_error_invalid_credit_card');
break;
default:
$error_message = $osC_Language->get('payment_paypal_uk_direct_error_general');
break;
}
$messageStack->add_session('checkout', $error_message, 'error');
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout&view=orderConfirmationForm', 'SSL'));
} else {
$comments = 'PayPal Website Payments Pro (US) Direct Payments perform successfully.';
$orders_id = osC_Order::insert();
osC_Order::process($orders_id, ORDERS_STATUS_PAID, $comments);
}
} else {
$messageStack->add_session('checkout', $error_message, 'error');
osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout&view=orderConfirmationForm', 'SSL'));
}
}
示例15: process
function process()
{
global $osC_ShoppingCart, $osC_Currencies, $messageStack;
$orders_id = osC_Order::insert();
$params = array('USER' => MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME, 'PWD' => MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD, 'VERSION' => '3.2', 'SIGNATURE' => MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE, 'METHOD' => 'DoExpressCheckoutPayment', 'TOKEN' => $_SESSION['ppe_token'], 'PAYMENTACTION' => MODULE_PAYMENT_PAYPAL_EXPRESS_METHOD == 'Sale' ? 'Sale' : 'Authorization', 'PAYERID' => $_SESSION['ppe_payerid'], 'AMT' => $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal() - $osC_ShoppingCart->getShippingMethod('cost'), $osC_Currencies->getCode()), 'CURRENCYCODE' => $osC_Currencies->getCode(), 'BUTTONSOURCE' => PROJECT_VERSION);
if ($osC_ShoppingCart->hasShippingAddress()) {
$params['SHIPTONAME'] = $osC_ShoppingCart->getShippingAddress('firstname') . ' ' . $osC_ShoppingCart->getShippingAddress('lastname');
$params['SHIPTOSTREET'] = $osC_ShoppingCart->getShippingAddress('street_address');
$params['SHIPTOCITY'] = $osC_ShoppingCart->getShippingAddress('city');
$params['SHIPTOSTATE'] = $osC_ShoppingCart->getShippingAddress('zone_code');
$params['SHIPTOCOUNTRYCODE'] = $osC_ShoppingCart->getShippingAddress('country_iso_code_2');
$params['SHIPTOZIP'] = $osC_ShoppingCart->getShippingAddress('postcode');
}
$post_string = '';
foreach ($params as $key => $value) {
$post_string .= $key . '=' . urlencode(trim($value)) . '&';
}
$post_string = substr($post_string, 0, -1);
$response = $this->sendTransactionToGateway($this->api_url, $post_string);
$response_array = array();
parse_str($response, $response_array);
unset($_SESSION['ppe_token']);
unset($_SESSION['ppe_payerid']);
if ($response_array['ACK'] != 'Success' && $response_array['ACK'] != 'SuccessWithWarning') {
$messageStack->add_session('shopping_cart', stripslashes($response_array['L_LONGMESSAGE0']), 'error');
osc_redirect(osc_href_link(FILENAME_CHECKOUT, '', 'SSL'));
exit;
} else {
osC_Order::process($orders_id, $this->order_status);
}
}