2013-05-24 5 views
4

현재 자동 갱신 구독 코드를 테스트하고 있습니다. 대부분의 경우 예상대로 작동합니다. 그러나 때로는 예상치 못한 결과가 나타납니다.iOS 자동 갱신 구독 (샌드 박스)

새 가입을 구매하면 영수증을 받게됩니다 (transaction_id = 1000000075229775). 유효 기간이 만료되기 전에이 영수증을받은 직후에이 영수증을 sandbox.itunes.apple.com으로 보내고 다른 트랜잭션 ID (latest_receipt_info with transaction_id = 1000000075229779)가있는 새 영수증을 반환합니다. 첫 번째 만료 날짜에 도달하기 전에이 새로운 영수증 (다른 트랜잭션 ID 포함)을 얻으 려하지 않았습니다. 다음 두 영수증을 모두 보여줍니다. 만료일은 매우 가깝습니다 (1 초 미만 차이).

무슨 일이 일어나는지 이해해 주시겠습니까?

감사합니다.

["receipt"]=>object(stdClass)#14 (19) { 
    ["original_purchase_date_pst"]=>string(39) "2012-12-03 08:20:49 America/Los_Angeles" 
    ["unique_identifier"]=>string(40) "af430ef98d6bdbbf92ed34e4addec2e834bc25d6" 
    ["original_transaction_id"]=>string(16) "1000000059708880" 
    ["expires_date"]=>string(13) "1369421691100" 
    ["transaction_id"]=>string(16) "1000000075229775" 
    ["quantity"]=>string(1) "1" 
    ["expires_date_formatted"]=>string(27) "2013-05-24 18:54:51 Etc/GMT" 
    ["purchase_date"]=>string(27) "2013-05-24 18:49:51 Etc/GMT" 
    ["purchase_date_ms"]=>string(13) "1369421391100" 
    ["original_purchase_date"]=>string(27) "2012-12-03 16:20:49 Etc/GMT" 
    ["original_purchase_date_ms"]=>string(13) "1354551649000" 
    ... 
} 
["latest_receipt_info"]=>object(stdClass)#12 (19) { 
    ["original_purchase_date_pst"]=>string(39) "2012-12-03 08:20:49 America/Los_Angeles" 
    ["unique_identifier"]=>string(40) "345fade172e62c805d0d354edda97575fc9b9d50" 
    ["original_transaction_id"]=>string(16) "1000000059708880" 
    ["expires_date"]=>string(13) "1369421691000" 
    ["transaction_id"]=>string(16) "1000000075229779" 
    ["quantity"]=>string(1) "1" 
    ["expires_date_formatted"]=>string(27) "2013-05-24 18:54:51 Etc/GMT" 
    ["purchase_date"]=>string(27) "2013-05-24 18:49:51 Etc/GMT" 
    ["purchase_date_ms"]=>string(13) "1369421391000" 
    ["original_purchase_date"]=>string(27) "2012-12-03 16:20:49 Etc/GMT" 
    ["original_purchase_date_ms"]=>string(13) "1354551649000" 
    ... 
} 
["status"]=>int(0) 

답변

1

original_transaction_id를 살펴보고 transaction_id에 대해 걱정하지 마십시오. 특정 상황에서 다른 transaction_id를 얻을 수 있습니다 (예 : 구매를 복원 할 때). 나는 transaction_id가 변경 될 수있는 모든 세부 사항이 문서화되어 있다고 생각하지 않는다. 이 초기 구입 트랜잭션 식별자를 보유 -

original_transaction_id이 : (: https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW2 여기) 자동 재생 가입에 대한 애플의 문서에 따르면

. 모든 구독 이후의 갱신 및 복구 된 거래는 모두이 식별자를 공유합니다.

이 ID는 처음 구매할 때 사용한 거래의 ID를 항상 반영합니다.