应用内收据服务器端验证 - 错误的is_trial_period值

时间:2017-03-07 15:34:36

标签: ios validation in-app-purchase receipt

我正在验证服务器端的收据没有问题。我想在我们的支付表中添加诸如is_trial_period之类的额外信息,以便轻松区分试用付款和续订订阅,但我从苹果获得的信息令人困惑。 Apple在“in_app”数组中将is_trial_period返回为false,而在“latest_receipt_info”数组中将相同transaction_id的相同值返回true。我在下面添加了一个示例:

{  
   "status":0,
   "environment":"Production",
   "receipt":{  
      "receipt_type":"Production",
      "adam_id":1183270669,
      "app_item_id":1183270669,
      "bundle_id":"com.company.somebundle",
      "application_version":"2",
      "download_id":67027804835888,
      "version_external_identifier":821012057,
      "receipt_creation_date":"2017-03-05 03:47:06 Etc\/GMT",
      "receipt_creation_date_ms":"1488685626000",
      "receipt_creation_date_pst":"2017-03-04 19:47:06 America\/Los_Angeles",
      "request_date":"2017-03-07 15:27:10 Etc\/GMT",
      "request_date_ms":"1488900430458",
      "request_date_pst":"2017-03-07 07:27:10 America\/Los_Angeles",
      "original_purchase_date":"2017-03-04 22:26:28 Etc\/GMT",
      "original_purchase_date_ms":"1488666388000",
      "original_purchase_date_pst":"2017-03-04 14:26:28 America\/Los_Angeles",
      "original_application_version":"2",
      "in_app":[  
         {  
            "quantity":"1",
            "product_id":"com.company.new.one.month.optionone",
            "transaction_id":"270000278422870",
            "original_transaction_id":"270000278422870",
            "purchase_date":"2017-03-05 03:47:05 Etc\/GMT",
            "purchase_date_ms":"1488685625000",
            "purchase_date_pst":"2017-03-04 19:47:05 America\/Los_Angeles",
            "original_purchase_date":"2017-03-05 03:47:05 Etc\/GMT",
            "original_purchase_date_ms":"1488685625000",
            "original_purchase_date_pst":"2017-03-04 19:47:05 America\/Los_Angeles",
            "expires_date":"2017-03-12 03:47:05 Etc\/GMT",
            "expires_date_ms":"1489290425000",
            "expires_date_pst":"2017-03-11 19:47:05 America\/Los_Angeles",
            "web_order_line_item_id":"270000054390322",
            "is_trial_period":"false"
         }
      ]
   },
   "latest_receipt_info":[  
      {  
         "quantity":"1",
         "product_id":"com.company.new.one.month.optionone",
         "transaction_id":"270000278422870",
         "original_transaction_id":"270000278422870",
         "purchase_date":"2017-03-05 03:47:05 Etc\/GMT",
         "purchase_date_ms":"1488685625000",
         "purchase_date_pst":"2017-03-04 19:47:05 America\/Los_Angeles",
         "original_purchase_date":"2017-03-05 03:47:05 Etc\/GMT",
         "original_purchase_date_ms":"1488685625000",
         "original_purchase_date_pst":"2017-03-04 19:47:05 America\/Los_Angeles",
         "expires_date":"2017-03-12 03:47:05 Etc\/GMT",
         "expires_date_ms":"1489290425000",
         "expires_date_pst":"2017-03-11 19:47:05 America\/Los_Angeles",
         "web_order_line_item_id":"270000054390322",
         "is_trial_period":"true"
      }
   ]
}

据我所知,“in_app”数组必须用于所有类型的付款,但“latest_receipt_info”数组给出正确的试用状态,这对我的情况应该是正确的。任何帮助或将非常感激。

0 个答案:

没有答案