Introduction | Overview of In-App Purchase | Retrieving Product Information | Making a Purchase
Adding a Store to Your Application | Verifying Store Receipts | Testing a Store | Auto-Renewable Subscriptions


본 페이지는 iOS In-App Purchase Programming Guide 문서의 Auto-Renewable Subscriptions 부분을 번역해 놓은 페이지 입니다. 발 번역이라 이상한 부분이 있을 수 있습니다. 발견즉시 댓글을 달아 주세요.




Auto-Renewable Subscriptions
자동갱신 구독

In-App Purchase provides a standardized way to implement auto-renewable subscriptions. Auto-renewable subscriptions have a few notable characteristics:
인 - 구매 자동 갱신 구독을 구현하는 표준화 된 방법을 제공합니다. 자동 갱신 구독을 몇 가지 주목할만한 특징이 있습니다 :

  • When you configure an auto-renewable subscription in iTunes Connect, you also configure the duration for the subscription and other marketing options.
    iTunes에서 자동 재생 구독을 연결 구성 할 때, 당신은 또한 가입 및 기타 마케팅 옵션에 대한 기간을 구성합니다.

  • Auto-renewable subscriptions are restored automatically using the same Store Kit functions used to restore non-consumable products. The original purchase transaction as well a transaction for each renewal are sent to your application. See “Restoring Transactions.”
    자동 재생 구독은 비 소모품 제품을 복원하는 데 사용 된 것과 동일한 저장소 키트 기능을 사용하여 자동으로 복원됩니다. 갱신 원래 구입 거래뿐만 아니라 트랜잭션이 응용 프로그램에 전송됩니다. "트랜잭션 복원"을 참조하십시오.

  • When your server verifies a receipt with the App Store and the subscription is both active and has been renewed by the App Store, the App Store returns an updated receipt to your application.
    서버가 앱 스토어가입영수증을 확인하면 활성 둘 다앱 스토어갱신되었습니다 앱 스토어 응용 프로그램에 업데이트 된 영수증을 반환합니다.

Adding Auto-Renewable Subscriptions to Your Store
귀하의 저장소에 자동 재생 구독 추가

To implement auto-renewable subscriptions, follow these steps:
자동 갱신 구독을 구현하려면 다음 단계를 수행하십시오 :

  • Connect to iTunes Connect and use it to create a new shared secret. A shared secret is a password that your server must provide when validating receipts for auto-renewable subscriptions. This shared secret provides an additional layer of security to your transactions with the App Store. See iTunes Connect Developer Guide.
    아이튠즈 연결하고 새 공유 암호를 만드는 데 사용하는 연결합니다.공유 비밀 자동 재생 구독에 대한 영수증을 확인할 때 서버가 제공해야하는 암호입니다. 이 공유 비밀은 앱 스토어거래에 대한 보안의 추가 계층을 제공합니다. iTunes에서 개발자 가이드 연결을 참조하십시오.

  • Configure new products in iTunes Connect with the new auto-renewable subscription type.
    iTunes에서 새로운 제품을 구성하는 새로운 자동 재생 구독 유형 연결합니다.

  • Modify your server’s receipt verification code so that it adds the shared secret to the JSON data it sends to the App Store. Your server’s verification code must parse the response to determine whether the subscription has expired. If the subscription has been renewed by the user, the most current receipt is also returned to your server.
    그것은 앱 스토어로 전송 JSON 데이터를 공유 암호를 추가하도록 서버의 영수증 검증 코드를 수정합니다. 서버의 인증 코드는 구독이 만료되었는지 여부를 결정하기 위해 응답을 구문 분석해야합니다.구독이 사용자에 의해 갱신 된 경우, 가장 최신의 영수증서버에 반환됩니다.

Designing your Client Application
클라이언트 응용 프로그램을 설계

In most cases, your client application should require minimal changes to support auto-renewable subscriptions. In fact, your client application is now made simpler, as you can use the same code to recover auto-renewable subscriptions as you do to recover non-consumable products. Your application receives a separate transaction for each period of time where the subscription was renewed; your application should verify each receipt separately.

대부분의 경우, 클라이언트 응용 프로그램이 자동 갱신 구독을 지원하기 위해 최소한의 변경을 필요로합니다. 사실, 클라이언트 응용 프로그램은 이제이 아닌 소모품 제품을 복구 대로 자동 갱신 구독을 복구하는 동일한 코드를 사용할 수있는, 단순 해졌습니다. 응용 프로그램 등록이 갱신 시간각 기간에 대해 별도의 트랜잭션을 수신합니다 응용 프로그램이 각각 별도로 영수증을 확인해야합니다.

