Ejemplo n.º 1
0
    public void searchPayResultNotify(string args)
    {
        ParseReceiveParams(args);

        string isPaySuccess  = GetReceiveParam(KeyIsPaySuccess);
        bool   bIsPaySuccess = string.IsNullOrEmpty(isPaySuccess) ? false : bool.Parse(isPaySuccess);

        string orderId        = GetReceiveParam(KeyOrderId);
        string productId      = GetReceiveParam(KeyProductId);
        string productName    = GetReceiveParam(KeyProductName);
        string price          = GetReceiveParam(KeyProductPrice);
        string origPrice      = GetReceiveParam(KeyProductOrigPrice);
        string count          = GetReceiveParam(KeyProductCount);
        string payDescription = GetReceiveParam(KeyPayDescription);

        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the orderId is " + orderId);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the productId is " + productId);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the productName is " + productName);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the price is " + price);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the origPrice is " + origPrice);
        Debug.Log("[U3d2NdReceiver]: paymentNotify------------------- the count is " + count);

        if (IsSuccess())
        {
            ThirdPartyPlatform.OnSearchPayResult(IsSuccess(), bIsPaySuccess, orderId);
        }
        else
        {
            ThirdPartyPlatform.OnSearchPayResult(IsSuccess(), bIsPaySuccess, orderId);
        }

        // ThirdPartyPlatform.ErrorCode resultCode = U3dNdSender.Convert2ResultCode(0);
        //
        // string orderId = "";
        // ThirdPartyPlatform.OnSearchPayResult(resultCode, orderId);

        /*
         * switch(responseCode){
         *      case NdErrorCode.ND_COM_PLATFORM_SUCCESS://查询成功
         *              if(isPay){
         *                      //购买成功
         *              }else{
         *              //购买失败
         *              }
         *              break;
         *      case NdErrorCode.ND_COM_PLATFORM_ERROR_UNEXIST_ORDER:
         *              //无此订单
         *              break;
         *      default :
         *              //查询失败
         *      }
         * */
    }