clean up example apps
This commit is contained in:
parent
6a02b9ab85
commit
ccd54b9f2c
|
@ -1,58 +0,0 @@
|
|||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BreakBeforeBinaryOperators: false
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BinPackParameters: false
|
||||
BinPackParameters: false
|
||||
ColumnLimit: 160
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: true
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: true
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
IndentFunctionDeclarationAfterType: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: true
|
||||
ObjCSpaceBeforeProtocolList: false
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Right
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
Standard: Cpp11
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
...
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
//
|
||||
// PKPayment+STPTestKeys.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/8/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <PassKit/PassKit.h>
|
||||
|
||||
extern NSString * const STPSuccessfulChargeCardNumber;
|
||||
extern NSString * const STPFailingChargeCardNumber;
|
||||
|
||||
@interface PKPayment (STPTestKeys)
|
||||
@property(nonatomic, strong) NSString *stp_testCardNumber;
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,30 +0,0 @@
|
|||
//
|
||||
// PKPayment+STPTestKeys.m
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/8/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import "PKPayment+STPTestKeys.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
NSString *const STPSuccessfulChargeCardNumber = @"4242424242424242";
|
||||
NSString *const STPFailingChargeCardNumber = @"4000000000000002";
|
||||
|
||||
@implementation PKPayment (STPTestKeys)
|
||||
@dynamic stp_testCardNumber;
|
||||
|
||||
- (void)setStp_testCardNumber:(NSString *)stp_testCardNumber {
|
||||
objc_setAssociatedObject(self, @selector(stp_testCardNumber), stp_testCardNumber, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
- (NSString *)stp_testCardNumber {
|
||||
return objc_getAssociatedObject(self, @selector(stp_testCardNumber));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,21 +0,0 @@
|
|||
//
|
||||
// STPTestAddressStore.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/30/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "STPTestDataStore.h"
|
||||
#import <AddressBook/AddressBook.h>
|
||||
|
||||
@interface STPTestAddressStore : NSObject<STPTestDataStore>
|
||||
|
||||
- (ABRecordRef)contactForSelectedItemObscure:(BOOL)obscure;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,124 +0,0 @@
|
|||
//
|
||||
// STPTestAddressStore.m
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/30/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
#import "STPTestAddressStore.h"
|
||||
|
||||
@interface STPTestAddressStore ()
|
||||
@property (nonatomic) NSArray *allItems;
|
||||
@end
|
||||
|
||||
@implementation STPTestAddressStore
|
||||
|
||||
@synthesize selectedItem;
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.allItems = @[
|
||||
@{
|
||||
@"name": @"Apple HQ",
|
||||
@"line1": @"1 Infinite Loop",
|
||||
@"line2": @"",
|
||||
@"city": @"Cupertino",
|
||||
@"state": @"CA",
|
||||
@"zip": @"95014",
|
||||
@"country": @"US",
|
||||
@"phone": @"888 555-1212",
|
||||
},
|
||||
@{
|
||||
@"name": @"The White House",
|
||||
@"line1": @"1600 Pennsylvania Ave NW",
|
||||
@"line2": @"",
|
||||
@"city": @"Washington",
|
||||
@"state": @"DC",
|
||||
@"zip": @"20500",
|
||||
@"country": @"US",
|
||||
@"phone": @"888 867-5309",
|
||||
},
|
||||
@{
|
||||
@"name": @"Buckingham Palace",
|
||||
@"line1": @"SW1A 1AA",
|
||||
@"line2": @"",
|
||||
@"city": @"London",
|
||||
@"state": @"",
|
||||
@"zip": @"",
|
||||
@"country": @"UK",
|
||||
@"phone": @"07 987 654 321",
|
||||
},
|
||||
];
|
||||
self.selectedItem = self.allItems[0];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray *)descriptionsForItem:(id)item {
|
||||
return @[item[@"name"], item[@"line1"]];
|
||||
}
|
||||
|
||||
- (ABRecordRef)contactForSelectedItemObscure:(BOOL)obscure {
|
||||
id item = self.selectedItem;
|
||||
ABRecordRef record = ABPersonCreate();
|
||||
|
||||
// address
|
||||
ABMutableMultiValueRef address = ABMultiValueCreateMutable(kABDictionaryPropertyType);
|
||||
CFStringRef keys[5];
|
||||
CFStringRef values[5];
|
||||
CFIndex numValues = 0;
|
||||
|
||||
if (!obscure) {
|
||||
keys[numValues] = kABPersonAddressStreetKey;
|
||||
values[numValues++] = CFBridgingRetain(item[@"line1"]);
|
||||
}
|
||||
keys[numValues] = kABPersonAddressCityKey;
|
||||
values[numValues++] = CFBridgingRetain(item[@"city"]);
|
||||
keys[numValues] = kABPersonAddressStateKey;
|
||||
values[numValues++] = CFBridgingRetain(item[@"state"]);
|
||||
keys[numValues] = kABPersonAddressZIPKey;
|
||||
values[numValues++] = CFBridgingRetain(item[@"zip"]);
|
||||
keys[numValues] = kABPersonAddressCountryKey;
|
||||
values[numValues++] = CFBridgingRetain(item[@"country"]);
|
||||
|
||||
CFDictionaryRef aDict = CFDictionaryCreate(
|
||||
kCFAllocatorDefault, (const void **)keys, (const void **)values, numValues, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
|
||||
ABMultiValueIdentifier identifier;
|
||||
ABMultiValueAddValueAndLabel(address, aDict, kABHomeLabel, &identifier);
|
||||
CFRelease(aDict);
|
||||
ABRecordSetValue(record, kABPersonAddressProperty, address, nil);
|
||||
CFRelease(address);
|
||||
|
||||
// add zip and country fields
|
||||
if (!obscure) {
|
||||
NSString *firstName = [self.selectedItem[@"name"] componentsSeparatedByString:@" "].firstObject;
|
||||
NSString *lastName = [self.selectedItem[@"name"] componentsSeparatedByString:@" "].lastObject;
|
||||
|
||||
// phone
|
||||
ABMutableMultiValueRef phone = ABMultiValueCreateMutable(kABMultiStringPropertyType);
|
||||
ABRecordSetValue(record, kABPersonFirstNameProperty, (__bridge CFTypeRef)(firstName), nil);
|
||||
ABRecordSetValue(record, kABPersonLastNameProperty, (__bridge CFTypeRef)(lastName), nil);
|
||||
ABMultiValueAddValueAndLabel(phone, (__bridge CFTypeRef)(self.selectedItem[@"phone"]), kABPersonPhoneMainLabel, nil);
|
||||
ABRecordSetValue(record, kABPersonPhoneProperty, phone, nil);
|
||||
CFRelease(phone);
|
||||
|
||||
// email
|
||||
ABMutableMultiValueRef email = ABMultiValueCreateMutable(kABMultiStringPropertyType);
|
||||
ABRecordSetValue(record, kABPersonFirstNameProperty, (__bridge CFTypeRef)(firstName), nil);
|
||||
|
||||
ABRecordSetValue(record, kABPersonLastNameProperty, (__bridge CFTypeRef)(lastName), nil);
|
||||
ABMultiValueAddValueAndLabel(email, (__bridge CFTypeRef)(self.selectedItem[@"email"]), kABPersonPhoneMainLabel, nil);
|
||||
ABRecordSetValue(record, kABPersonEmailProperty, email, nil);
|
||||
|
||||
CFRelease(email);
|
||||
}
|
||||
return CFAutorelease(record);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,17 +0,0 @@
|
|||
//
|
||||
// STPTestCardStore.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/30/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "STPTestDataStore.h"
|
||||
|
||||
@interface STPTestCardStore : NSObject <STPTestDataStore>
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,59 +0,0 @@
|
|||
//
|
||||
// STPTestCardStore.m
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/30/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import "STPTestCardStore.h"
|
||||
|
||||
@interface STPTestCardStore ()
|
||||
@property (nonatomic) NSArray *allItems;
|
||||
@end
|
||||
|
||||
@implementation STPTestCardStore
|
||||
|
||||
@synthesize selectedItem;
|
||||
|
||||
+ (NSDictionary *)defaultCard {
|
||||
NSMutableDictionary *card = [NSMutableDictionary new];
|
||||
card[@"name"] = @"Stripe Test Card";
|
||||
card[@"number"] = @"4242424242424242";
|
||||
card[@"expMonth"] = @12;
|
||||
card[@"expYear"] = @2030;
|
||||
card[@"cvc"] = @"123";
|
||||
return [card copy];
|
||||
}
|
||||
|
||||
+ (NSDictionary *)defaultFailingCard {
|
||||
NSMutableDictionary *card = [NSMutableDictionary new];
|
||||
card[@"name"] = @"Stripe Test Card";
|
||||
card[@"number"] = @"4000000000000002";
|
||||
card[@"expMonth"] = @12;
|
||||
card[@"expYear"] = @2030;
|
||||
card[@"cvc"] = @"123";
|
||||
return [card copy];
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.allItems = @[[self.class defaultCard], [self.class defaultFailingCard]];
|
||||
self.selectedItem = self.allItems[0];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray *)descriptionsForItem:(id)item {
|
||||
NSDictionary *card = (NSDictionary *)item;
|
||||
NSString *number = card[@"number"];
|
||||
NSString *suffix = [number substringFromIndex:MAX((NSInteger)[number length] - 4, 0)];
|
||||
return @[card[@"name"], [NSString stringWithFormat:@"**** **** **** %@", suffix]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,21 +0,0 @@
|
|||
//
|
||||
// STPTestDataStore.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 10/1/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol STPTestDataStore <NSObject>
|
||||
|
||||
@property(nonatomic) id selectedItem;
|
||||
@property(nonatomic, readonly) NSArray *allItems;
|
||||
- (NSArray *)descriptionsForItem:(id)item;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,23 +0,0 @@
|
|||
//
|
||||
// STPTestDataTableViewController.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 10/1/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "STPTestDataStore.h"
|
||||
|
||||
typedef void (^STPTestDataTableViewControllerCallback)(id selectedItem);
|
||||
|
||||
@interface STPTestDataTableViewController : UITableViewController
|
||||
|
||||
- (instancetype)initWithStore:(id<STPTestDataStore>)store;
|
||||
@property(nonatomic, copy)STPTestDataTableViewControllerCallback callback;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
//
|
||||
// STPTestDataTableViewController.m
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 10/1/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import "STPTestDataTableViewController.h"
|
||||
|
||||
@interface STPTestDataTableViewController()
|
||||
@property(nonatomic)id<STPTestDataStore>store;
|
||||
@end
|
||||
|
||||
@interface STPTestDataTableViewCell : UITableViewCell
|
||||
@end
|
||||
|
||||
@implementation STPTestDataTableViewCell
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
return [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation STPTestDataTableViewController
|
||||
|
||||
- (instancetype)initWithStore:(id<STPTestDataStore>)store {
|
||||
self = [super initWithStyle:UITableViewStylePlain];
|
||||
if (self) {
|
||||
_store = store;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self.tableView registerClass:[STPTestDataTableViewCell class] forCellReuseIdentifier:@"cell"];
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.store.allItems.count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"
|
||||
forIndexPath:indexPath];
|
||||
id item = self.store.allItems[indexPath.row];
|
||||
NSArray *descriptions = [self.store descriptionsForItem:item];
|
||||
cell.textLabel.text = descriptions[0];
|
||||
cell.detailTextLabel.text = descriptions[1];
|
||||
cell.accessoryType = ([item isEqual:self.store.selectedItem]) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - Table view delegate
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:NO];
|
||||
self.store.selectedItem = self.store.allItems[indexPath.row];
|
||||
[self.tableView reloadData];
|
||||
if (self.callback) {
|
||||
self.callback(self.store.selectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,21 +0,0 @@
|
|||
//
|
||||
// STPTestPaymentAuthorizationViewController.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/30/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <PassKit/PassKit.h>
|
||||
|
||||
@interface STPTestPaymentAuthorizationViewController : UIViewController
|
||||
|
||||
- (instancetype)initWithPaymentRequest:(PKPaymentRequest *)paymentRequest;
|
||||
@property(nonatomic, assign)id<PKPaymentAuthorizationViewControllerDelegate>delegate;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,60 +0,0 @@
|
|||
//
|
||||
// STPTestPaymentAuthorizationViewController.m
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/30/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import "STPTestPaymentAuthorizationViewController.h"
|
||||
#import "STPTestPaymentSummaryViewController.h"
|
||||
|
||||
@interface STPTestPaymentAuthorizationViewController()<UIViewControllerTransitioningDelegate>
|
||||
@property (nonatomic) PKPaymentRequest *paymentRequest;
|
||||
@end
|
||||
|
||||
@interface STPTestPaymentPresentationController : UIPresentationController
|
||||
@end
|
||||
|
||||
@implementation STPTestPaymentAuthorizationViewController
|
||||
|
||||
- (instancetype)initWithPaymentRequest:(PKPaymentRequest *)paymentRequest {
|
||||
self = [super initWithNibName:nil bundle:nil];
|
||||
if (self) {
|
||||
_paymentRequest = paymentRequest;
|
||||
self.transitioningDelegate = self;
|
||||
self.modalPresentationStyle = UIModalPresentationCustom;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
STPTestPaymentSummaryViewController *summary = [[STPTestPaymentSummaryViewController alloc] initWithPaymentRequest:self.paymentRequest];
|
||||
summary.delegate = self.delegate;
|
||||
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:summary];
|
||||
[self addChildViewController:navController];
|
||||
navController.view.frame = self.view.bounds;
|
||||
[self.view addSubview:navController.view];
|
||||
}
|
||||
|
||||
#pragma mark - UIViewControllerTransitioningDelegate
|
||||
|
||||
- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
|
||||
return [[STPTestPaymentPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation STPTestPaymentPresentationController
|
||||
- (CGRect)frameOfPresentedViewInContainerView {
|
||||
CGRect rect = [super frameOfPresentedViewInContainerView];
|
||||
rect.origin.y += 30;
|
||||
rect.size.height -= 30;
|
||||
return rect;
|
||||
}
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,21 +0,0 @@
|
|||
//
|
||||
// STPTestPaymentSummaryViewController.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/8/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <PassKit/PassKit.h>
|
||||
|
||||
@interface STPTestPaymentSummaryViewController : UIViewController
|
||||
|
||||
- (instancetype)initWithPaymentRequest:(PKPaymentRequest *)paymentRequest;
|
||||
@property(nonatomic, assign)id<PKPaymentAuthorizationViewControllerDelegate>delegate;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,299 +0,0 @@
|
|||
//
|
||||
// STPTestPaymentSummaryViewController.m
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 9/8/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import "STPTestPaymentSummaryViewController.h"
|
||||
#import "STPTestDataTableViewController.h"
|
||||
#import "STPTestCardStore.h"
|
||||
#import "STPTestAddressStore.h"
|
||||
#import "STPTestShippingMethodStore.h"
|
||||
#import "PKPayment+STPTestKeys.h"
|
||||
|
||||
NSString *const STPTestPaymentAuthorizationSummaryItemIdentifier = @"STPTestPaymentAuthorizationSummaryItemIdentifier";
|
||||
NSString *const STPTestPaymentAuthorizationTestDataIdentifier = @"STPTestPaymentAuthorizationTestDataIdentifier";
|
||||
|
||||
NSString *const STPTestPaymentSectionTitleCards = @"Credit Card";
|
||||
NSString *const STPTestPaymentSectionTitleBillingAddress = @"Billing Address";
|
||||
NSString *const STPTestPaymentSectionTitleShippingAddress = @"Shipping Address";
|
||||
NSString *const STPTestPaymentSectionTitleShippingMethod = @"Shipping Method";
|
||||
NSString *const STPTestPaymentSectionTitlePayment = @"Payment";
|
||||
|
||||
@interface STPTestPaymentSummaryItemCell : UITableViewCell
|
||||
@end
|
||||
|
||||
@interface STPTestPaymentDataCell : UITableViewCell
|
||||
@end
|
||||
|
||||
@interface STPTestPaymentSummaryViewController () <UITableViewDataSource, UITableViewDelegate>
|
||||
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *payButton;
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
@property (nonatomic) PKPaymentRequest *paymentRequest;
|
||||
@property (nonatomic) NSArray *summaryItems;
|
||||
@property (nonatomic) STPTestCardStore *cardStore;
|
||||
@property (nonatomic) STPTestAddressStore *billingAddressStore;
|
||||
@property (nonatomic) STPTestAddressStore *shippingAddressStore;
|
||||
@property (nonatomic) STPTestShippingMethodStore *shippingMethodStore;
|
||||
@property (nonatomic) NSArray *sectionTitles;
|
||||
@end
|
||||
|
||||
@implementation STPTestPaymentSummaryViewController
|
||||
|
||||
- (instancetype)initWithPaymentRequest:(PKPaymentRequest *)paymentRequest {
|
||||
self = [self initWithNibName:nil bundle:nil];
|
||||
if (self) {
|
||||
_paymentRequest = paymentRequest;
|
||||
_summaryItems = paymentRequest.paymentSummaryItems;
|
||||
_cardStore = [STPTestCardStore new];
|
||||
_billingAddressStore = [STPTestAddressStore new];
|
||||
_shippingAddressStore = [STPTestAddressStore new];
|
||||
_shippingMethodStore = [[STPTestShippingMethodStore alloc] initWithShippingMethods:paymentRequest.shippingMethods];
|
||||
self.navigationItem.rightBarButtonItem =
|
||||
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel:)];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)updateSectionTitles {
|
||||
NSMutableArray *array = [NSMutableArray array];
|
||||
[array addObject:STPTestPaymentSectionTitleCards];
|
||||
if (self.paymentRequest.requiredBillingAddressFields != PKAddressFieldNone) {
|
||||
[array addObject:STPTestPaymentSectionTitleBillingAddress];
|
||||
}
|
||||
if (self.paymentRequest.requiredShippingAddressFields != PKAddressFieldNone) {
|
||||
[array addObject:STPTestPaymentSectionTitleShippingAddress];
|
||||
}
|
||||
if (self.shippingMethodStore.allItems.count) {
|
||||
[array addObject:STPTestPaymentSectionTitleShippingMethod];
|
||||
}
|
||||
[array addObject:STPTestPaymentSectionTitlePayment];
|
||||
self.sectionTitles = [array copy];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self updateSectionTitles];
|
||||
[self.tableView registerClass:[STPTestPaymentSummaryItemCell class] forCellReuseIdentifier:STPTestPaymentAuthorizationSummaryItemIdentifier];
|
||||
[self.tableView registerClass:[STPTestPaymentDataCell class] forCellReuseIdentifier:STPTestPaymentAuthorizationTestDataIdentifier];
|
||||
if (self.paymentRequest.requiredShippingAddressFields != PKAddressFieldNone) {
|
||||
[self didSelectShippingAddress];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (IBAction)makePayment:(id)sender {
|
||||
self.payButton.hidden = YES;
|
||||
[self.activityIndicator startAnimating];
|
||||
|
||||
PKPayment *payment = [PKPayment new];
|
||||
NSDictionary *card = self.cardStore.selectedItem;
|
||||
|
||||
payment.stp_testCardNumber = card[@"number"];
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wundeclared-selector"
|
||||
if ([payment respondsToSelector:@selector(setShippingMethod:)] && self.shippingMethodStore.selectedItem) {
|
||||
[payment performSelector:@selector(setShippingMethod:) withObject:self.shippingMethodStore.selectedItem];
|
||||
}
|
||||
ABRecordRef shippingRecord = [self.shippingAddressStore contactForSelectedItemObscure:NO];
|
||||
if ([payment respondsToSelector:@selector(setShippingAddress:)] && shippingRecord) {
|
||||
[payment performSelector:@selector(setShippingAddress:) withObject:(__bridge id)(shippingRecord)];
|
||||
}
|
||||
ABRecordRef billingRecord = [self.billingAddressStore contactForSelectedItemObscure:NO];
|
||||
if ([payment respondsToSelector:@selector(setBillingAddress:)] && billingRecord) {
|
||||
[payment performSelector:@selector(setBillingAddress:) withObject:(__bridge id)(billingRecord)];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
PKPaymentAuthorizationViewController *auth = (PKPaymentAuthorizationViewController *)self;
|
||||
|
||||
[self.activityIndicator startAnimating];
|
||||
[self.delegate paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)auth
|
||||
didAuthorizePayment:payment
|
||||
completion:^(PKPaymentAuthorizationStatus status) {
|
||||
[self.activityIndicator stopAnimating];
|
||||
[self.delegate paymentAuthorizationViewControllerDidFinish:auth];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)cancel:(id)sender {
|
||||
[self.delegate paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)self];
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return self.sectionTitles.count;
|
||||
}
|
||||
|
||||
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
|
||||
return self.sectionTitles[section];
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
NSString *title = self.sectionTitles[section];
|
||||
if ([title isEqualToString:STPTestPaymentSectionTitlePayment]) {
|
||||
return self.summaryItems.count;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSString *title = self.sectionTitles[indexPath.section];
|
||||
NSString *identifier = [title isEqualToString:STPTestPaymentSectionTitlePayment] ? STPTestPaymentAuthorizationTestDataIdentifier :
|
||||
STPTestPaymentAuthorizationSummaryItemIdentifier;
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
|
||||
[self configureCell:cell forRowAtIndexPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)configureCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSString *title = self.sectionTitles[indexPath.section];
|
||||
if ([title isEqualToString:STPTestPaymentSectionTitlePayment]) {
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
PKPaymentSummaryItem *item = self.summaryItems[indexPath.row];
|
||||
NSString *text = [item.label uppercaseString];
|
||||
if (indexPath.row == [self.tableView numberOfRowsInSection:indexPath.section] - 1) {
|
||||
if (text == nil) {
|
||||
text = @"";
|
||||
}
|
||||
text = [@"PAY " stringByAppendingString:text];
|
||||
}
|
||||
cell.textLabel.text = text;
|
||||
|
||||
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ %@", item.amount.stringValue, self.paymentRequest.currencyCode];
|
||||
return;
|
||||
}
|
||||
|
||||
id<STPTestDataStore> store = [self storeForSection:title];
|
||||
NSArray *descriptions = [store descriptionsForItem:store.selectedItem];
|
||||
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
cell.textLabel.text = descriptions[0];
|
||||
cell.detailTextLabel.text = descriptions[1];
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSString *title = self.sectionTitles[indexPath.section];
|
||||
if ([title isEqualToString:STPTestPaymentSectionTitlePayment]) {
|
||||
return 20.0f;
|
||||
}
|
||||
return 44.0f;
|
||||
}
|
||||
|
||||
- (id<STPTestDataStore>)storeForSection:(NSString *)section {
|
||||
id<STPTestDataStore> store;
|
||||
if ([section isEqualToString:STPTestPaymentSectionTitleCards]) {
|
||||
store = self.cardStore;
|
||||
}
|
||||
if ([section isEqualToString:STPTestPaymentSectionTitleShippingAddress]) {
|
||||
store = self.shippingAddressStore;
|
||||
}
|
||||
if ([section isEqualToString:STPTestPaymentSectionTitleBillingAddress]) {
|
||||
store = self.billingAddressStore;
|
||||
}
|
||||
if ([section isEqualToString:STPTestPaymentSectionTitleShippingMethod]) {
|
||||
store = self.shippingMethodStore;
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return indexPath.section != [tableView numberOfSections] - 1;
|
||||
}
|
||||
|
||||
- (void)didSelectShippingAddress {
|
||||
if ([self.delegate respondsToSelector:@selector(paymentAuthorizationViewController:didSelectShippingAddress:completion:)]) {
|
||||
[self.activityIndicator startAnimating];
|
||||
self.payButton.enabled = NO;
|
||||
self.tableView.userInteractionEnabled = NO;
|
||||
ABRecordRef record = [self.shippingAddressStore contactForSelectedItemObscure:YES];
|
||||
[self.delegate paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)self
|
||||
didSelectShippingAddress:record
|
||||
completion:^(PKPaymentAuthorizationStatus status, NSArray *shippingMethods, NSArray *summaryItems) {
|
||||
if (status == PKPaymentAuthorizationStatusFailure) {
|
||||
[self.delegate paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)self];
|
||||
return;
|
||||
}
|
||||
self.summaryItems = summaryItems;
|
||||
[self.shippingMethodStore setShippingMethods:shippingMethods];
|
||||
[self updateSectionTitles];
|
||||
[self.tableView reloadData];
|
||||
self.payButton.enabled = YES;
|
||||
self.tableView.userInteractionEnabled = YES;
|
||||
[self.activityIndicator stopAnimating];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
id<STPTestDataStore> store = [self storeForSection:self.sectionTitles[indexPath.section]];
|
||||
STPTestDataTableViewController *controller = [[STPTestDataTableViewController alloc] initWithStore:store];
|
||||
if (store == self.shippingAddressStore) {
|
||||
controller.callback = ^void(id item) { [self didSelectShippingAddress]; };
|
||||
}
|
||||
if (store == self.shippingMethodStore) {
|
||||
controller.callback = ^void(id item) {
|
||||
if ([self.delegate respondsToSelector:@selector(paymentAuthorizationViewController:didSelectShippingMethod:completion:)]) {
|
||||
[self.activityIndicator startAnimating];
|
||||
self.payButton.enabled = NO;
|
||||
self.tableView.userInteractionEnabled = NO;
|
||||
PKPaymentAuthorizationViewController *vc = (PKPaymentAuthorizationViewController *)self;
|
||||
[self.delegate paymentAuthorizationViewController:vc
|
||||
didSelectShippingMethod:item
|
||||
completion:^(PKPaymentAuthorizationStatus status, NSArray *summaryItems) {
|
||||
if (status == PKPaymentAuthorizationStatusFailure) {
|
||||
[self.delegate paymentAuthorizationViewControllerDidFinish:vc];
|
||||
return;
|
||||
}
|
||||
self.summaryItems = summaryItems;
|
||||
[self updateSectionTitles];
|
||||
[self.tableView reloadData];
|
||||
self.payButton.enabled = YES;
|
||||
self.tableView.userInteractionEnabled = YES;
|
||||
[self.activityIndicator stopAnimating];
|
||||
}];
|
||||
}
|
||||
};
|
||||
}
|
||||
[self.navigationController pushViewController:controller animated:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation STPTestPaymentSummaryItemCell
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
|
||||
if (self) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation STPTestPaymentDataCell
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
self = [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
|
||||
if (self) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.textLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:12.0];
|
||||
self.detailTextLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:12.0];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,75 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6245" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment version="2048" defaultVersion="1808" identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="STPTestPaymentSummaryViewController">
|
||||
<connections>
|
||||
<outlet property="activityIndicator" destination="HWL-sz-1EN" id="Grg-Rf-Wnr"/>
|
||||
<outlet property="payButton" destination="3W7-r3-MuN" id="DIj-aN-z10"/>
|
||||
<outlet property="tableView" destination="7xh-V2-Cso" id="dYK-cV-NyK"/>
|
||||
<outlet property="view" destination="5Yg-Nv-03m" id="Y2P-FK-Iae"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="5Yg-Nv-03m">
|
||||
<rect key="frame" x="0.0" y="0.0" width="298" height="407"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<visualEffectView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NkH-cS-cq6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="298" height="407"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="Q5v-gg-PyO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="298" height="407"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
</view>
|
||||
<blurEffect style="extraLight"/>
|
||||
</visualEffectView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3W7-r3-MuN">
|
||||
<rect key="frame" x="0.0" y="359" width="298" height="48"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="48" id="uH4-7h-pNc"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Pay">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="makePayment:" destination="-1" eventType="touchUpInside" id="KSE-ol-b6u"/>
|
||||
</connections>
|
||||
</button>
|
||||
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="HWL-sz-1EN">
|
||||
<rect key="frame" x="139" y="373" width="20" height="20"/>
|
||||
</activityIndicatorView>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="none" rowHeight="44" sectionHeaderHeight="8" sectionFooterHeight="1" translatesAutoresizingMaskIntoConstraints="NO" id="7xh-V2-Cso">
|
||||
<rect key="frame" x="0.0" y="30" width="298" height="329"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-1" id="yHS-Xa-uTm"/>
|
||||
<outlet property="delegate" destination="-1" id="Dey-iQ-ERm"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="7xh-V2-Cso" secondAttribute="trailing" id="7FB-yW-5MV"/>
|
||||
<constraint firstAttribute="bottom" secondItem="3W7-r3-MuN" secondAttribute="bottom" id="FbM-MT-8e6"/>
|
||||
<constraint firstItem="3W7-r3-MuN" firstAttribute="leading" secondItem="5Yg-Nv-03m" secondAttribute="leading" id="HQD-tx-QQo"/>
|
||||
<constraint firstItem="7xh-V2-Cso" firstAttribute="leading" secondItem="5Yg-Nv-03m" secondAttribute="leading" id="PFC-7L-Nn5"/>
|
||||
<constraint firstAttribute="trailing" secondItem="NkH-cS-cq6" secondAttribute="trailing" id="YSc-WJ-Lz0"/>
|
||||
<constraint firstItem="7xh-V2-Cso" firstAttribute="top" secondItem="5Yg-Nv-03m" secondAttribute="top" constant="30" id="ZgZ-at-xth"/>
|
||||
<constraint firstItem="HWL-sz-1EN" firstAttribute="centerY" secondItem="3W7-r3-MuN" secondAttribute="centerY" id="dXT-ul-c7b"/>
|
||||
<constraint firstAttribute="bottom" secondItem="NkH-cS-cq6" secondAttribute="bottom" id="gav-lY-CZV"/>
|
||||
<constraint firstItem="HWL-sz-1EN" firstAttribute="centerX" secondItem="3W7-r3-MuN" secondAttribute="centerX" id="h9j-cm-VP6"/>
|
||||
<constraint firstItem="NkH-cS-cq6" firstAttribute="top" secondItem="5Yg-Nv-03m" secondAttribute="top" id="pD3-zK-B2g"/>
|
||||
<constraint firstItem="3W7-r3-MuN" firstAttribute="top" secondItem="7xh-V2-Cso" secondAttribute="bottom" id="rv9-u2-9pX"/>
|
||||
<constraint firstAttribute="trailing" secondItem="3W7-r3-MuN" secondAttribute="trailing" id="s6c-5I-Pq2"/>
|
||||
<constraint firstItem="NkH-cS-cq6" firstAttribute="leading" secondItem="5Yg-Nv-03m" secondAttribute="leading" id="x8Y-Iy-8sQ"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="453" y="324.5"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
|
@ -1,21 +0,0 @@
|
|||
//
|
||||
// STPTestShippingMethodStore.h
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 10/1/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "STPTestDataStore.h"
|
||||
|
||||
@interface STPTestShippingMethodStore : NSObject<STPTestDataStore>
|
||||
|
||||
- (instancetype)initWithShippingMethods:(NSArray *)shippingMethods;
|
||||
- (void)setShippingMethods:(NSArray *)shippingMethods;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,51 +0,0 @@
|
|||
//
|
||||
// STPTestShippingMethodStore.m
|
||||
// StripeExample
|
||||
//
|
||||
// Created by Jack Flintermann on 10/1/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
|
||||
|
||||
#import "STPTestShippingMethodStore.h"
|
||||
#import <PassKit/PassKit.h>
|
||||
|
||||
@interface STPTestShippingMethodStore()
|
||||
@property(nonatomic)NSArray *shippingMethods;
|
||||
@end
|
||||
|
||||
@implementation STPTestShippingMethodStore
|
||||
@synthesize selectedItem;
|
||||
|
||||
- (instancetype)initWithShippingMethods:(NSArray *)shippingMethods {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self setShippingMethods:shippingMethods];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray *)allItems {
|
||||
return self.shippingMethods;
|
||||
}
|
||||
|
||||
- (NSArray *)descriptionsForItem:(id)item {
|
||||
PKShippingMethod *method = (PKShippingMethod *)item;
|
||||
return @[method.label, method.amount.stringValue];
|
||||
}
|
||||
|
||||
- (void)setShippingMethods:(NSArray *)shippingMethods {
|
||||
_shippingMethods = shippingMethods;
|
||||
for (PKShippingMethod *method in shippingMethods) {
|
||||
if ([self.selectedItem isEqual:method]) {
|
||||
self.selectedItem = method;
|
||||
return;
|
||||
}
|
||||
}
|
||||
self.selectedItem = shippingMethods[0];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -73,8 +73,6 @@
|
|||
04FCF64C1A41F76D00DBF696 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
04FCF64E1A41F76D00DBF696 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
04FCF6511A41F76D00DBF696 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
04FCF65C1A41F76D00DBF696 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
04FCF65D1A41F76D00DBF696 /* OSXExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSXExampleTests.m; sourceTree = "<group>"; };
|
||||
04FCF6701A41FB7700DBF696 /* ExampleWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleWindowController.h; sourceTree = "<group>"; };
|
||||
04FCF6711A41FB7700DBF696 /* ExampleWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleWindowController.m; sourceTree = "<group>"; };
|
||||
04FCF6721A41FB7700DBF696 /* ExampleWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ExampleWindowController.xib; sourceTree = "<group>"; };
|
||||
|
@ -153,7 +151,6 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
04FCF6461A41F76D00DBF696 /* OSXExample */,
|
||||
04FCF65A1A41F76D00DBF696 /* OSXExampleTests */,
|
||||
04FCF6451A41F76D00DBF696 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
|
@ -191,23 +188,6 @@
|
|||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
04FCF65A1A41F76D00DBF696 /* OSXExampleTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04FCF65D1A41F76D00DBF696 /* OSXExampleTests.m */,
|
||||
04FCF65B1A41F76D00DBF696 /* Supporting Files */,
|
||||
);
|
||||
path = OSXExampleTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
04FCF65B1A41F76D00DBF696 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04FCF65C1A41F76D00DBF696 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
04FCF66F1A41FA7300DBF696 /* Vendor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
|
@ -19,31 +19,23 @@
|
|||
0470A2B419A5D5DB00B66DB7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0470A2B319A5D5DB00B66DB7 /* Images.xcassets */; };
|
||||
0470A30B19A5D69E00B66DB7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0470A2D119A5D69E00B66DB7 /* Main.storyboard */; };
|
||||
0470A30C19A5D69E00B66DB7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0470A2D419A5D69E00B66DB7 /* InfoPlist.strings */; };
|
||||
04BA872E19F89D5400B79DAF /* PKPayment+STPTestKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BA871F19F89D5400B79DAF /* PKPayment+STPTestKeys.m */; };
|
||||
04BA872F19F89D5400B79DAF /* STPTestAddressStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BA872119F89D5400B79DAF /* STPTestAddressStore.m */; };
|
||||
04BA873019F89D5400B79DAF /* STPTestCardStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BA872319F89D5400B79DAF /* STPTestCardStore.m */; };
|
||||
04BA873119F89D5400B79DAF /* STPTestDataTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BA872619F89D5400B79DAF /* STPTestDataTableViewController.m */; };
|
||||
04BA873219F89D5400B79DAF /* STPTestPaymentAuthorizationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BA872819F89D5400B79DAF /* STPTestPaymentAuthorizationViewController.m */; };
|
||||
04BA873319F89D5400B79DAF /* STPTestPaymentSummaryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BA872A19F89D5400B79DAF /* STPTestPaymentSummaryViewController.m */; };
|
||||
04BA873419F89D5400B79DAF /* STPTestPaymentSummaryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04BA872B19F89D5400B79DAF /* STPTestPaymentSummaryViewController.xib */; };
|
||||
04BA873519F89D5400B79DAF /* STPTestShippingMethodStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BA872D19F89D5400B79DAF /* STPTestShippingMethodStore.m */; };
|
||||
04C0A07619F85E5100D699BB /* ShippingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C0A07519F85E5100D699BB /* ShippingManager.m */; };
|
||||
04C2273E1A5DF81B009251A5 /* STPAPIClient+ApplePay.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2271A1A5DF81B009251A5 /* STPAPIClient+ApplePay.m */; };
|
||||
04C2273F1A5DF81B009251A5 /* Stripe+ApplePay.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2271C1A5DF81B009251A5 /* Stripe+ApplePay.m */; };
|
||||
04C227401A5DF81B009251A5 /* STPPaymentPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2271E1A5DF81B009251A5 /* STPPaymentPresenter.m */; };
|
||||
04C227411A5DF81B009251A5 /* STPCheckoutOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227211A5DF81B009251A5 /* STPCheckoutOptions.m */; };
|
||||
04C227421A5DF81B009251A5 /* STPCheckoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227231A5DF81B009251A5 /* STPCheckoutViewController.m */; };
|
||||
04C227431A5DF81B009251A5 /* STPCheckoutInternalUIWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227261A5DF81B009251A5 /* STPCheckoutInternalUIWebViewController.m */; };
|
||||
04C227441A5DF81B009251A5 /* STPColorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227291A5DF81B009251A5 /* STPColorUtils.m */; };
|
||||
04C227451A5DF81B009251A5 /* STPIOSCheckoutWebViewAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2272B1A5DF81B009251A5 /* STPIOSCheckoutWebViewAdapter.m */; };
|
||||
04C227461A5DF81B009251A5 /* STPOSXCheckoutWebViewAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2272D1A5DF81B009251A5 /* STPOSXCheckoutWebViewAdapter.m */; };
|
||||
04C227471A5DF81B009251A5 /* STPStrictURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2272F1A5DF81B009251A5 /* STPStrictURLProtocol.m */; };
|
||||
04C227481A5DF81B009251A5 /* STPAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227321A5DF81B009251A5 /* STPAPIClient.m */; };
|
||||
04C227491A5DF81B009251A5 /* STPBankAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227341A5DF81B009251A5 /* STPBankAccount.m */; };
|
||||
04C2274A1A5DF81B009251A5 /* STPCard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227361A5DF81B009251A5 /* STPCard.m */; };
|
||||
04C2274B1A5DF81B009251A5 /* STPToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C227381A5DF81B009251A5 /* STPToken.m */; };
|
||||
04C2274C1A5DF81B009251A5 /* Stripe.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2273A1A5DF81B009251A5 /* Stripe.m */; };
|
||||
04C2274D1A5DF81B009251A5 /* StripeError.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2273C1A5DF81B009251A5 /* StripeError.m */; };
|
||||
04CDB1851A5E3B3B00B854EE /* STPAPIClient+ApplePay.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1611A5E3B3B00B854EE /* STPAPIClient+ApplePay.m */; };
|
||||
04CDB1861A5E3B3B00B854EE /* Stripe+ApplePay.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1631A5E3B3B00B854EE /* Stripe+ApplePay.m */; };
|
||||
04CDB1871A5E3B3B00B854EE /* STPPaymentPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1651A5E3B3B00B854EE /* STPPaymentPresenter.m */; };
|
||||
04CDB1881A5E3B3B00B854EE /* STPCheckoutOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1681A5E3B3B00B854EE /* STPCheckoutOptions.m */; };
|
||||
04CDB1891A5E3B3B00B854EE /* STPCheckoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB16A1A5E3B3B00B854EE /* STPCheckoutViewController.m */; };
|
||||
04CDB18A1A5E3B3B00B854EE /* STPCheckoutInternalUIWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB16D1A5E3B3B00B854EE /* STPCheckoutInternalUIWebViewController.m */; };
|
||||
04CDB18B1A5E3B3B00B854EE /* STPColorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1701A5E3B3B00B854EE /* STPColorUtils.m */; };
|
||||
04CDB18C1A5E3B3B00B854EE /* STPIOSCheckoutWebViewAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1721A5E3B3B00B854EE /* STPIOSCheckoutWebViewAdapter.m */; };
|
||||
04CDB18D1A5E3B3B00B854EE /* STPOSXCheckoutWebViewAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1741A5E3B3B00B854EE /* STPOSXCheckoutWebViewAdapter.m */; };
|
||||
04CDB18E1A5E3B3B00B854EE /* STPStrictURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1761A5E3B3B00B854EE /* STPStrictURLProtocol.m */; };
|
||||
04CDB18F1A5E3B3B00B854EE /* STPAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1791A5E3B3B00B854EE /* STPAPIClient.m */; };
|
||||
04CDB1901A5E3B3B00B854EE /* STPBankAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB17B1A5E3B3B00B854EE /* STPBankAccount.m */; };
|
||||
04CDB1911A5E3B3B00B854EE /* STPCard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB17D1A5E3B3B00B854EE /* STPCard.m */; };
|
||||
04CDB1921A5E3B3B00B854EE /* STPToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB17F1A5E3B3B00B854EE /* STPToken.m */; };
|
||||
04CDB1931A5E3B3B00B854EE /* Stripe.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1811A5E3B3B00B854EE /* Stripe.m */; };
|
||||
04CDB1941A5E3B3B00B854EE /* StripeError.m in Sources */ = {isa = PBXBuildFile; fileRef = 04CDB1831A5E3B3B00B854EE /* StripeError.m */; };
|
||||
04E75A3B19A71BFD000003DE /* Parse.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04E75A3A19A71BFD000003DE /* Parse.framework */; };
|
||||
04E75A3D19A71C22000003DE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04E75A3C19A71C22000003DE /* AudioToolbox.framework */; };
|
||||
04E75A3F19A71C2A000003DE /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04E75A3E19A71C2A000003DE /* CFNetwork.framework */; };
|
||||
|
@ -72,62 +64,45 @@
|
|||
0470A2B019A5D5DB00B66DB7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
0470A2B119A5D5DB00B66DB7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
0470A2B319A5D5DB00B66DB7 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
0470A2BA19A5D5DB00B66DB7 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
0470A2D219A5D69E00B66DB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = "<group>"; };
|
||||
0470A2D519A5D69E00B66DB7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = "<group>"; };
|
||||
04BA871E19F89D5400B79DAF /* PKPayment+STPTestKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PKPayment+STPTestKeys.h"; sourceTree = "<group>"; };
|
||||
04BA871F19F89D5400B79DAF /* PKPayment+STPTestKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "PKPayment+STPTestKeys.m"; sourceTree = "<group>"; };
|
||||
04BA872019F89D5400B79DAF /* STPTestAddressStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPTestAddressStore.h; sourceTree = "<group>"; };
|
||||
04BA872119F89D5400B79DAF /* STPTestAddressStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPTestAddressStore.m; sourceTree = "<group>"; };
|
||||
04BA872219F89D5400B79DAF /* STPTestCardStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPTestCardStore.h; sourceTree = "<group>"; };
|
||||
04BA872319F89D5400B79DAF /* STPTestCardStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPTestCardStore.m; sourceTree = "<group>"; };
|
||||
04BA872419F89D5400B79DAF /* STPTestDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPTestDataStore.h; sourceTree = "<group>"; };
|
||||
04BA872519F89D5400B79DAF /* STPTestDataTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPTestDataTableViewController.h; sourceTree = "<group>"; };
|
||||
04BA872619F89D5400B79DAF /* STPTestDataTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPTestDataTableViewController.m; sourceTree = "<group>"; };
|
||||
04BA872719F89D5400B79DAF /* STPTestPaymentAuthorizationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPTestPaymentAuthorizationViewController.h; sourceTree = "<group>"; };
|
||||
04BA872819F89D5400B79DAF /* STPTestPaymentAuthorizationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPTestPaymentAuthorizationViewController.m; sourceTree = "<group>"; };
|
||||
04BA872919F89D5400B79DAF /* STPTestPaymentSummaryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPTestPaymentSummaryViewController.h; sourceTree = "<group>"; };
|
||||
04BA872A19F89D5400B79DAF /* STPTestPaymentSummaryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPTestPaymentSummaryViewController.m; sourceTree = "<group>"; };
|
||||
04BA872B19F89D5400B79DAF /* STPTestPaymentSummaryViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = STPTestPaymentSummaryViewController.xib; sourceTree = "<group>"; };
|
||||
04BA872C19F89D5400B79DAF /* STPTestShippingMethodStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPTestShippingMethodStore.h; sourceTree = "<group>"; };
|
||||
04BA872D19F89D5400B79DAF /* STPTestShippingMethodStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPTestShippingMethodStore.m; sourceTree = "<group>"; };
|
||||
04C0A07319F85BD800D699BB /* StripeExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = StripeExample.entitlements; sourceTree = "<group>"; };
|
||||
04C0A07419F85E5100D699BB /* ShippingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShippingManager.h; sourceTree = "<group>"; };
|
||||
04C0A07519F85E5100D699BB /* ShippingManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShippingManager.m; sourceTree = "<group>"; };
|
||||
04C227191A5DF81B009251A5 /* STPAPIClient+ApplePay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "STPAPIClient+ApplePay.h"; path = "../PublicHeaders/ApplePay/STPAPIClient+ApplePay.h"; sourceTree = "<group>"; };
|
||||
04C2271A1A5DF81B009251A5 /* STPAPIClient+ApplePay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "STPAPIClient+ApplePay.m"; sourceTree = "<group>"; };
|
||||
04C2271B1A5DF81B009251A5 /* Stripe+ApplePay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Stripe+ApplePay.h"; path = "../PublicHeaders/ApplePay/Stripe+ApplePay.h"; sourceTree = "<group>"; };
|
||||
04C2271C1A5DF81B009251A5 /* Stripe+ApplePay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Stripe+ApplePay.m"; sourceTree = "<group>"; };
|
||||
04C2271D1A5DF81B009251A5 /* STPPaymentPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPPaymentPresenter.h; path = ../PublicHeaders/ApplePay/STPPaymentPresenter.h; sourceTree = "<group>"; };
|
||||
04C2271E1A5DF81B009251A5 /* STPPaymentPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPPaymentPresenter.m; sourceTree = "<group>"; };
|
||||
04C227201A5DF81B009251A5 /* STPCheckoutOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPCheckoutOptions.h; path = ../PublicHeaders/Checkout/STPCheckoutOptions.h; sourceTree = "<group>"; };
|
||||
04C227211A5DF81B009251A5 /* STPCheckoutOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCheckoutOptions.m; sourceTree = "<group>"; };
|
||||
04C227221A5DF81B009251A5 /* STPCheckoutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPCheckoutViewController.h; path = ../PublicHeaders/Checkout/STPCheckoutViewController.h; sourceTree = "<group>"; };
|
||||
04C227231A5DF81B009251A5 /* STPCheckoutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCheckoutViewController.m; sourceTree = "<group>"; };
|
||||
04C227241A5DF81B009251A5 /* STPCheckoutDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPCheckoutDelegate.h; sourceTree = "<group>"; };
|
||||
04C227251A5DF81B009251A5 /* STPCheckoutInternalUIWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPCheckoutInternalUIWebViewController.h; sourceTree = "<group>"; };
|
||||
04C227261A5DF81B009251A5 /* STPCheckoutInternalUIWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCheckoutInternalUIWebViewController.m; sourceTree = "<group>"; };
|
||||
04C227271A5DF81B009251A5 /* STPCheckoutWebViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPCheckoutWebViewAdapter.h; sourceTree = "<group>"; };
|
||||
04C227281A5DF81B009251A5 /* STPColorUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPColorUtils.h; sourceTree = "<group>"; };
|
||||
04C227291A5DF81B009251A5 /* STPColorUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPColorUtils.m; sourceTree = "<group>"; };
|
||||
04C2272A1A5DF81B009251A5 /* STPIOSCheckoutWebViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPIOSCheckoutWebViewAdapter.h; sourceTree = "<group>"; };
|
||||
04C2272B1A5DF81B009251A5 /* STPIOSCheckoutWebViewAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPIOSCheckoutWebViewAdapter.m; sourceTree = "<group>"; };
|
||||
04C2272C1A5DF81B009251A5 /* STPOSXCheckoutWebViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPOSXCheckoutWebViewAdapter.h; sourceTree = "<group>"; };
|
||||
04C2272D1A5DF81B009251A5 /* STPOSXCheckoutWebViewAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPOSXCheckoutWebViewAdapter.m; sourceTree = "<group>"; };
|
||||
04C2272E1A5DF81B009251A5 /* STPStrictURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPStrictURLProtocol.h; sourceTree = "<group>"; };
|
||||
04C2272F1A5DF81B009251A5 /* STPStrictURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPStrictURLProtocol.m; sourceTree = "<group>"; };
|
||||
04C227311A5DF81B009251A5 /* STPAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPAPIClient.h; path = PublicHeaders/STPAPIClient.h; sourceTree = "<group>"; };
|
||||
04C227321A5DF81B009251A5 /* STPAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPAPIClient.m; sourceTree = "<group>"; };
|
||||
04C227331A5DF81B009251A5 /* STPBankAccount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPBankAccount.h; path = PublicHeaders/STPBankAccount.h; sourceTree = "<group>"; };
|
||||
04C227341A5DF81B009251A5 /* STPBankAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPBankAccount.m; sourceTree = "<group>"; };
|
||||
04C227351A5DF81B009251A5 /* STPCard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPCard.h; path = PublicHeaders/STPCard.h; sourceTree = "<group>"; };
|
||||
04C227361A5DF81B009251A5 /* STPCard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCard.m; sourceTree = "<group>"; };
|
||||
04C227371A5DF81B009251A5 /* STPToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPToken.h; path = PublicHeaders/STPToken.h; sourceTree = "<group>"; };
|
||||
04C227381A5DF81B009251A5 /* STPToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPToken.m; sourceTree = "<group>"; };
|
||||
04C227391A5DF81B009251A5 /* Stripe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stripe.h; path = PublicHeaders/Stripe.h; sourceTree = "<group>"; };
|
||||
04C2273A1A5DF81B009251A5 /* Stripe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stripe.m; sourceTree = "<group>"; };
|
||||
04C2273B1A5DF81B009251A5 /* StripeError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StripeError.h; path = PublicHeaders/StripeError.h; sourceTree = "<group>"; };
|
||||
04C2273C1A5DF81B009251A5 /* StripeError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StripeError.m; sourceTree = "<group>"; };
|
||||
04CDB1601A5E3B3B00B854EE /* STPAPIClient+ApplePay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "STPAPIClient+ApplePay.h"; path = "../PublicHeaders/ApplePay/STPAPIClient+ApplePay.h"; sourceTree = "<group>"; };
|
||||
04CDB1611A5E3B3B00B854EE /* STPAPIClient+ApplePay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "STPAPIClient+ApplePay.m"; sourceTree = "<group>"; };
|
||||
04CDB1621A5E3B3B00B854EE /* Stripe+ApplePay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Stripe+ApplePay.h"; path = "../PublicHeaders/ApplePay/Stripe+ApplePay.h"; sourceTree = "<group>"; };
|
||||
04CDB1631A5E3B3B00B854EE /* Stripe+ApplePay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Stripe+ApplePay.m"; sourceTree = "<group>"; };
|
||||
04CDB1641A5E3B3B00B854EE /* STPPaymentPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPPaymentPresenter.h; path = ../PublicHeaders/ApplePay/STPPaymentPresenter.h; sourceTree = "<group>"; };
|
||||
04CDB1651A5E3B3B00B854EE /* STPPaymentPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPPaymentPresenter.m; sourceTree = "<group>"; };
|
||||
04CDB1671A5E3B3B00B854EE /* STPCheckoutOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPCheckoutOptions.h; path = ../PublicHeaders/Checkout/STPCheckoutOptions.h; sourceTree = "<group>"; };
|
||||
04CDB1681A5E3B3B00B854EE /* STPCheckoutOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCheckoutOptions.m; sourceTree = "<group>"; };
|
||||
04CDB1691A5E3B3B00B854EE /* STPCheckoutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPCheckoutViewController.h; path = ../PublicHeaders/Checkout/STPCheckoutViewController.h; sourceTree = "<group>"; };
|
||||
04CDB16A1A5E3B3B00B854EE /* STPCheckoutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCheckoutViewController.m; sourceTree = "<group>"; };
|
||||
04CDB16B1A5E3B3B00B854EE /* STPCheckoutDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPCheckoutDelegate.h; sourceTree = "<group>"; };
|
||||
04CDB16C1A5E3B3B00B854EE /* STPCheckoutInternalUIWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPCheckoutInternalUIWebViewController.h; sourceTree = "<group>"; };
|
||||
04CDB16D1A5E3B3B00B854EE /* STPCheckoutInternalUIWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCheckoutInternalUIWebViewController.m; sourceTree = "<group>"; };
|
||||
04CDB16E1A5E3B3B00B854EE /* STPCheckoutWebViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPCheckoutWebViewAdapter.h; sourceTree = "<group>"; };
|
||||
04CDB16F1A5E3B3B00B854EE /* STPColorUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPColorUtils.h; sourceTree = "<group>"; };
|
||||
04CDB1701A5E3B3B00B854EE /* STPColorUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPColorUtils.m; sourceTree = "<group>"; };
|
||||
04CDB1711A5E3B3B00B854EE /* STPIOSCheckoutWebViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPIOSCheckoutWebViewAdapter.h; sourceTree = "<group>"; };
|
||||
04CDB1721A5E3B3B00B854EE /* STPIOSCheckoutWebViewAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPIOSCheckoutWebViewAdapter.m; sourceTree = "<group>"; };
|
||||
04CDB1731A5E3B3B00B854EE /* STPOSXCheckoutWebViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPOSXCheckoutWebViewAdapter.h; sourceTree = "<group>"; };
|
||||
04CDB1741A5E3B3B00B854EE /* STPOSXCheckoutWebViewAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPOSXCheckoutWebViewAdapter.m; sourceTree = "<group>"; };
|
||||
04CDB1751A5E3B3B00B854EE /* STPStrictURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPStrictURLProtocol.h; sourceTree = "<group>"; };
|
||||
04CDB1761A5E3B3B00B854EE /* STPStrictURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPStrictURLProtocol.m; sourceTree = "<group>"; };
|
||||
04CDB1781A5E3B3B00B854EE /* STPAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPAPIClient.h; path = PublicHeaders/STPAPIClient.h; sourceTree = "<group>"; };
|
||||
04CDB1791A5E3B3B00B854EE /* STPAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPAPIClient.m; sourceTree = "<group>"; };
|
||||
04CDB17A1A5E3B3B00B854EE /* STPBankAccount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPBankAccount.h; path = PublicHeaders/STPBankAccount.h; sourceTree = "<group>"; };
|
||||
04CDB17B1A5E3B3B00B854EE /* STPBankAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPBankAccount.m; sourceTree = "<group>"; };
|
||||
04CDB17C1A5E3B3B00B854EE /* STPCard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPCard.h; path = PublicHeaders/STPCard.h; sourceTree = "<group>"; };
|
||||
04CDB17D1A5E3B3B00B854EE /* STPCard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPCard.m; sourceTree = "<group>"; };
|
||||
04CDB17E1A5E3B3B00B854EE /* STPToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STPToken.h; path = PublicHeaders/STPToken.h; sourceTree = "<group>"; };
|
||||
04CDB17F1A5E3B3B00B854EE /* STPToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPToken.m; sourceTree = "<group>"; };
|
||||
04CDB1801A5E3B3B00B854EE /* Stripe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stripe.h; path = PublicHeaders/Stripe.h; sourceTree = "<group>"; };
|
||||
04CDB1811A5E3B3B00B854EE /* Stripe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stripe.m; sourceTree = "<group>"; };
|
||||
04CDB1821A5E3B3B00B854EE /* StripeError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StripeError.h; path = PublicHeaders/StripeError.h; sourceTree = "<group>"; };
|
||||
04CDB1831A5E3B3B00B854EE /* StripeError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StripeError.m; sourceTree = "<group>"; };
|
||||
04E75A3A19A71BFD000003DE /* Parse.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Parse.framework; sourceTree = "<group>"; };
|
||||
04E75A3C19A71C22000003DE /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
||||
04E75A3E19A71C2A000003DE /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
|
||||
|
@ -168,7 +143,6 @@
|
|||
0470A28F19A5D5DB00B66DB7 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04B94B111A44CFF300092C46 /* Vendor */,
|
||||
0470A2A119A5D5DB00B66DB7 /* StripeExample */,
|
||||
0470A29A19A5D5DB00B66DB7 /* Frameworks */,
|
||||
0470A29919A5D5DB00B66DB7 /* Products */,
|
||||
|
@ -199,7 +173,6 @@
|
|||
0470A29B19A5D5DB00B66DB7 /* Foundation.framework */,
|
||||
0470A29D19A5D5DB00B66DB7 /* CoreGraphics.framework */,
|
||||
0470A29F19A5D5DB00B66DB7 /* UIKit.framework */,
|
||||
0470A2BA19A5D5DB00B66DB7 /* XCTest.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
|
@ -207,6 +180,7 @@
|
|||
0470A2A119A5D5DB00B66DB7 /* StripeExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04B94B111A44CFF300092C46 /* Vendor */,
|
||||
04C0A07319F85BD800D699BB /* StripeExample.entitlements */,
|
||||
0470A2D019A5D69E00B66DB7 /* Base.lproj */,
|
||||
0470A2D319A5D69E00B66DB7 /* en.lproj */,
|
||||
|
@ -255,88 +229,65 @@
|
|||
04B94B111A44CFF300092C46 /* Vendor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04C2273D1A5DF81B009251A5 /* Stripe */,
|
||||
04BA871D19F89D5400B79DAF /* ApplePayStubs */,
|
||||
04CDB1841A5E3B3B00B854EE /* Stripe */,
|
||||
);
|
||||
name = Vendor;
|
||||
path = ..;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
04BA871D19F89D5400B79DAF /* ApplePayStubs */ = {
|
||||
04CDB1661A5E3B3B00B854EE /* ApplePay */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04BA871E19F89D5400B79DAF /* PKPayment+STPTestKeys.h */,
|
||||
04BA871F19F89D5400B79DAF /* PKPayment+STPTestKeys.m */,
|
||||
04BA872019F89D5400B79DAF /* STPTestAddressStore.h */,
|
||||
04BA872119F89D5400B79DAF /* STPTestAddressStore.m */,
|
||||
04BA872219F89D5400B79DAF /* STPTestCardStore.h */,
|
||||
04BA872319F89D5400B79DAF /* STPTestCardStore.m */,
|
||||
04BA872419F89D5400B79DAF /* STPTestDataStore.h */,
|
||||
04BA872519F89D5400B79DAF /* STPTestDataTableViewController.h */,
|
||||
04BA872619F89D5400B79DAF /* STPTestDataTableViewController.m */,
|
||||
04BA872719F89D5400B79DAF /* STPTestPaymentAuthorizationViewController.h */,
|
||||
04BA872819F89D5400B79DAF /* STPTestPaymentAuthorizationViewController.m */,
|
||||
04BA872919F89D5400B79DAF /* STPTestPaymentSummaryViewController.h */,
|
||||
04BA872A19F89D5400B79DAF /* STPTestPaymentSummaryViewController.m */,
|
||||
04BA872B19F89D5400B79DAF /* STPTestPaymentSummaryViewController.xib */,
|
||||
04BA872C19F89D5400B79DAF /* STPTestShippingMethodStore.h */,
|
||||
04BA872D19F89D5400B79DAF /* STPTestShippingMethodStore.m */,
|
||||
);
|
||||
path = ApplePayStubs;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
04C2271F1A5DF81B009251A5 /* ApplePay */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04C227191A5DF81B009251A5 /* STPAPIClient+ApplePay.h */,
|
||||
04C2271A1A5DF81B009251A5 /* STPAPIClient+ApplePay.m */,
|
||||
04C2271B1A5DF81B009251A5 /* Stripe+ApplePay.h */,
|
||||
04C2271C1A5DF81B009251A5 /* Stripe+ApplePay.m */,
|
||||
04C2271D1A5DF81B009251A5 /* STPPaymentPresenter.h */,
|
||||
04C2271E1A5DF81B009251A5 /* STPPaymentPresenter.m */,
|
||||
04CDB1601A5E3B3B00B854EE /* STPAPIClient+ApplePay.h */,
|
||||
04CDB1611A5E3B3B00B854EE /* STPAPIClient+ApplePay.m */,
|
||||
04CDB1621A5E3B3B00B854EE /* Stripe+ApplePay.h */,
|
||||
04CDB1631A5E3B3B00B854EE /* Stripe+ApplePay.m */,
|
||||
04CDB1641A5E3B3B00B854EE /* STPPaymentPresenter.h */,
|
||||
04CDB1651A5E3B3B00B854EE /* STPPaymentPresenter.m */,
|
||||
);
|
||||
path = ApplePay;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
04C227301A5DF81B009251A5 /* Checkout */ = {
|
||||
04CDB1771A5E3B3B00B854EE /* Checkout */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04C227201A5DF81B009251A5 /* STPCheckoutOptions.h */,
|
||||
04C227211A5DF81B009251A5 /* STPCheckoutOptions.m */,
|
||||
04C227221A5DF81B009251A5 /* STPCheckoutViewController.h */,
|
||||
04C227231A5DF81B009251A5 /* STPCheckoutViewController.m */,
|
||||
04C227241A5DF81B009251A5 /* STPCheckoutDelegate.h */,
|
||||
04C227251A5DF81B009251A5 /* STPCheckoutInternalUIWebViewController.h */,
|
||||
04C227261A5DF81B009251A5 /* STPCheckoutInternalUIWebViewController.m */,
|
||||
04C227271A5DF81B009251A5 /* STPCheckoutWebViewAdapter.h */,
|
||||
04C227281A5DF81B009251A5 /* STPColorUtils.h */,
|
||||
04C227291A5DF81B009251A5 /* STPColorUtils.m */,
|
||||
04C2272A1A5DF81B009251A5 /* STPIOSCheckoutWebViewAdapter.h */,
|
||||
04C2272B1A5DF81B009251A5 /* STPIOSCheckoutWebViewAdapter.m */,
|
||||
04C2272C1A5DF81B009251A5 /* STPOSXCheckoutWebViewAdapter.h */,
|
||||
04C2272D1A5DF81B009251A5 /* STPOSXCheckoutWebViewAdapter.m */,
|
||||
04C2272E1A5DF81B009251A5 /* STPStrictURLProtocol.h */,
|
||||
04C2272F1A5DF81B009251A5 /* STPStrictURLProtocol.m */,
|
||||
04CDB1671A5E3B3B00B854EE /* STPCheckoutOptions.h */,
|
||||
04CDB1681A5E3B3B00B854EE /* STPCheckoutOptions.m */,
|
||||
04CDB1691A5E3B3B00B854EE /* STPCheckoutViewController.h */,
|
||||
04CDB16A1A5E3B3B00B854EE /* STPCheckoutViewController.m */,
|
||||
04CDB16B1A5E3B3B00B854EE /* STPCheckoutDelegate.h */,
|
||||
04CDB16C1A5E3B3B00B854EE /* STPCheckoutInternalUIWebViewController.h */,
|
||||
04CDB16D1A5E3B3B00B854EE /* STPCheckoutInternalUIWebViewController.m */,
|
||||
04CDB16E1A5E3B3B00B854EE /* STPCheckoutWebViewAdapter.h */,
|
||||
04CDB16F1A5E3B3B00B854EE /* STPColorUtils.h */,
|
||||
04CDB1701A5E3B3B00B854EE /* STPColorUtils.m */,
|
||||
04CDB1711A5E3B3B00B854EE /* STPIOSCheckoutWebViewAdapter.h */,
|
||||
04CDB1721A5E3B3B00B854EE /* STPIOSCheckoutWebViewAdapter.m */,
|
||||
04CDB1731A5E3B3B00B854EE /* STPOSXCheckoutWebViewAdapter.h */,
|
||||
04CDB1741A5E3B3B00B854EE /* STPOSXCheckoutWebViewAdapter.m */,
|
||||
04CDB1751A5E3B3B00B854EE /* STPStrictURLProtocol.h */,
|
||||
04CDB1761A5E3B3B00B854EE /* STPStrictURLProtocol.m */,
|
||||
);
|
||||
path = Checkout;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
04C2273D1A5DF81B009251A5 /* Stripe */ = {
|
||||
04CDB1841A5E3B3B00B854EE /* Stripe */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04C2271F1A5DF81B009251A5 /* ApplePay */,
|
||||
04C227301A5DF81B009251A5 /* Checkout */,
|
||||
04C227311A5DF81B009251A5 /* STPAPIClient.h */,
|
||||
04C227321A5DF81B009251A5 /* STPAPIClient.m */,
|
||||
04C227331A5DF81B009251A5 /* STPBankAccount.h */,
|
||||
04C227341A5DF81B009251A5 /* STPBankAccount.m */,
|
||||
04C227351A5DF81B009251A5 /* STPCard.h */,
|
||||
04C227361A5DF81B009251A5 /* STPCard.m */,
|
||||
04C227371A5DF81B009251A5 /* STPToken.h */,
|
||||
04C227381A5DF81B009251A5 /* STPToken.m */,
|
||||
04C227391A5DF81B009251A5 /* Stripe.h */,
|
||||
04C2273A1A5DF81B009251A5 /* Stripe.m */,
|
||||
04C2273B1A5DF81B009251A5 /* StripeError.h */,
|
||||
04C2273C1A5DF81B009251A5 /* StripeError.m */,
|
||||
04CDB1661A5E3B3B00B854EE /* ApplePay */,
|
||||
04CDB1771A5E3B3B00B854EE /* Checkout */,
|
||||
04CDB1781A5E3B3B00B854EE /* STPAPIClient.h */,
|
||||
04CDB1791A5E3B3B00B854EE /* STPAPIClient.m */,
|
||||
04CDB17A1A5E3B3B00B854EE /* STPBankAccount.h */,
|
||||
04CDB17B1A5E3B3B00B854EE /* STPBankAccount.m */,
|
||||
04CDB17C1A5E3B3B00B854EE /* STPCard.h */,
|
||||
04CDB17D1A5E3B3B00B854EE /* STPCard.m */,
|
||||
04CDB17E1A5E3B3B00B854EE /* STPToken.h */,
|
||||
04CDB17F1A5E3B3B00B854EE /* STPToken.m */,
|
||||
04CDB1801A5E3B3B00B854EE /* Stripe.h */,
|
||||
04CDB1811A5E3B3B00B854EE /* Stripe.m */,
|
||||
04CDB1821A5E3B3B00B854EE /* StripeError.h */,
|
||||
04CDB1831A5E3B3B00B854EE /* StripeError.m */,
|
||||
);
|
||||
name = Stripe;
|
||||
path = ../Stripe;
|
||||
|
@ -412,7 +363,6 @@
|
|||
files = (
|
||||
0470A2B419A5D5DB00B66DB7 /* Images.xcassets in Resources */,
|
||||
0470A2A619A5D5DB00B66DB7 /* InfoPlist.strings in Resources */,
|
||||
04BA873419F89D5400B79DAF /* STPTestPaymentSummaryViewController.xib in Resources */,
|
||||
0470A2AF19A5D5DB00B66DB7 /* Main.storyboard in Resources */,
|
||||
0470A30B19A5D69E00B66DB7 /* Main.storyboard in Resources */,
|
||||
0470A30C19A5D69E00B66DB7 /* InfoPlist.strings in Resources */,
|
||||
|
@ -426,34 +376,27 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
04C2274A1A5DF81B009251A5 /* STPCard.m in Sources */,
|
||||
04C227401A5DF81B009251A5 /* STPPaymentPresenter.m in Sources */,
|
||||
04BA873019F89D5400B79DAF /* STPTestCardStore.m in Sources */,
|
||||
04C227421A5DF81B009251A5 /* STPCheckoutViewController.m in Sources */,
|
||||
04C227491A5DF81B009251A5 /* STPBankAccount.m in Sources */,
|
||||
04C2274B1A5DF81B009251A5 /* STPToken.m in Sources */,
|
||||
04BA872E19F89D5400B79DAF /* PKPayment+STPTestKeys.m in Sources */,
|
||||
04C227481A5DF81B009251A5 /* STPAPIClient.m in Sources */,
|
||||
04C2273E1A5DF81B009251A5 /* STPAPIClient+ApplePay.m in Sources */,
|
||||
04CDB1901A5E3B3B00B854EE /* STPBankAccount.m in Sources */,
|
||||
0470A2B219A5D5DB00B66DB7 /* ViewController.m in Sources */,
|
||||
04C2274C1A5DF81B009251A5 /* Stripe.m in Sources */,
|
||||
04C227441A5DF81B009251A5 /* STPColorUtils.m in Sources */,
|
||||
04C2273F1A5DF81B009251A5 /* Stripe+ApplePay.m in Sources */,
|
||||
04BA873519F89D5400B79DAF /* STPTestShippingMethodStore.m in Sources */,
|
||||
04C227431A5DF81B009251A5 /* STPCheckoutInternalUIWebViewController.m in Sources */,
|
||||
04CDB18B1A5E3B3B00B854EE /* STPColorUtils.m in Sources */,
|
||||
04CDB18A1A5E3B3B00B854EE /* STPCheckoutInternalUIWebViewController.m in Sources */,
|
||||
0470A2AC19A5D5DB00B66DB7 /* AppDelegate.m in Sources */,
|
||||
04C227461A5DF81B009251A5 /* STPOSXCheckoutWebViewAdapter.m in Sources */,
|
||||
04C2274D1A5DF81B009251A5 /* StripeError.m in Sources */,
|
||||
04C227451A5DF81B009251A5 /* STPIOSCheckoutWebViewAdapter.m in Sources */,
|
||||
04C227411A5DF81B009251A5 /* STPCheckoutOptions.m in Sources */,
|
||||
04C227471A5DF81B009251A5 /* STPStrictURLProtocol.m in Sources */,
|
||||
04BA873319F89D5400B79DAF /* STPTestPaymentSummaryViewController.m in Sources */,
|
||||
04CDB1921A5E3B3B00B854EE /* STPToken.m in Sources */,
|
||||
04CDB1931A5E3B3B00B854EE /* Stripe.m in Sources */,
|
||||
04CDB18D1A5E3B3B00B854EE /* STPOSXCheckoutWebViewAdapter.m in Sources */,
|
||||
04E75A5119A734EA000003DE /* Constants.m in Sources */,
|
||||
04BA872F19F89D5400B79DAF /* STPTestAddressStore.m in Sources */,
|
||||
04CDB1851A5E3B3B00B854EE /* STPAPIClient+ApplePay.m in Sources */,
|
||||
04CDB1941A5E3B3B00B854EE /* StripeError.m in Sources */,
|
||||
04CDB1891A5E3B3B00B854EE /* STPCheckoutViewController.m in Sources */,
|
||||
04CDB1861A5E3B3B00B854EE /* Stripe+ApplePay.m in Sources */,
|
||||
04CDB18F1A5E3B3B00B854EE /* STPAPIClient.m in Sources */,
|
||||
04CDB1871A5E3B3B00B854EE /* STPPaymentPresenter.m in Sources */,
|
||||
04CDB1881A5E3B3B00B854EE /* STPCheckoutOptions.m in Sources */,
|
||||
04C0A07619F85E5100D699BB /* ShippingManager.m in Sources */,
|
||||
04CDB18C1A5E3B3B00B854EE /* STPIOSCheckoutWebViewAdapter.m in Sources */,
|
||||
04CDB1911A5E3B3B00B854EE /* STPCard.m in Sources */,
|
||||
0470A2A819A5D5DB00B66DB7 /* main.m in Sources */,
|
||||
04BA873119F89D5400B79DAF /* STPTestDataTableViewController.m in Sources */,
|
||||
04BA873219F89D5400B79DAF /* STPTestPaymentAuthorizationViewController.m in Sources */,
|
||||
04CDB18E1A5E3B3B00B854EE /* STPStrictURLProtocol.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -15,12 +15,6 @@
|
|||
#import "STPCheckoutOptions.h"
|
||||
#import "STPPaymentPresenter.h"
|
||||
#import "StripeError.h"
|
||||
|
||||
#if DEBUG
|
||||
#import "STPTestPaymentAuthorizationViewController.h"
|
||||
#import "PKPayment+STPTestKeys.h"
|
||||
#endif
|
||||
|
||||
#import "STPCheckoutOptions.h"
|
||||
|
||||
@interface ViewController () <STPPaymentPresenterDelegate>
|
||||
|
@ -38,12 +32,6 @@
|
|||
[self updateCartWithNumberOfShirts:0];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
[self updateCartWithNumberOfShirts:1];
|
||||
[self beginPayment:nil];
|
||||
}
|
||||
|
||||
- (void)updateCartWithNumberOfShirts:(NSUInteger)numberOfShirts {
|
||||
NSInteger price = 10;
|
||||
self.amount = [NSDecimalNumber decimalNumberWithMantissa:numberOfShirts * price exponent:0 isNegative:NO];
|
||||
|
@ -87,19 +75,19 @@
|
|||
- (void)createBackendChargeWithToken:(STPToken *)token completion:(STPTokenSubmissionHandler)completion {
|
||||
if (!ParseApplicationId || !ParseClientKey) {
|
||||
NSDictionary *userInfo = @{
|
||||
NSLocalizedDescriptionKey: [NSString
|
||||
stringWithFormat:@"You created a token! Its value is %@. Now, you need to configure your Parse backend in order to charge this customer.",
|
||||
token.tokenId]
|
||||
};
|
||||
NSLocalizedDescriptionKey: [NSString
|
||||
stringWithFormat:@"You created a token! Its value is %@. Now, you need to configure your Parse backend in order to charge this customer.",
|
||||
token.tokenId]
|
||||
};
|
||||
NSError *error = [NSError errorWithDomain:StripeDomain code:STPInvalidRequestError userInfo:userInfo];
|
||||
completion(STPBackendChargeResultFailure, error);
|
||||
return;
|
||||
}
|
||||
NSDictionary *chargeParams = @{
|
||||
@"token": token.tokenId,
|
||||
@"currency": @"usd",
|
||||
@"amount": self.amount.stringValue, // this is in cents (i.e. $10)
|
||||
};
|
||||
@"token": token.tokenId,
|
||||
@"currency": @"usd",
|
||||
@"amount": self.amount.stringValue, // this is in cents (i.e. $10)
|
||||
};
|
||||
// This passes the token off to our payment backend, which will then actually complete charging the card using your account's secret key.
|
||||
[PFCloud callFunctionInBackground:@"charge"
|
||||
withParameters:chargeParams
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.stripe.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,40 +0,0 @@
|
|||
//
|
||||
// OSXExampleTests.m
|
||||
// OSXExampleTests
|
||||
//
|
||||
// Created by Jack Flintermann on 12/17/14.
|
||||
// Copyright (c) 2014 Stripe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
@interface OSXExampleTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation OSXExampleTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testExample {
|
||||
// This is an example of a functional test case.
|
||||
XCTAssert(YES, @"Pass");
|
||||
}
|
||||
|
||||
- (void)testPerformanceExample {
|
||||
// This is an example of a performance test case.
|
||||
[self measureBlock:^{
|
||||
// Put the code you want to measure the time of here.
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
|
@ -11,6 +11,6 @@
|
|||
location = "group:Example/Stripe iOS Example.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:OSXExample/Stripe OSX Example.xcodeproj">
|
||||
location = "group:Example/Stripe OSX Example.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
Loading…
Reference in New Issue