Verifying an Auto-renewable Subscription Receipt
자동 재생 구독 영수증 확인

Verifying a receipt for an auto-renewable subscription is almost identical to the process described in “Verifying Store Receipts.” Your application creates a JSON object and posts it to the App Store. The JSON object for an auto-renewable subscription receipt must include a second parameter — the shared secret you created earlier on iTunes Connect:

자동 재생 구독에 대한 영수증을 확인하기에 설명 된 프로세스와 거의 동일합니다 "상점 영수증 확인."응용 프로그램JSON 개체와 앱 스토어에 게시만듭니다.자동 재생 구독 영수증 JSON 객체는 두 번째 매개 변수가 포함되어야합니다 - 만약 당신이 이전에 아이튠즈 연결에서 생성 된 공유 비밀 :

{
    "receipt-data" : "(receipt bytes here)",
    "password"     : "(shared secret bytes here)"
}

The response includes a status field that indicates whether the receipt was successfully validated.
응답 영수증의 유효성 검사가 성공적으로 완료되었는지 여부를 나타내는 상태 필드가 포함되어 있습니다.

{
    "status" : 0,
    "receipt" : { (receipt here) },
    "latest_receipt" : "(base-64 encoded receipt here)",
    "latest_receipt_info" : { (latest receipt info here) }
}

If the user’s receipt was valid and the subscription is active, the status field holds 0, and the receipt field is populated with the decoded receipt data. If your server receives a non-zero status value, use Table 7-1 to interpret non-zero status codes.

사용자의 접수가 유효이고 가입이 활성 상태 인 경우, 상태 필드는 0보유하고 영수증 필드는 디코딩 영수증 데이터로 채워집니다. 서버가 아닌 상태 값을 수신하면 0이 아닌 상태 코드를 해석하는 표 7-1를 사용합니다.

Table 7-1  Status codes for auto-renewable subscriptions

Status Code

Description

21000

The App Store could not read the JSON object you provided.

21002

The data in the receipt-data property was malformed.

21003

The receipt could not be authenticated.

21004

The shared secret you provided does not match the shared secret on file for your account.

21005

The receipt server is not currently available.

21006

This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.

21007

This receipt is a sandbox receipt, but it was sent to the production service for verification.

21008

This receipt is a production receipt, but it was sent to the sandbox service for verification.

The receipt field on the JSON object holds the parsed information from the receipt. The receipt data for an auto-renewable subscription includes one additional key, and some other key previously described in Table 5-1 are modified slightly for subscriptions. See Table 7-2 for details on the new and modified keys.

The receipt field on the JSON object holds the parsed information from the receipt. The receipt data for an auto-renewable subscription includes one additional key, and some other key previously described in Table 5-1 are modified slightly for subscriptions. See Table 7-2 for details on the new and modified keys.

Table 7-2  Auto-renewable subscription info keys

Key

Description

expires_date

The expiration date of the subscription receipt, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.

original_transaction_id

This holds the transaction identifier for the initial purchase. All subsequent renewals of this subscription and recovered transactions all share this identifier.

original_purchase_date

This holds the purchase date for the initial purchase; it represents the start date for the subscription.

purchase_date

This holds the billing date when this transaction occurred. For a transaction for a renewable subscription, this would be the date when the subscription was renewed. If the receipt being parsed by the App Store was the latest receipt for this subscription, this field holds the date when this subscription was most recently renewed.

In addition to the receipt_data field, the response may also include two new fields. If the user’s subscription is active and was renewed by a transaction that took place after the receipt your server sent to the App Store, the latest_receipt field includes a base-64 encoded receipt for the last renewal for this subscription. The decoded data for this new receipt is also provided in the latest_expired_receipt_info field. Your server can use this new receipt to maintain a record of the most recent renewal.

receipt_data 필드 또한, 응답은 또한 두 개의 새로운 필드를 포함 할 수 있습니다.사용자의 가입이 활성화되고 서버가 앱 스토어로 전송 수령 후 일어났다 트랜잭션에 의해 갱신 된 경우, latest_receipt 필드는이 구독에 대한 최종 갱신 base-64로 인코딩 된 영수증을 포함하고 있습니다. 이 새로운 영수증에 대한 디코드 된 데이터는 latest_expired_receipt_info 필드에 제공됩니다. 서버가장 최근에 갱신의 기록을 유지하기 위해이 새로운 영수증을 사용할 수 있습니다.

Posted by 창업자닉군
,

Introduction | Overview of In-App Purchase | Retrieving Product Information | Making a Purchase
Adding a Store to Your Application | Verifying Store Receipts | Testing a Store | Auto-Renewable Subscriptions


