Skip to content

Commit 219db58

Browse files
committed
support osx 10.9
1 parent 1eaaf50 commit 219db58

6 files changed

Lines changed: 13 additions & 18 deletions

File tree

Example/OSXExample/ExampleWindowController.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
@interface ExampleWindowController () <STPCheckoutViewControllerDelegate>
1313
@property STPCheckoutViewController *checkoutController;
14+
@property (weak) IBOutlet NSButton *buyButton;
1415
@end
1516

1617
@implementation ExampleWindowController
1718

1819
- (IBAction)beginPayment:(id)sender {
1920
STPCheckoutOptions *options = [STPCheckoutOptions new];
20-
options.publishableKey = @"pk_test_09IUAkhSGIz8mQP3prdgKm06";
21+
options.publishableKey = [Stripe defaultPublishableKey];
2122
options.appleMerchantId = @"<#Replace me with your Apple Merchant ID #>";
2223
options.purchaseDescription = @"Tasty Llama food";
2324
options.purchaseAmount = @1000;
@@ -38,26 +39,27 @@ - (IBAction)beginPayment:(id)sender {
3839
options:NSLayoutFormatDirectionLeadingToTrailing
3940
metrics:nil
4041
views:NSDictionaryOfVariableBindings(webView)]];
41-
[self.window.contentViewController addChildViewController:self.checkoutController];
42+
self.buyButton.enabled = NO;
4243
}
4344

4445
- (void)checkoutController:(STPCheckoutViewController *)controller didCreateToken:(STPToken *)token completion:(STPTokenSubmissionHandler)completion {
46+
self.buyButton.enabled = YES;
4547
completion(STPBackendChargeResultSuccess, nil);
4648
}
4749

4850
- (void)checkoutController:(STPCheckoutViewController *)controller didFailWithError:(NSError *)error {
51+
self.buyButton.enabled = YES;
4952
[controller.view removeFromSuperview];
50-
[controller removeFromParentViewController];
5153
}
5254

5355
- (void)checkoutControllerDidCancel:(STPCheckoutViewController *)controller {
56+
self.buyButton.enabled = YES;
5457
[controller.view removeFromSuperview];
55-
[controller removeFromParentViewController];
5658
}
5759

5860
- (void)checkoutControllerDidFinish:(STPCheckoutViewController *)controller {
61+
self.buyButton.enabled = YES;
5962
[controller.view removeFromSuperview];
60-
[controller removeFromParentViewController];
6163
}
6264

6365
@end

Example/OSXExample/ExampleWindowController.xib

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<objects>
77
<customObject id="-2" userLabel="File's Owner" customClass="ExampleWindowController">
88
<connections>
9+
<outlet property="buyButton" destination="xya-P8-w67" id="ws1-rq-Rk1"/>
910
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
1011
</connections>
1112
</customObject>

Example/Stripe OSX Example.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
);
274274
INFOPLIST_FILE = OSXExample/Info.plist;
275275
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
276-
MACOSX_DEPLOYMENT_TARGET = 10.10;
276+
MACOSX_DEPLOYMENT_TARGET = 10.9;
277277
PRODUCT_NAME = "Stripe OSX Example";
278278
};
279279
name = Debug;
@@ -294,7 +294,7 @@
294294
);
295295
INFOPLIST_FILE = OSXExample/Info.plist;
296296
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
297-
MACOSX_DEPLOYMENT_TARGET = 10.10;
297+
MACOSX_DEPLOYMENT_TARGET = 10.9;
298298
PRODUCT_NAME = "Stripe OSX Example";
299299
};
300300
name = Release;

Stripe.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
99
s.frameworks = 'Foundation', 'Security'
1010
s.requires_arc = true
1111
s.ios.deployment_target = '6.0'
12-
s.osx.deployment_target = '10.10'
12+
s.osx.deployment_target = '10.9'
1313
s.default_subspecs = 'Core', 'Checkout'
1414

1515
s.subspec 'Core' do |subspec|

Stripe.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@
13701370
INFOPLIST_FILE = Stripe/Info.plist;
13711371
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
13721372
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
1373-
MACOSX_DEPLOYMENT_TARGET = 10.10;
1373+
MACOSX_DEPLOYMENT_TARGET = 10.9;
13741374
MTL_ENABLE_DEBUG_INFO = YES;
13751375
PRODUCT_NAME = Stripe;
13761376
SDKROOT = macosx;
@@ -1403,7 +1403,7 @@
14031403
INFOPLIST_FILE = Stripe/Info.plist;
14041404
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
14051405
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
1406-
MACOSX_DEPLOYMENT_TARGET = 10.10;
1406+
MACOSX_DEPLOYMENT_TARGET = 10.9;
14071407
MTL_ENABLE_DEBUG_INFO = NO;
14081408
PRODUCT_NAME = Stripe;
14091409
SDKROOT = macosx;

Stripe/Checkout/STPCheckoutViewController.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ - (instancetype)initWithOptions:(STPCheckoutOptions *)options {
103103
- (void)loadView {
104104
NSView *view = [[NSView alloc] initWithFrame:CGRectZero];
105105
self.view = view;
106-
}
107-
108-
- (void)viewDidLoad {
109-
[super viewDidLoad];
110106
if (!self.adapter) {
111107
self.adapter = [STPOSXCheckoutWebViewAdapter new];
112108
self.adapter.delegate = self;
@@ -126,10 +122,6 @@ - (void)viewDidLoad {
126122
views:NSDictionaryOfVariableBindings(webView)]];
127123
}
128124

129-
- (void)viewDidAppear {
130-
[super viewDidAppear];
131-
}
132-
133125
#pragma mark STPCheckoutAdapterDelegate
134126

135127
- (void)checkoutAdapterDidStartLoad:(id<STPCheckoutWebViewAdapter>)adapter {

0 commit comments

Comments
 (0)