anybody experience with postfinance (swiss) - new status 91

Started by dirkb, July 06, 2016, 12:07:12 PM

Previous topic - Next topic

dirkb

Hi ... any crack experience with postfinance ? We had somebody helping us out with an old b-planet plugin (the official 3.01 version does not work 100% and those guys are not really supporting). Now, postfinance added offline processing and added an new status (91) - I tried to go through the plugin, but I´m a little lost ... below are the status codes we have in (Case ...) ... what would I have to add ? anybody experience with that ?


------------------------------------------------------

      //React depending on status of confirmation
      switch ($postfinance_status){

         case 5:
         case 9:
            //Payement is Authorized, process it !!
            $this->logInfo('plgVmOnPaymentNotification Postfinance status: ' . $postfinance_status . ' New order status :' . $order['order_status'], 'message');
            $modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, true);
            // Exit is needed or postfinance doen't return client correctly to site
            exit();

         case 51:
            //Payement is marked Authorization waiting
            if ($method->postfinance_verified_only == 1){
               //Payement is Authorized, process it !!
               $this->logInfo('plgVmOnPaymentNotification Postfinance status: ' . $postfinance_status . ' New order status :' . $order['order_status'], 'message');
               $modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, true);
               $mailsubject = "PostFinance IPN on your site with status AUTHORIZATION  WAITING (STATUS 52) was accepted";
               $mailbody .= "A PostFinance transaction for you has been made on your website! \n";
               $mailbody .= "Warning, the transaction has the status AUTHORIZATION  WAITING (STATUS 52) \n";
               $mailbody .= "If in future you do not wish to accept offline processing turn the feature off in the payement module configuration \n";
               $mailbody .= $transactioninfo;
               $this->logInfo($mailsubject . "::" . $mailbody, 'ERROR' );
               $this->sendEmailToVendorAndAdmins($mailsubject, $mailbody);
               //Exit is needed or postfinance doen't return client correctly to site
               exit();
            }else{
               $mailsubject = "PostFinance IPN on your site with status AUTHORIZATION  WAITING (STATUS 52) was refused";
               $mailbody = "A Failed PostFinance Transaction on your site requires your attention. The STATUS return by PostFinance is AUTHORIZING WAITING (STATUS 52) \n";
               $mailbody .= "even though you refuse offline processing\n";
               $mailbody .= "If in future you wish to accept offline processing, turn the feature on in the payement module configuration\n";
               $mailbody .= $transactioninfo;
               $this->logInfo($mailsubject . "::" . $mailbody, 'ERROR' );
               $this->sendEmailToVendorAndAdmins($mailsubject, $mailbody);
               exit();
            }
         default:
            // If the payment_status is canceled ( 1 ) or not recognized... do nothing but mail
            //Send notificatino to admin
            $mailsubject = "PostFinance IPN on your site did not finalise";

            If ($postfinance_status == 1) {
               $mailbody = "A PostFinance Transaction was canceled. \n";
            }else{
               $mailbody = "The STATUS return by PostFinance is not reconnised. \n";
            }
            $mailbody .= $transactioninfo;

            $this->logInfo($mailsubject . "::" . $mailbody, 'ERROR' );
            $this->sendEmailToVendorAndAdmins($mailsubject, $mailbody);
            exit();
      }
   }

GJC Web Design

it would be just add another case

  case 91:
            //what ever this is
            $this->logInfo('plgVmOnPaymentNotification Postfinance status: ' . $postfinance_status . ' New order status :' . $order['order_status'], 'message');
            //do what ever u need here
            exit();
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

dirkb

Thanks ... but here is the point where I´m not sure. Case 9 is "payment" accepted. Case 91 is "offline processing" is actually closer to Case 51 in the postfinance definition ... and here I´m lost .. damn

GJC Web Design

but it is up to you what you want to use case 91 to do....

apart from the paid ones the others just construct and send an email
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation