IOS purchase text flow (2017)

What is the purchase?

As long as the purchase of iPhone in App is not on the physical products (i.e. virtual products such as qq COINS. Coins. Huya e-book… Need to go…) in the purchase process, which take 30% apples.

Use the process required for purchase.

1, fill in the agreement, tax and banking business;
2, fill in the user and function; create the purchased item
3, write code and coordinate with the background
4, add the purchase test account in the project, and check the result

Concrete steps:

The next steps are very complicated. Please be prepared.

Fill in the agreement, tax and banking configuration, https://itunesconnect.apple.com

IOS purchase text flow (2017)

1. request for a contract

IOS purchase text flow (2017)

Fill in address information

IOS purchase text flow (2017)

Read consent agreement

IOS purchase text flow (2017)

2. fill in the contact information

IOS purchase text flow (2017)

add new contact

IOS purchase text flow (2017)
IOS purchase text flow (2017)

Select contact

IOS purchase text flow (2017)

3. fill in bank information

IOS purchase text flow (2017)

Add bank card

IOS purchase text flow (2017)

Select the country where the bank card is located

IOS purchase text flow (2017)

Fill in the bank CNAPS Code IOS purchase text flow (2017)
currency type CN### bank account number, if it is for the public account number, need to fill in the company’s English name, if not, Pinyin

IOS purchase text flow (2017)

4. fill in tax information

U.S Tax Forms: American tax
Australia Tax Forms: Australian Taxation
Canada Tax Forms: Canadian tax

IOS purchase text flow (2017)

the first question is as follows: ask if you are an American resident, do you have an American partnership or an American company, if you don’t choose No directly?.

IOS purchase text flow (2017)

second questions are as follows: ask if you have any commercial activities in the United States, or choose No
directly

IOS purchase text flow (2017)

Then fill in your tax information, including the following:

Individual or Organization Name
Country: individual or organization name: of incorporation
Type of Beneficial Owner country: benefit, independent developers choose one
Permanent Residence
Mailing address: Address:
Name of Person Making mailing address: this Declaration
Title: the title statement

When you fill out this information, you can submit it

IOS purchase text flow (2017)
IOS purchase text flow (2017)
IOS purchase text flow (2017)

5. wait for the audit, the time is about 24 hours.

IOS purchase text flow (2017)

Two. Create purchase items

Select the APP that you want to add to the purchase item, then click function and click + to create the purchase item.

IOS purchase text flow (2017)

Select the type IOS purchase text flow (2017)
based on your own APP requirements

When you fill in the project name ID (the ps: application is purchased for the first time added, you will need to submit an audit along with the new application version. )

IOS purchase text flow (2017)

Add sandbox technician tester

User function > sandbox technology tester

IOS purchase text flow (2017)
IOS purchase text flow (2017)

Matters needing attention:

The mailbox is free to write, but the format is correct (test@163.com), but the mailbox that is already AppleID cannot be used

Don’t pick it up in App Store area. Although any area can be used to test (before app and no area of the line, but in the sandbox), buy boxes will be based on the current AppleID pop-up (sandbox account) the area display language.

Must use the prototype using sandbox (no jailbreak)

Sandbox accounts cannot be logged in directly. AppleStore will prompt for “iTunes accounts” is not allowed when logging in”

You need to exit AppleStore’s account when you do sandbox testing

Three. Code

