if (eregi("VERIFIED", $info) && $_POST['txn_type'] == 'web_accept' && $_POST['business'] == MODULE_PAYMENT_PAYPAL_BUSINESS_ID) { if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') { mail(STORE_OWNER_EMAIL_ADDRESS, 'IPN DEBUG MESSAGE', 'Order Verified ' . $new_order_id); } // do success stuff here // Things to do // create paypal database entry $paypal_order = array(zen_order_id => $new_order_id, txn_type => $_POST['txn_type'], reason_code => $_POST['reason_code'], payment_type => $_POST['payment_type'], payment_status => $_POST['payment_status'], pending_reason => $_POST['pending_reason'], invoice => $_POST['invoice'], mc_currency => $_POST['mc_currency'], first_name => $_POST['first_name'], last_name => $_POST['last_name'], payer_business_name => $_POST['payer_business_name'], address_name => $_POST['address_name'], address_street => $_POST['addrss_street'], address_city => $_POST['address_city'], address_state => $_POST['address_state'], address_zip => $_POST['address_zip'], address_country => $_POST['address_country'], address_status => $_POST['address_status'], payer_email => $_POST['payer_email'], payer_id => $_POST['payer_id'], payer_status => $_POST['payer_status'], payment_date => $_POST['payment_date'], business => $_POST['business'], receiver_email => $_POST['receiver_email'], receiver_id => $_POST['receiver_id'], txn_id => $_POST['txn_id'], parent_txn_id => $_POST['parent_txn_id'], num_cart_items => $_POST['num_cart_items'], mc_gross => $_POST['mc_gross'], mc_fee => $_POST['mc_fee'], settle_amount => $_POST['settle_amount'], settle_currency => $_POST['settle_currency'], exchange_rate => $_POST['exchange_rate'], notify_version => $_POST['notify_version'], verify_sign => $_POST['verify_sign'], last_modified => $_POST['last_modified'], date_added => $_POST['date_added'], memo => $_POST['memo']); if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') { mail(STORE_OWNER_EMAIL_ADDRESS, 'IPN DEBUG MESSAGE', '10. Created Order Array'); } $gBitDb->associateInsert(TABLE_PAYPAL, $paypal_order); if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') { mail(STORE_OWNER_EMAIL_ADDRESS, 'IPN DEBUG MESSAGE', '11. Got past Create DB Array'); } if (isset($_SESSION['customer_id'])) { $order->create_add_products($new_order_id, 2); if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') { mail(STORE_OWNER_EMAIL_ADDRESS, 'IPN DEBUG MESSAGE', '12. Finalised Order'); } $order->send_order_email($new_order_id, 2); $gBitCustomer->mCart->reset(true); } if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') { mail(STORE_OWNER_EMAIL_ADDRESS, 'IPN DEBUG MESSAGE', '13. Sent Email'); } } else { if (MODULE_PAYMENT_PAYPAL_IPN_DEBUG == 'Yes') { mail(STORE_OWNER_EMAIL_ADDRESS, 'IPN DEBUG MESSAGE', '14. Catastrophic Failure' . '#' . $_POST['business'] . '#' . MODULE_PAYMENT_PAYPAL_BUSINESS_ID . '#' . $_POST['txn_type'] . '#' . $info); } }
zen_redirect(zen_href_link(FILENAME_DEFAULT)); } // load the before_process function from the payment modules $payment_modules->before_process(); $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_BEFOREPROCESS'); if ($_SESSION['payment'] == 'alipay_forcard') { if (isset($_SESSION['alipay_forcard_success_order_id'])) { $_order_id = $_SESSION['alipay_forcard_success_order_id']; $order->query($_order_id); $db->Execute('update ' . TABLE_ORDERS . ' set last_modified=now(), orders_status = ' . MODULE_PAYMENT_ALIPAYFOR_ORDER_STATUS_ID . ' where orders_id = ' . (int) $_order_id); $insert_id = $_order_id; unset($_SESSION['alipay_forcard_success_order_id']); if (isset($_SESSION['alipay_forcard_pending_order_id'])) { unset($_SESSION['alipay_forcard_pending_order_id']); } $order->send_order_email($insert_id, 2); } else { zen_redirect(zen_href_link(FILENAME_DEFAULT)); } } else { // create the order record $insert_id = $order->create($order_totals, 2); $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE'); $payment_modules->after_order_create($insert_id); $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_AFTER_ORDER_CREATE'); // store the product info to the order $order->create_add_products($insert_id); $_SESSION['order_number_created'] = $insert_id; $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS'); //send email notifications $order->send_order_email($insert_id, 2);
// die('order error'); // } // $_SESSION['sendto'] = $session->fields['sendto']; // $_SESSION['billto'] = $session->fields['billto']; // $notify = 1; // // $_SESSION['cart']->reset(true); } //if($status === 'rpapproved' || $status === 'rptestapprove' || $status == 'rpdeclined') //{ $check_status = $db->Execute("select customers_name, customers_email_address, orders_status,\n\t date_purchased from " . TABLE_ORDERS . "\n\t where orders_id = '" . (int) $order_sn . "'"); if ($check_status->fields['orders_status'] != $status_id) { $db->Execute("update " . TABLE_ORDERS . "\n\t set orders_status = '" . zen_db_input($status_id) . "', last_modified = '" . date('Y-m-d H:i:s') . "'\n\t where orders_id = '" . (int) $order_sn . "'"); } //} $order->send_order_email($vars['order_sn'], 2); if (defined('JFOLLOW_ENABLE') && JFOLLOW_ENABLE === true && function_exists('jsendOrderCookie')) { jsendOrderCookie($vars['order_sn']); } unset($_SESSION['payment_last_status_id']); unset($_SESSION['_process_pay_request']); zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS)); } } } } } //End process rpsitepay payment method if (isset($_SESSION['_process_pay_request'])) { unset($_SESSION['_process_pay_request']); }