Skip to content

Commit fccc16d

Browse files
committed
Update: 添加 PaymentRequest 的相关注释
1 parent 8b19f80 commit fccc16d

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

ApplePayDemo.xcodeproj/project.pbxproj

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
8FC90F551C782E830036451F /* libUPAPayPlugin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8FC90F541C782E830036451F /* libUPAPayPlugin.a */; };
1011
9F46D8DB1C771FF20079AC31 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F46D8DA1C771FF20079AC31 /* main.m */; };
1112
9F46D8DE1C771FF20079AC31 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F46D8DD1C771FF20079AC31 /* AppDelegate.m */; };
1213
9F46D8E11C771FF20079AC31 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F46D8E01C771FF20079AC31 /* ViewController.m */; };
@@ -36,6 +37,9 @@
3637
/* End PBXContainerItemProxy section */
3738

3839
/* Begin PBXFileReference section */
40+
8FC90F511C782E830036451F /* UPAPayPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPAPayPlugin.h; sourceTree = "<group>"; };
41+
8FC90F521C782E830036451F /* UPAPayPluginDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPAPayPluginDelegate.h; sourceTree = "<group>"; };
42+
8FC90F541C782E830036451F /* libUPAPayPlugin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libUPAPayPlugin.a; sourceTree = "<group>"; };
3943
9F46D8D61C771FF20079AC31 /* ApplePayDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ApplePayDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4044
9F46D8DA1C771FF20079AC31 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
4145
9F46D8DC1C771FF20079AC31 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -61,6 +65,7 @@
6165
isa = PBXFrameworksBuildPhase;
6266
buildActionMask = 2147483647;
6367
files = (
68+
8FC90F551C782E830036451F /* libUPAPayPlugin.a in Frameworks */,
6469
9F46D9101C77266C0079AC31 /* PassKit.framework in Frameworks */,
6570
);
6671
runOnlyForDeploymentPostprocessing = 0;
@@ -82,6 +87,40 @@
8287
/* End PBXFrameworksBuildPhase section */
8388

