Apple's internal purchase is divided into two main parts
Itunnes Related Configurations
I. Configuring relevant information on the Itunnes
First you need to configure some prerequisites, detailed steps are as follows
1. Enter the Itunnes selection agreement, the tax banking business
2. Perfect information, there are 3 main items (contact person, bank information, tax information)
4. Perfect contact information, general fill in the application of developer account information, you can modify
5. The Bank payment number is required to perfect the bank information (that is, an identification of the depositary bank), the name of the bank card holder
6. Perfecting tax Information 7. The following default selection no
8. Confirm the interface, it may not be right, I was up and down 2 interface, the fourth item must be consistent in line
Two. If the above information is perfect, you need to configure the relevant virtual Items 1. Select App
2. Select the function, we add an in-app purchase item.
3. Select the type
A. Consumable products are used once and then exhausted and must be purchased again
B. Non-consumable one-time purchase of the product, will not expire, this item is generally used to restore the purchase of the function
C. Automatic subscription in-class purchase this item will be automatically subscribed for a period of time d. Non-automatic subscription for a one-year subscription service member
4. Submit a screenshot (note that the size is usually used in the internal purchase interface), and then save.
Three. Next you need to add sandbox test account, this account is in the test environment test in the purchase process
1. Click to enter user and function interface
2. Select Sandbox Technical Tester
3. Fill in the tester information (fill in the email that is not used by other developers)
internal purchase implementation processThere are two main situations in which the implementation process is handled locally 1. The program obtains a list of product identifiers through the plist file stored by the bundle.
2. The program sends a request to the App Store to get information about the product.
3. The APP store returns product information.
4. The program displays the returned product information to the user (app's store interface)
5. The user selects a product
6. Program sends payment request to App Store
7. The APP store processes payment requests and returns transaction completion information. 8. The app obtains information and provides content to the user. Rely on the server processing (typically requires an order number corresponding to the corresponding voucher information) 1. The program sends a request to the server to obtain a list of products.
2. The server returns a list containing the product identifiers.
3. The program sends a request to the App Store to get information about the product.
4. The APP store returns product information.
5. The program displays the returned product information to the user (app's store interface)
6. The user selects a product to generate the order number
7. Program sends payment request to App Store
8. The APP store processes payment requests and returns transaction completion information.
9. The program obtains data from the information, (currently the order number and voucher) and sends it to the server.
10. The server sends the data to the App Store to verify the validity of the transaction. (primarily verification of credentials) can be viewed https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/ introduction.html#//apple_ref/doc/uid/tp40010573
The APP store parses the received data and returns the data and identifies whether it is valid.
12. The server reads the returned data to determine what the user has purchased. 13. Tell the client when the server confirms success. The problem needs to be noted is that the order is synchronized with the server, but the purchase process at the client, all because the network problems will appear, the problem of the leak, so each purchase after the success of a local to save a voucher, only when the service side verification through the local delete, In addition, you need to check for unhandled credentials at the appropriate time after the program is started, if necessary, to verify the server. Official demohttps://developer.apple.com/library/content/samplecode/sc1991/introduction/intro.html#//apple_ref/doc/ uid/dts40014726 Reference Http://allluckly.cn/ios Payment/ios Development 2015 latest in-Purchase tutorial
Apple internal purchase Process detailed