public function readRequestVariables() { $request = new Pap_Tracking_Request(); $this->testMode = $request->getPostParam('ap_test'); $this->securityCode = $request->getPostParam('ap_securitycode'); $this->purchaseType = $request->getPostParam('ap_purchasetype'); // assign posted variables to local variables $cookieValue = stripslashes($request->getPostParam('apc_'.Gpf_Settings::get(AlertPay_Config::CUSTOM_FIELD_NUMBER))); $this->setCookie($cookieValue); $this->setTotalCost($request->getPostParam('ap_totalamount')); $this->setTransactionID($request->getPostParam('ap_referencenumber')); $this->setEmail($request->getPostParam('ap_custemailaddress')); $this->setProductID($request->getPostParam('ap_itemname')); $this->setPaymentStatus($request->getPostParam('ap_status')); $this->debug('Request variables: '. 'testMode:'.$this->testMode.', '. 'securityCode:'.$this->securityCode.', '. 'purchaseType:'.$this->purchaseType.', '. 'cookieValue:'.$this->getCookie().', '. 'totalCost:'.$this->getTotalCost().', '. 'transactionId:'.$this->getTransactionID().', '. 'email:'.$this->getEmail().', '. 'productID:'.$this->getProductID().', '. 'paymentStatus:'.$this->getPaymentStatus()); }
private function resolveStatus() { $messageType = trim($this->request->getPostParam('message_type')); $this->debug('2checkout INS plugin: resolveStatus: '.$messageType); $this->notificationType = $messageType; switch ($messageType) { case 'ORDER_CREATED': case 'REFUND_ISSUED': case 'RECURRING_INSTALLMENT_SUCCESS': case 'RECURRING_STOPPED': case 'RECURRING_COMPLETE': $this->setPaymentStatus(true); return; } $this->setPaymentStatus(false); $this->debug('2checkout INS plugin: Message type not supported: ' . $messageType); }
private function adjustTotalCost($originalTotalCost, Pap_Tracking_Request $request) { $totalCost = $originalTotalCost; $this->debug('Original totalcost: '.$totalCost); if (Gpf_Settings::get(AuthorizeNet_Config::DISCOUNT_TAX)==Gpf::YES) { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('x_tax')); $this->debug('Discounting tax ('.$request->getPostParam('x_tax').') from totalcost.'); } if (Gpf_Settings::get(AuthorizeNet_Config::DUTY_TAX)==Gpf::YES) { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('x_duty')); $this->debug('Discounting duty tax ('.$request->getPostParam('x_duty').') from totalcost.'); } if (Gpf_Settings::get(AuthorizeNet_Config::FREIGHT_TAX)==Gpf::YES) { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('x_freight')); $this->debug('Discounting freight tax ('.$request->getPostParam('x_freight').') from totalcost.'); } $this->debug('Totalcost after discounts: '.$totalCost); return $totalCost; }
private function adjustTotalCost($originalTotalCost, Pap_Tracking_Request $request, $index = '') { $totalCost = $originalTotalCost; $this->debug('Original totalcost: '.$totalCost); if (Gpf_Settings::get(PayPal_Config::DISCOUNT_FEE)==Gpf::YES) { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('mc_fee'.$index)); $this->debug('Discounting fee ('.$request->getPostParam('mc_fee'.$index).') from totalcost.'); } if (Gpf_Settings::get(PayPal_Config::DISCOUNT_TAX)==Gpf::YES) { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('tax'.$index)); $this->debug('Discounting tax ('.$request->getPostParam('tax'.$index).') from totalcost.'); } if (Gpf_Settings::get(PayPal_Config::DISCOUNT_HANDLING)==Gpf::YES) { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('mc_handling'.$index)); $this->debug('Discounting handling ('.$request->getPostParam('mc_handling'.$index).') from totalcost.'); } if (Gpf_Settings::get(PayPal_Config::DISCOUNT_SHIPPING)==Gpf::YES) { if ($index == '' && $request->getPostParam('mc_shipping') == '') { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('shipping')); $this->debug('Discounting shipping ('.$request->getPostParam('shipping').') from totalcost.'); } else { $totalCost = $this->discountFromTotalcost($totalCost, $request->getPostParam('mc_shipping'.$index)); $this->debug('Discounting shipping ('.$request->getPostParam('mc_shipping'.$index).') from totalcost.'); } } $this->debug('Totalcost after discounts: '.$totalCost); return $totalCost; }
private function adjustTotalCost(Pap_Tracking_Request $request) { $totalCost = $request->getPostParam('valor'); $this->debug('Original totalcost: '.$totalCost); if (Gpf_Settings::get(PagosOnline_Config::DISCOUNT_FEE)==Gpf::YES) { $totalCost = $totalCost - $request->getPostParam('valorAdicional'); $this->debug('Discounting fee ('.$request->getPostParam('valorAdicional').') from totalcost.'); } if (Gpf_Settings::get(PagosOnline_Config::DISCOUNT_TAX)==Gpf::YES) { $totalCost = $totalCost - $request->getPostParam('iva'); $this->debug('Discounting tax (IVA) ('.$request->getPostParam('iva').') from totalcost.'); } $this->debug('Totalcost after discounts: '.$totalCost); return $totalCost; }
private function adjustTotalCost($originalTotalCost, Pap_Tracking_Request $request, $index = '') { $totalCost = $originalTotalCost; $this->debug('Original totalcost: '.$totalCost); if (Gpf_Settings::get(ISecure_Config::DISCOUNT_TAX)==Gpf::YES) { $tax = $request->getPostParam('xxxTotalTax'); if (!empty($tax)) { $totalCost = $this->discountFromTotalcost($totalCost, $tax); $tax = $totaltax; } else { $Items = explode("|",$this->doubleColonProducts); if (strpos($Items[count($Items)-1][4],"TAX") !== false ) { $totalCost = $this->discountFromTotalcost($totalCost, $Items[count($Items)-1][0]); $tax = $Items[count($Items)-1][0]; } else { $tax = 0; } } $this->debug('Discounting tax ('.$tax.') from totalcost.'); } $this->debug('Totalcost after discounts: '.$totalCost); return $totalCost; }