본 페이지는 iOS In-App Purchase Programming Guide 문서의 Testing a Store 부분을 번역해 놓은 페이지 입니다. 발 번역이라 이상한 부분이 있을 수 있습니다. 발견즉시 댓글을 달아 주세요.




Testing a Store
스토어 테스트.

During development, you should test your application to ensure that purchases are working correctly. However, you do not want to charge users while testing your application. Apple provides a sandbox environment to allow you to test your application without creating financial transactions.

개발하는 동안, 당신은 구매가 제대로 작동하는지 확인하기 위해 응용 프로그램을 테스트해야합니다. 그러나, 당신은 응용 프로그램을 테스트하는 동안 사용자를 부과하지 않습니다. Apple은 금융 거래만들지 않고 응용 프로그램을 테스트 할 수 있도록 샌드 박스 환경을 제공합니다.

The Sandbox Environment
샌드 박스 환경

When you launch your application from Xcode, Store Kit does not connect to the App Store. Instead, it connects to a special sandbox store environment. The sandbox environment uses the infrastructure of the App Store, but it does not process actual payments. It returns transactions as if payments were processed successfully. The sandbox environment uses special iTunes Connect accounts that are limited to In-App Purchase testing. You cannot use your normal iTunes Connect account to test your store in the sandbox.

당신은 엑스 코드에서 응용 프로그램을 시작할 때, 스토어 키트앱 스토어에 연결되지 않습니다. 대신 특수 샌드 박스 매장 환경에 연결합니다.샌드 박스 환경은 앱 스토어인프라를 사용하지만 실제 결제를 처리하지 않습니다. 결제가 성공적으로 처리 된 것처럼 트랜잭션을 반환합니다.샌드 박스 환경은 특별한 아이튠즈 앱내 구매 테스트로 제한됩니다 계정을 연결합니다. 당신은 당신의 정상적인 아이튠즈 샌드 박스에서 상점을 테스트하는 계정을 연결 사용할 수 없습니다.


To test your application, create one or more special test accounts in iTunes Connect. You should make at least one test account for each region that your application is localized for. Detailed information about creating test accounts can be found in iTunes Connect Developer Guide.

응용 프로그램을 테스트하려면 연결 iTunes에서 하나 또는 그 이상의 특별한 테스트 계정을 만들 수도 있습니다. 당신은 당신의 응용 프로그램에 대한 지역화 된 영역에 대해 적어도 하나의 테스트 계정을 만들어야합니다. 테스트 계정을 만드는 방법에 대한 자세한 내용개발자 가이드를 연결 iTunes에서 찾을 수 있습니다.

Testing in the Sandbox
샌드 박스에서 테스트

Follow these steps to test your application in the sandbox.
샌드 박스에서 응용 프로그램을 테스트하려면 다음 단계를 수행하십시오.

  1. Log out from your iTunes account on the test device.
    테스트 장치에 아이튠즈 계정에서 로그 아웃합니다.

    Before you can test your application, you must first log out of your regular iTunes account. iOS 3.0 includes a Store category in the Settings application. To log out of your iTunes account, exit your application, launch the Settings application and click the Store icon. Sign out from the currently active account.

    응용 프로그램을 테스트하기 전에, 먼저 일반 아이튠즈 계정에서 로그 아웃해야합니다. IOS 3.0은 설정 애플리케이션 스토어 카테고리를 포함합니다. 아이튠즈 계정에서 로그 아웃하려면, 응용 프로그램을 종료 설정 응용 프로그램을 실행하고 저장 아이콘을 클릭합니다.현재 활성화 된 계정에서 로그 아웃합니다.

  2. Launch your application.
    응용 프로그램을 실행합니다.

    Once you have signed out of your account, exit Settings and launch your application. As you make purchases from your application’s store, Store Kit prompts you to authenticate the transaction. Log in using your test account to approve the payment. No financial transaction takes place, but transactions complete as if a payment was made.

    일단 귀하의 계정을 종료 설정에서 로그 아웃하고 응용 프로그램을 시작했다. 응용 프로그램가게에서 구입을 때, 스토어 키트는 당신이 거래를 인증하라는 메시지를 표시합니다.결제를 승인 테스트 계정을 사용하여 로그인합니다. 어떤 금융 거래이루어지지 않습니다,​​하지만 지불 것처럼 트랜잭션을 수행합니다.

Validating Receipts in the Sandbox
샌드 박스에있는 유효성 검사 영수증

You may also validate receipts created by the sandbox environment. The code to validate a receipt received from the sandbox is identical to that for the regular App Store, except your server must direct the request to the sandbox URL.

