应用程序做一个iap,并将收据发送到我的服务器,我的服务器将它发送到苹果的服务器以验证收据。
IOS7改变了返回数据。
现在,返回数据如下:
{u'environment': u'Sandbox',
u'receipt': {u'adam_id': 0,
u'app_item_id': 0,
u'application_version': u'1.0',
u'bundle_id': u'com.mztimes.sanguo.international',
u'download_id': 0,
u'in_app': [{u'is_trial_period': u'false',
u'original_purchase_date': u'2014-10-24 06:54:20 Etc/GMT',
u'original_purchase_date_ms': u'1414133660000',
u'original_purchase_date_pst': u'2014-10-23 23:54:20 America/Los_Angeles',
u'original_transaction_id': u'1000000128944402',
u'product_id': u'com.mztimes.sanguo.international.60gold',
u'purchase_date': u'2014-10-28 01:56:45 Etc/GMT',
u'purchase_date_ms': u'1414461405000',
u'purchase_date_pst': u'2014-10-27 18:56:45 America/Los_Angeles',
u'quantity': u'1',
u'transaction_id': u'1000000128944402'},
{u'is_trial_period': u'false',
u'original_purchase_date': u'2014-10-24 06:52:30 Etc/GMT',
u'original_purchase_date_ms': u'1414133550000',
u'original_purchase_date_pst': u'2014-10-23 23:52:30 America/Los_Angeles',
u'original_transaction_id': u'1000000128944196',
u'product_id': u'com.mztimes.sanguo.international.300gold',
u'purchase_date': u'2014-10-28 01:56:45 Etc/GMT',
u'purchase_date_ms': u'1414461405000',
u'purchase_date_pst': u'2014-10-27 18:56:45 America/Los_Angeles',
u'quantity': u'1',
u'transaction_id': u'1000000128944196'},
{u'is_trial_period': u'false',
u'original_purchase_date': u'2014-10-28 01:56:45 Etc/GMT',
u'original_purchase_date_ms': u'1414461405000',
u'original_purchase_date_pst': u'2014-10-27 18:56:45 America/Los_Angeles',
u'original_transaction_id': u'1000000129320617',
u'product_id': u'com.mztimes.sanguo.international.980gold',
u'purchase_date': u'2014-10-28 01:56:45 Etc/GMT',
u'purchase_date_ms': u'1414461405000',
u'purchase_date_pst': u'2014-10-27 18:56:45 America/Los_Angeles',
u'quantity': u'1',
u'transaction_id': u'1000000129320617'}],
u'original_application_version': u'1.0',
u'original_purchase_date': u'2013-08-01 07:00:00 Etc/GMT',
u'original_purchase_date_ms': u'1375340400000',
u'original_purchase_date_pst': u'2013-08-01 00:00:00 America/Los_Angeles',
u'receipt_type': u'ProductionSandbox',
u'request_date': u'2014-10-28 02:50:09 Etc/GMT',
u'request_date_ms': u'1414464609873',
u'request_date_pst': u'2014-10-27 19:50:09 America/Los_Angeles',
u'version_external_identifier': 0},
u'status': 0}
查看 in_app 字段:文档说:
In the JSON file, the value of this key is an array containing all in-app purchase receipts. In the ASN.1 file, there are multiple fields that all have type 17, each of which contains a single in-app purchase receipt.
在我的许多测试中,in_app 列表的最后一个元素是我发送到苹果服务器的收据信息。 但是其他两个元素是什么?
我发送不同的收据来验证,其他两个元素始终相同。
这是为什么?帮帮我!
最佳答案
作为doc说,包含基于输入 base-64 收据数据中存在的应用内购买交易的所有应用内购买收据。另请参阅 iOS IAP in_app field in receipt和 Removing in app purchases from a new version of the application(iOS)
In-App Purchase Receipt
The receipt for an in-app purchase.
ASN.1 Field Type 17
ASN.1 Field Value SET of in-app purchase receipt attributes
JSON Field Name in_app
JSON Field Value array of in-app purchase receipts
In the JSON file, the value of this key is an array containing all in-app purchase receipts based on the in-app purchase transactions present in the input base-64 receipt-data. For receipts containing auto-renewable subscriptions, check the value of the latest_receipt_info key to get the status of the most recent renewal.
In the ASN.1 file, there are multiple fields that all have type 17, each of which contains a single in-app purchase receipt.
Note: An empty array is a valid receipt.
The in-app purchase receipt for a consumable product is added to the receipt when the purchase is made. It is kept in the receipt until your app finishes that transaction. After that point, it is removed from the receipt the next time the receipt is updated - for example, when the user makes another purchase or if your app explicitly refreshes the receipt.
The in-app purchase receipt for a non-consumable product, auto-renewable subscription, non-renewing subscription, or free subscription remains in the receipt indefinitely.
关于IOS7验证iap收据,in_app filed是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26600300/
类classAprivatedeffooputs:fooendpublicdefbarputs:barendprivatedefzimputs:zimendprotecteddefdibputs:dibendendA的实例a=A.new测试a.foorescueputs:faila.barrescueputs:faila.zimrescueputs:faila.dibrescueputs:faila.gazrescueputs:fail测试输出failbarfailfailfail.发送测试[:foo,:bar,:zim,:dib,:gaz].each{|m|a.send(m)resc
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
给定这段代码defcreate@upgrades=User.update_all(["role=?","upgraded"],:id=>params[:upgrade])redirect_toadmin_upgrades_path,:notice=>"Successfullyupgradeduser."end我如何在该操作中实际验证它们是否已保存或未重定向到适当的页面和消息? 最佳答案 在Rails3中,update_all不返回任何有意义的信息,除了已更新的记录数(这可能取决于您的DBMS是否返回该信息)。http://ar.ru
我有一个模型:classItem项目有一个属性“商店”基于存储的值,我希望Item对象对特定方法具有不同的行为。Rails中是否有针对此的通用设计模式?如果方法中没有大的if-else语句,这是如何干净利落地完成的? 最佳答案 通常通过Single-TableInheritance. 关于ruby-on-rails-Rails-子类化模型的设计模式是什么?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.co
我想安装一个带有一些身份验证的私有(private)Rubygem服务器。我希望能够使用公共(public)Ubuntu服务器托管内部gem。我读到了http://docs.rubygems.org/read/chapter/18.但是那个没有身份验证-如我所见。然后我读到了https://github.com/cwninja/geminabox.但是当我使用基本身份验证(他们在他们的Wiki中有)时,它会提示从我的服务器获取源。所以。如何制作带有身份验证的私有(private)Rubygem服务器?这是不可能的吗?谢谢。编辑:Geminabox问题。我尝试“捆绑”以安装新的gem..
我正在使用的第三方API的文档状态:"[O]urAPIonlyacceptspaddedBase64encodedstrings."什么是“填充的Base64编码字符串”以及如何在Ruby中生成它们。下面的代码是我第一次尝试创建转换为Base64的JSON格式数据。xa=Base64.encode64(a.to_json) 最佳答案 他们说的padding其实就是Base64本身的一部分。它是末尾的“=”和“==”。Base64将3个字节的数据包编码为4个编码字符。所以如果你的输入数据有长度n和n%3=1=>"=="末尾用于填充n%
我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i
在rails源中:https://github.com/rails/rails/blob/master/activesupport/lib/active_support/lazy_load_hooks.rb可以看到以下内容@load_hooks=Hash.new{|h,k|h[k]=[]}在IRB中,它只是初始化一个空哈希。和做有什么区别@load_hooks=Hash.new 最佳答案 查看rubydocumentationforHashnew→new_hashclicktotogglesourcenew(obj)→new_has
我看到这个错误:translationmissing:da.datetime.distance_in_words.about_x_hours我的语言环境文件:http://pastie.org/2944890我的看法:我已将其添加到我的application.rb中:config.i18n.load_path+=Dir[Rails.root.join('my','locales','*.{rb,yml}').to_s]config.i18n.default_locale=:da如果我删除I18配置,帮助程序会处理英语。更新:我在config/enviorments/devolpment
为什么4.1%2返回0.0999999999999996?但是4.2%2==0.2。 最佳答案 参见此处:WhatEveryProgrammerShouldKnowAboutFloating-PointArithmetic实数是无限的。计算机使用的位数有限(今天是32位、64位)。因此计算机进行的浮点运算不能代表所有的实数。0.1是这些数字之一。请注意,这不是与Ruby相关的问题,而是与所有编程语言相关的问题,因为它来自计算机表示实数的方式。 关于ruby-为什么4.1%2使用Ruby返