当前位置: 首页>>代码示例>>PHP>>正文


PHP Orders::Complete方法代码示例

本文整理汇总了PHP中Orders::Complete方法的典型用法代码示例。如果您正苦于以下问题:PHP Orders::Complete方法的具体用法?PHP Orders::Complete怎么用?PHP Orders::Complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Orders的用法示例。


在下文中一共展示了Orders::Complete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Response

 /**
  * Response
  * Create the Order, Invoice and send an email to the customer
  * @param $response from the Gateway Server
  * @return order_id or false
  */
 public function Response($response)
 {
     if (!empty($response['status']) && $response['status'] == 2) {
         if (!empty($response['item_number'])) {
             $product = array('id' => $response['item_number'], 'name' => $response['item_name']);
             if (!empty($response['transaction_id'])) {
                 $orderid = trim($response['transaction_id']);
                 // Complete the order with the payment details
                 if (Orders::Complete($orderid)) {
                     return $orderid;
                 }
             }
         }
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:22,代码来源:Gateway.php

示例2: CallBack

 /**
  * CallBack
  * This function is called by the bank server in order to confirm the transaction previously executed
  * @param $response from the Gateway Server
  * @return boolean
  */
 public function CallBack($response)
 {
     $bank = self::getModule();
     $url = $bank['test_mode'] ? $bank['url_test'] : $bank['url_official'];
     // Resend all the variables to paypal to confirm the receipt message
     $result = self::processIPN($response);
     if (!empty($response['custom'])) {
         // Get the orderid back from the bank post variables
         $orderid = trim($response['custom']);
         if (!empty($orderid) && is_numeric($orderid)) {
             //check the ipn result received back from paypal
             if ($result) {
                 Orders::Complete($orderid, true);
                 // Complete the order information and it executes all the tasks to do
                 Payments::confirm($orderid, true);
                 // Set the payment confirm
             } else {
                 Payments::confirm($orderid, false);
             }
         }
     }
     die;
 }
开发者ID:moay,项目名称:shineisp,代码行数:29,代码来源:Gateway.php

示例3: CallBack

 /**
  * CallBack
  * This function is called by the bank server in order to confirm the transaction previously executed
  * @param $response from the Gateway Server
  * @return boolean
  */
 public function CallBack($response)
 {
     Shineisp_Commons_Utilities::logs("Start callback", "iwbank.log");
     // Get the orderid back from the bank post variables
     $orderid = trim($response['custom']);
     $ret = "";
     $payer_id = $response["payer_id"];
     $thx_id = $response["thx_id"];
     $verify_sign = $response["verify_sign"];
     $amount = $response["amount"];
     $code = '2E121E96A508BDBA39782E43D2ACC12274A991A7EDE25502F42D99542D26CF3D';
     //Inserire il merchant_key indicato all'interno del sito IWSMILE su POS VIRTUALE/Configurazione/Notifica Pagamento.
     $str = "thx_id=" . $thx_id . "&amount=" . $amount . "&verify_sign=" . $verify_sign;
     $str .= "&payer_id=" . $payer_id;
     $str .= "&merchant_key=" . $code;
     Shineisp_Commons_Utilities::logs("Callback parameters: {$str}", "iwbank.log");
     $url = "https://checkout.iwsmile.it/Pagamenti/trx.check";
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
     curl_setopt($ch, CURLOPT_POST, TRUE);
     $content = curl_exec($ch);
     $c_error = "NONE";
     $ret = 'NON DISPONIBILE';
     if (curl_errno($ch) != 0) {
         $c_error = curl_error($ch);
     } else {
         if (strstr($content, "OK")) {
             $ret = "VERIFICATO";
             Shineisp_Commons_Utilities::logs("Order Completed: {$orderid}", "iwbank.log");
             // Complete the order
             Orders::Complete($orderid, true);
             // Complete the order information and it executes all the tasks to do
             Shineisp_Commons_Utilities::logs("Confirm the payment for the order: {$orderid}", "iwbank.log");
             Payments::confirm($orderid);
             // Set the payment confirm
         } elseif (strstr($content, "KO")) {
             // Order not verified
             $ret = 'NON VERIFICATO';
         } elseif (strstr($content, "IR")) {
             // Request is not valid
             $ret = 'RICHIESTA NON VALIDA';
         } elseif (strstr($content, "EX")) {
             // Request expired
             $ret = 'RICHIESTA SCADUTA';
         }
     }
     curl_close($ch);
     Shineisp_Commons_Utilities::logs("Callback Payment Result: {$ret}", "iwbank.log");
     Shineisp_Commons_Utilities::logs("End callback", "iwbank.log");
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:60,代码来源:Gateway.php


注:本文中的Orders::Complete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。