당신은 또한 샌드 박스 환경에서 생성 된 영수증을 확인할 수 있습니다. 서버가 샌드 박스 URL로 요청을 직접해야합니다 제외하고 샌드 박스에서받은 영수증을 확인하는 코드는 정기적으로 앱 스토어에 대한 동일합니다.

NSURL *sandboxStoreURL = [[NSURL alloc] initWithString: @"https://sandbox.itunes.apple.com/verifyReceipt"];

Posted by 창업자닉군
,

Introduction | Overview of In-App Purchase | Retrieving Product Information | Making a Purchase
Adding a Store to Your Application | Verifying Store Receipts | Testing a Store | Auto-Renewable Subscriptions


본 페이지는 iOS In-App Purchase Programming Guide 문서의 Verifying Store Receipts 부분을 번역해 놓은 페이지 입니다. 발 번역이라 이상한 부분이 있을 수 있습니다. 발견즉시 댓글을 달아 주세요.



Verifying Store Receipts

Your application should perform the additional step of verifying that the receipt you received from Store Kit came from Apple. This is particularly important when your application relies on a separate server to provide subscriptions, services, or downloadable content. Verifying receipts on your server ensures that requests from your application are valid.

귀하의 응용 프로그램은 스토어 키트에서받은 영수증이 애플에서 나온 것을 확인하는 추가 단계를 수행해야합니다. 응용 프로그램 가입, 서비스 또는 다운로드 콘텐츠를 제공하기 위해 별도의 서버에 의존 할 때 특히 중요합니다. 서버에 영수증을 확인하면 응용 프로그램의 요청이 유효한지 확인합니다.

Verifying a Receipt with the App Store

When Store Kit returns a completed purchase to your payment queue observer, the transaction’s transactionReceipt property contains a signed receipt that records all the critical information for the transaction. Your server can post this receipt to the App Store to verify that the receipt is valid and has not been tampered with. Queries transmitted directly to the App Store are sent and received as JSON dictionaries, as defined in RFC 4627.

스토어 키트가 당신의 지불 관찰자완성 된 구매를 반환 할 때, 트랜잭션transactionReceipt 속성은 트랜잭션에 대한 모든 중요한 정보를 기록하는 서명 영수증을 포함하고 있습니다. 서버영수증 유효하며 손상되지 않았는지 확인하기 위해 앱 스토어에이 영수증을 게시 할 수 있습니다. RFC 4627에 정의 된대로 앱 스토어에 직접 전달 쿼리, JSON 사전으로 전송 수신됩니다.


To verify the receipt, perform the following steps:
영수증을 확인하려면 다음 단계를 수행하십시오 :

  1. Retrieve the receipt data. On iOS, this is the value of the transaction's transactionReceipt property. On OS X, this is the entire contents of the receipt file inside the application bundle. Encode the receipt data using base64 encoding.
    수신 데이터를 검색합니다. 이오스에서트랜잭션transactionReceipt 속성의 값입니다. OS X에서이 응용 프로그램 번들 내부의 영수증 파일의 전체 내용입니다. Base64 인코딩을 사용하여 수신 데이터를 인코딩합니다.

  2. Create a JSON object with a single key named receipt-data and the string you created in step 1. Your JSON code should look like this:
    수신 데이터 1 단계에서 만든 캐릭터라는 하나의 키JSON 개체를 만듭니다. 귀하의 JSON 코드는 다음과 같아야합니다 :

    {
        "receipt-data" : "(receipt bytes here)"
    }
  3. Post the JSON object to the App Store using an HTTP POST request. The URL for the store is https://buy.itunes.apple.com/verifyReceipt.
    HTTP POST 요청을 사용하여 앱 스토어JSON 개체를 게시 할 수 있습니다.저장소의 URLhttps://buy.itunes.apple.com/verifyReceipt입니다.

  4. The response received from the App Store is a JSON object with two keys, status and receipt. It should look something like this:
    앱 스토어에서받은 응답은 두 개의 키, 상태 및 영수증 JSON 개체입니다. 그것은 다음과 같이 보일 것입니다 :

    {
        "status" : 0,
        "receipt" : { (receipt here) }
    }

    If the value of the status key is 0, this is a valid receipt. If the value is anything other than 0, this receipt is invalid.
    상태 키의 값이 0 인 경우,이 유효한 영수증입니다. 값이 0 이외의 경우,이 영수증무효입니다.

The Store Receipt
구입 영수증