8489
/* Begin PBXGroup section */
90+
8FC90F4E1C782E670036451F /* Vendors */ = {
91+
isa = PBXGroup;
92+
children = (
93+
8FC90F4F1C782E830036451F /* applePaySDK */,
94+
);
95+
path = Vendors;
96+
sourceTree = "<group>";
97+
};
98+
8FC90F4F1C782E830036451F /* applePaySDK */ = {
99+
isa = PBXGroup;
100+
children = (
101+
8FC90F501C782E830036451F /* inc */,
102+
8FC90F531C782E830036451F /* libs */,
103+
);
104+
path = applePaySDK;
105+
sourceTree = "<group>";
106+
};
107+
8FC90F501C782E830036451F /* inc */ = {
108+
isa = PBXGroup;
109+
children = (
110+
8FC90F511C782E830036451F /* UPAPayPlugin.h */,
111+
8FC90F521C782E830036451F /* UPAPayPluginDelegate.h */,
112+
);
113+
path = inc;
114+
sourceTree = "<group>";
115+
};
116+
8FC90F531C782E830036451F /* libs */ = {
117+
isa = PBXGroup;
118+
children = (
119+
8FC90F541C782E830036451F /* libUPAPayPlugin.a */,
120+
);
121+
path = libs;
122+
sourceTree = "<group>";
123+
};
85124
9F46D8CD1C771FF20079AC31 = {
86125
isa = PBXGroup;
87126
children = (
@@ -106,6 +145,7 @@
106145
9F46D8D81C771FF20079AC31 /* ApplePayDemo */ = {
107146
isa = PBXGroup;
108147
children = (
148+
8FC90F4E1C782E670036451F /* Vendors */,
109149
9F46D90C1C77203B0079AC31 /* ApplePayDemo.entitlements */,
110150
9F46D8DC1C771FF20079AC31 /* AppDelegate.h */,
111151
9F46D8DD1C771FF20079AC31 /* AppDelegate.m */,
@@ -431,6 +471,10 @@
431471
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
432472
INFOPLIST_FILE = ApplePayDemo/Info.plist;
433473
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
474+
LIBRARY_SEARCH_PATHS = (
475+
"$(inherited)",
476+
"$(PROJECT_DIR)/ApplePayDemo/Vendors/applePaySDK/libs",
477+
);
434478
PRODUCT_BUNDLE_IDENTIFIER = com.zhimei360.demo.ApplePayDemo;
435479
PRODUCT_NAME = "$(TARGET_NAME)";
436480
PROVISIONING_PROFILE = "";
@@ -446,6 +490,10 @@
446490
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
447491
INFOPLIST_FILE = ApplePayDemo/Info.plist;
448492
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
493+
LIBRARY_SEARCH_PATHS = (
494+
"$(inherited)",
495+
"$(PROJECT_DIR)/ApplePayDemo/Vendors/applePaySDK/libs",
496+
);
449497
PRODUCT_BUNDLE_IDENTIFIER = com.zhimei360.demo.ApplePayDemo;
450498
PRODUCT_NAME = "$(TARGET_NAME)";
451499
PROVISIONING_PROFILE = "";
@@ -458,6 +506,10 @@
458506
BUNDLE_LOADER = "$(TEST_HOST)";
459507
INFOPLIST_FILE = ApplePayDemoTests/Info.plist;
460508
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
509+
LIBRARY_SEARCH_PATHS = (
510+
"$(inherited)",
511+
"$(PROJECT_DIR)/ApplePayDemo/Vendors/applePaySDK/libs",
512+
);
461513
PRODUCT_BUNDLE_IDENTIFIER = com.zhimei360.demo.ApplePayDemoTests;
462514
PRODUCT_NAME = "$(TARGET_NAME)";
463515
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ApplePayDemo.app/ApplePayDemo";
@@ -470,6 +522,10 @@
470522
BUNDLE_LOADER = "$(TEST_HOST)";
471523
INFOPLIST_FILE = ApplePayDemoTests/Info.plist;
472524
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
525+
LIBRARY_SEARCH_PATHS = (
526+
"$(inherited)",
527+
"$(PROJECT_DIR)/ApplePayDemo/Vendors/applePaySDK/libs",
528+
);
473529
PRODUCT_BUNDLE_IDENTIFIER = com.zhimei360.demo.ApplePayDemoTests;
474530
PRODUCT_NAME = "$(TARGET_NAME)";
475531
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ApplePayDemo.app/ApplePayDemo";
@@ -519,6 +575,7 @@
519575
9F46D9051C771FF20079AC31 /* Release */,
520576
);
521577
defaultConfigurationIsVisible = 0;
578+
defaultConfigurationName = Release;
522579
};
523580
9F46D9061C771FF20079AC31 /* Build configuration list for PBXNativeTarget "ApplePayDemoTests" */ = {
524581
isa = XCConfigurationList;
@@ -527,6 +584,7 @@
527584
9F46D9081C771FF20079AC31 /* Release */,
528585
);
529586
defaultConfigurationIsVisible = 0;
587+
defaultConfigurationName = Release;
530588
};
531589
9F46D9091C771FF20079AC31 /* Build configuration list for PBXNativeTarget "ApplePayDemoUITests" */ = {
532590
isa = XCConfigurationList;
@@ -535,6 +593,7 @@
535593
9F46D90B1C771FF20079AC31 /* Release */,
536594
);
537595
defaultConfigurationIsVisible = 0;
596+
defaultConfigurationName = Release;
538597
};
539598
/* End XCConfigurationList section */
540599
};

ApplePayDemo/ViewController.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,20 @@ - (IBAction)pay:(id)sender {
3737
PKPaymentSummaryItem *total = [PKPaymentSummaryItem summaryItemWithLabel:@"Total" amount:[NSDecimalNumber decimalNumberWithString:@"1.99"]];
3838

3939
payment.paymentSummaryItems = @[total];
40-
payment.merchantIdentifier = @"";
40+
41+
// 人民币
4142
payment.currencyCode = @"CNY";
43+
44+
// 中国
4245
payment.countryCode = @"CN";
46+
47+
// 在 developer.apple.com 里设置的 merchantID
4348
payment.merchantIdentifier = @"merchant.com.zhimei360.applepaydemo";
49+
50+
// 支持哪种卡类型,这里表示信用卡
4451
payment.merchantCapabilities = PKMerchantCapabilityCredit;
52+
53+
// 支持哪种结算网关
4554
payment.supportedNetworks = @[PKPaymentNetworkChinaUnionPay];
4655

4756
NSLog(@"payment: %@", payment);

0 commit comments

Comments
 (0)