#import < Foundation/Foundation.h> #import "WXApi.h" typedef NS_ENUM (NSInteger, Payment) {IAP6 = 6, IAP25 = 25, IAP60 = 60}; @interface PayCenter; singleton_interface: NSObject (PayCenter) - (void) - (void) startInit; payWithMoney: (NSInteger) money andType: (PayType) type (NSDictionary * dataDic:) dataDic; @property (nonatomic, strong) MBProgressHUD * HUD; @property (nonatomic, copy) NSString * rechargeNumber; @end
#define @ kProductID_IAP6 "org.qqhl.nursning.6" //6 #import "PayCenter.h" #import "PayHttpRequest.h" //#import "Order.h" //#import "DataSigner.h" //#import < AlipaySDK/AlipaySDK.h> #import; < StoreKit/StoreKit.h> interface (PayCenter) @ < SKPaymentTransactionObserver, SKProductsRequestDelegate> NSInteger _money {int buyType;}; @property (nonatomic, strong) NSMutableDictionary * dataDic; @end @implementation PayCenter singleton_implementation (PayCenter) - (void); startInit registerApp:kWeChatShareAppKey {[WXApi withDescription:appDefaultTilte];} - (void) payWithMoney: (NSInteger) money andType: (PayType) type dataDic: (NSDictionary * dataDic) {_money = money; self.dataDic = [NSMutableDictionary dictionaryWith Dictionary:dataDic]; switch (type) {case PayTypeWX: [self payTypeWXPay]; break case ApplePay:; / / [self payTypeAliPay] [[SKPaymentQueue; defaultQueue]addTransactionObserver:self]; if ([SKPaymentQueue canMakePayments]) {HULog (@ "allows the program to pay for"); [self payTypeApplePay];}else {HULog (@ "does not allow the program to pay the purchase"); UIAlertView *alerView = [[UIAlertView alloc] initWithTitle:@ "prompt" message:@ "your mobile phone did not open the program to pay for" Delegate:nil cancelButtonTitle:NSLocalizedString (@ "closed", nil otherButtonTitles:nil]); [alerView show]; break default: break;};}} - (void) payTypeApplePay{NSLog (@ "-- the request to the corresponding product information -"); NSArray *product = nil; switch (_money) {case IAP6: {product=[[NSArray alloc] initWithObjects:kProductID_IAP6, nil] NSLog (@; the "---------IAP6------------");} case {break; IAP25: NSLog (@ ---------IAP25------------);} break {NSLog; case IAP60: (@ ---------IAP60------------);} break; Default: break NSSet *nsSet;} = [NSSet setWithArray:product]; SKProductsRequest *request [[SKProductsRequest = alloc]initWithProductIdentifiers:nsSet]; request.delegate = self; [request start];} #pragma mark - SKProductsRequestDelegate / / return request proxy server in Apple products - (void) productsRequest: (SKProductsRequest * request) didReceiveResponse: (SKProductsResponse *) response{HULog (@ "receive product information") NSArray; *myProduct = response.products; HULog (@ ID% @ ", response.invalidProductIdentifiers); NSLog (@" paying number%d ", (int) [myProduct count]); //populate UI for (SKProduct *product in myProduct (NSLog) {@" product info "); NSLog (@ SKProdu CT describe the information ", description]);% @ [product NSLog (@" products "title, product.localizedTitle% @ (@ NSLog);" product description information: "% @ product.localizedDescription); NSLog (@"% @ price: ", product.price); NSLog (@ id:", "Product% @ product.productIdentifier) *payment = SKPayment;} nil; switch (_money) {case IAP6:} [SKPayment {payment = paymentWithProductIdentifier:kProductID_IAP6]; break case; IAP25:{default: break};} NSLog (@" the purchase request "); [[SKPaymentQueue defaultQueue]addPayment:payment];} / / monitor method - (void) paymentQueue: (SKPaymentQueue *) queue updatedTransactions: (NSArray< SKPaymentT Ransaction *> *) transactions{NSLog (@) invoked this method several times? "); SKPaymentTransaction *transaction = transactions.lastObject; switch (transaction.transactionState) {case {SKPaymentTransactionStatePurchased: NSLog (@" buy, to their server authentication, transaction.payment.applicationUsername -% @ "); NSData *data = [NSData dataWithContentsOfFile:[[[NSBundle mainBundle] appStoreReceiptURL] path]]; NSString *receipt = [data base64EncodedStringWithOptions:0]; / / [self buySuccessWithReceipt:receipt transaction:transaction]; break case {NSLog}; SKPaymentTransactionStateFailed: (@" transaction failures "); [[SKPaymentQueue defaultQueue] finishTransaction:transaction];} bre AK; case SKPaymentTransactionStateRestored: {NSLog (@ "have already purchased the goods"); [[SKPaymentQueue defaultQueue] finishTransaction:transaction]; break case {NSLog}; SKPaymentTransactionStatePurchasing: (@ "goods added list");} default: {NSLog (@ break; "this is what ah? ")} break;}} @end

Just contact the purchase, if there are deficiencies, please advise