The receipt data you send to the App Store encodes information about the transaction. When the App Store validates a receipt, the data stored in the receipt data are decoded and returned in the receipt key of the response. The receipt response is a JSON dictionary that includes all of the information returned to your application in the SKPaymentTransaction object. Your server can query these fields to retrieve the details of the purchase. Apple recommends that you send only the receipt data to your server and use receipt validation to retrieve the purchase details. Because the App Store verifies that the receipt data has not been tampered with, retrieving this information from the response is more secure than transmitting both receipt data and the transaction data to your server.

당신은 앱 스토어로 전송 수신 데이터는 트랜잭션에 대한 정보를 인코딩합니다.앱 스토어 영수증의 유효성을 검사 할 때, 수신 데이터에 저장된 데이터를 디코딩하고 응답을받는 키에 반환됩니다.영수증 응답 SKPaymentTransaction 개체에 응용 프로그램에 반환되는 모든 정보를 포함하는 JSON 사전입니다. 서버구입의 세부 정보를 검색하려면이 필드를 쿼리 할 수 ​​있습니다. 애플은 서버에만 수신 데이터를 전송하고 구매 세부 정보를 검색하는 영수증 유효성 검사를 사용하는 것이 좋습니다.앱 스토어수신 데이터가 변경되지 않았 음을 확인하므로, 응답에서이 정보를 검색하면 서버에 수신 데이터와 트랜잭션 데이터를 모두 전송하는 것보다 더 안전합니다.


Table 5-1 provides a list of keys that you may use to retrieve information about the purchase. Many of these keys match properties on the SKPaymentTransactionclass. All keys not specified in Table 5-1 are reserved for Apple.

표 5-1당신이 구입에 대한 정보를 검색하는 데 사용할 수있는 의 목록을 제공합니다. 이러한 키대부분은 SKPaymentTransactionclass의 속성일치합니다. 표 5-1에 지정되지 않은 모든 키는 애플을 위해 예약되어 있습니다.

Table 5-1  Purchase info keys

Key

Description

quantity

The number of items purchased. This value corresponds to the quantity property of the SKPayment object stored in the transaction’s payment property.

구입한 항목 수. 이 값은 트랜잭션의 지불 속성에 저장 SKPayment 개체의 수량 속성에 해당합니다.

product_id

The product identifier of the item that was purchased. This value corresponds to the productIdentifier property of theSKPayment object stored in the transaction’s payment property.

구입 한 아이템의 제품 식별자입니다. 이 값은 트랜잭션의 지불 속성에 저장 theSKPayment 객체의 productIdentifier 속성에 해당합니다.

transaction_id

The transaction identifier of the item that was purchased. This value corresponds to the transaction’stransactionIdentifier property.

구입 한 항목의 트랜잭션 식별자입니다. 이 값은 transaction'stransactionIdentifier 속성에 해당합니다.

purchase_date

The date and time this transaction occurred. This value corresponds to the transaction’s transactionDate property.

날짜와 시간트랜잭션이 발생했습니다. 이 값은 트랜잭션transactionDate 속성에 해당합니다.

original_transaction_id

For a transaction that restores a previous transaction, this holds the original transaction identifier.

이전 트랜잭션을 복원하는 트랜잭션원래의 트랜잭션 식별자를 보유하고 있습니다.

original_purchase_date

For a transaction that restores a previous transaction, this holds the original purchase date.

이전 트랜잭션을 복원하는 거래의 경우, 이것은 원래 구입 날짜를 보유하고 있습니다.

app_item_id

A string that the App Store uses to uniquely identify the application that created the payment transaction. If your server supports multiple applications, you can use this value to differentiate between them. Applications that are executing in the sandbox do not yet have an app-item-id assigned to them, so this key is missing from receipts created by the sandbox.

앱 스토어고유 지불 거래를 만든 응용 프로그램을 식별하는 데 사용하는 문자열입니다. 서버가 여러 응용 프로그램을 지원하는 경우, 당신은 그들을 구별하기 위해이 값을 사용할 수 있습니다.샌드 박스에서 실행되는 응용 프로그램아직 그들에게 할당 된 응용 프로그램 - 항목 - ID가없는,이 키 샌드 박스에 의해 생성 영수증에서 누락되도록.

version_external_identifier

An arbitrary number that uniquely identifies a revision of your application. This key is missing in receipts created by the sandbox.

고유 응용 프로그램의 버전을 식별하는 임의의 번호입니다. 이 키는 샌드 박스에 의해 생성 영수증에 없습니다.

bid

The bundle identifier for the application.

응용 프로그램의 번들 식별자입니다.

bvrs

A version number for the application.

응용 프로그램의 버전 번호입니다.

Posted by 창업자닉군
,