Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
a8a9b788
Commit
a8a9b788
authored
May 18, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move BUYPaymentButton into sample app.
parent
dc38dcf4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
9 deletions
+57
-9
BUYPaymentButton.h
... App Advanced/Library/BUYPaymentButton/BUYPaymentButton.h
+0
-0
BUYPaymentButton.m
... App Advanced/Library/BUYPaymentButton/BUYPaymentButton.m
+0
-0
project.pbxproj
.../Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
+8
-2
CheckoutViewController.m
...d/Mobile Buy SDK Advanced Sample/CheckoutViewController.m
+6
-5
BUYPaymentButton.h
... Buy SDK Advanced Sample/PaymentButton/BUYPaymentButton.h
+43
-0
BUYPaymentButton.m
... Buy SDK Advanced Sample/PaymentButton/BUYPaymentButton.m
+0
-0
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+0
-0
Buy.h
Mobile Buy SDK/Mobile Buy SDK/Buy.h
+0
-1
Buy.h
Mobile Buy SDK/Mobile Buy SDK/Static Framework/Buy.h
+0
-1
No files found.
Mobile Buy SDK
/Mobile Buy SDK
/BUYPaymentButton/BUYPaymentButton.h
→
Mobile Buy SDK
Sample Apps/Sample App Advanced/Library
/BUYPaymentButton/BUYPaymentButton.h
View file @
a8a9b788
File moved
Mobile Buy SDK
/Mobile Buy SDK
/BUYPaymentButton/BUYPaymentButton.m
→
Mobile Buy SDK
Sample Apps/Sample App Advanced/Library
/BUYPaymentButton/BUYPaymentButton.m
View file @
a8a9b788
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
View file @
a8a9b788
...
...
@@ -51,6 +51,7 @@
90B2623E1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90B2623D1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.m */
;
};
90B262411BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90B262401BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m */
;
};
90B262441BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90B262431BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m */
;
};
9A0B0C871CEC8F370037D68F
/* BUYPaymentButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C861CEC8F370037D68F
/* BUYPaymentButton.m */
;
};
BE3437A21BC5C19D00C71330
/* Buy.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE34379F1BC5C18400C71330
/* Buy.framework */
;
};
BE3437A31BC5C19D00C71330
/* Buy.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE34379F1BC5C18400C71330
/* Buy.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
BE8B82511B8CF49D00E3F871
/* main.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE8B82501B8CF49D00E3F871
/* main.m */
;
};
...
...
@@ -205,6 +206,8 @@
90B262401BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ProductViewControllerToggleTableViewCell.m
;
sourceTree
=
"<group>"
;
};
90B262421BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ProductViewControllerThemeTintColorTableViewCell.h
;
sourceTree
=
"<group>"
;
};
90B262431BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ProductViewControllerThemeTintColorTableViewCell.m
;
sourceTree
=
"<group>"
;
};
9A0B0C851CEC8F370037D68F
/* BUYPaymentButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYPaymentButton.h
;
sourceTree
=
"<group>"
;
};
9A0B0C861CEC8F370037D68F
/* BUYPaymentButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYPaymentButton.m
;
sourceTree
=
"<group>"
;
};
BE34378F1BC5C18400C71330
/* Mobile Buy SDK.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
"Mobile Buy SDK.xcodeproj"
;
path
=
"../../Mobile Buy SDK/Mobile Buy SDK.xcodeproj"
;
sourceTree
=
"<group>"
;
};
BE5E28451B94F5C300D2ECB5
/* Mobile Buy SDK Advanced Sample.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xml
;
path
=
"Mobile Buy SDK Advanced Sample.entitlements"
;
sourceTree
=
"<group>"
;
};
BE8B824B1B8CF49D00E3F871
/* Mobile Buy SDK Advanced Sample.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
"Mobile Buy SDK Advanced Sample.app"
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
...
...
@@ -334,6 +337,8 @@
8476128F1CAB059100AB17AA
/* PaymentButton */
=
{
isa
=
PBXGroup
;
children
=
(
9A0B0C851CEC8F370037D68F
/* BUYPaymentButton.h */
,
9A0B0C861CEC8F370037D68F
/* BUYPaymentButton.m */
,
847612901CAB059100AB17AA
/* ImageKit.h */
,
847612911CAB059100AB17AA
/* ImageKit.m */
,
847612921CAB059100AB17AA
/* UIButton+PaymentButton.h */
,
...
...
@@ -377,9 +382,9 @@
BE3437901BC5C18400C71330
/* Products */
=
{
isa
=
PBXGroup
;
children
=
(
BE34379F1BC5C18400C71330
/* Buy.framework */
,
BE34379D1BC5C18400C71330
/* Buy.framework */
,
BE34379B1BC5C18400C71330
/* Mobile Buy SDK Tests.xctest */
,
BE34379D1BC5C18400C71330
/* Buy.framework */
,
BE34379F1BC5C18400C71330
/* Buy.framework */
,
);
name
=
Products
;
sourceTree
=
"<group>"
;
...
...
@@ -577,6 +582,7 @@
8476127B1CAB047600AB17AA
/* HeaderBackgroundView.m in Sources */
,
BE8B82951B8E65D700E3F871
/* PreCheckoutViewController.m in Sources */
,
8476127F1CAB047600AB17AA
/* OptionSelectionViewController.m in Sources */
,
9A0B0C871CEC8F370037D68F
/* BUYPaymentButton.m in Sources */
,
8476127C1CAB047600AB17AA
/* HeaderOverlayView.m in Sources */
,
8476127A1CAB047600AB17AA
/* ProductViewHeader.m in Sources */
,
847612841CAB047600AB17AA
/* VariantSelectionViewController.m in Sources */
,
...
...
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/CheckoutViewController.m
View file @
a8a9b788
...
...
@@ -24,6 +24,7 @@
// THE SOFTWARE.
//
#import <Buy/Buy.h>
#import "CheckoutViewController.h"
#import "GetCompletionStatusOperation.h"
#import "SummaryItemsTableViewCell.h"
...
...
@@ -136,11 +137,11 @@ NSString * const MerchantId = @"";
return
cell
;
}
-
(
void
)
addCreditCardToCheckout
:
(
void
(
^
)(
BOOL
success
))
callback
-
(
void
)
addCreditCardToCheckout
:
(
void
(
^
)(
BOOL
success
,
id
<
BUYPaymentToken
>
token
))
callback
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
YES
];
[
self
.
client
storeCreditCard
:[
self
creditCard
]
checkout
:
self
.
checkout
completion
:^
(
BUYCheckout
*
checkout
,
NSString
*
paymentSessionId
,
NSError
*
error
)
{
[
self
.
client
storeCreditCard
:[
self
creditCard
]
checkout
:
self
.
checkout
completion
:^
(
BUYCheckout
*
checkout
,
id
<
BUYPaymentToken
>
token
,
NSError
*
error
)
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
...
...
@@ -153,7 +154,7 @@ NSString * const MerchantId = @"";
NSLog
(
@"Error applying credit card: %@"
,
error
);
}
callback
(
error
==
nil
&&
checkout
);
callback
(
error
==
nil
&&
checkout
,
token
);
}];
}
...
...
@@ -209,14 +210,14 @@ NSString * const MerchantId = @"";
__weak
CheckoutViewController
*
welf
=
self
;
// First, the credit card must be stored on the checkout
[
self
addCreditCardToCheckout
:
^
(
BOOL
success
)
{
[
self
addCreditCardToCheckout
:
^
(
BOOL
success
,
id
<
BUYPaymentToken
>
token
)
{
if
(
success
)
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
YES
];
// Upon successfully adding the credit card to the checkout, complete checkout must be called immediately
[
welf
.
client
completeCheckout
:
welf
.
checkout
completion
:
^
(
BUYCheckout
*
checkout
,
NSError
*
error
)
{
[
welf
.
client
completeCheckout
:
welf
.
checkout
paymentToken
:
token
completion
:^
(
BUYCheckout
*
checkout
,
NSError
*
error
)
{
if
(
error
==
nil
&&
checkout
)
{
...
...
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/PaymentButton/BUYPaymentButton.h
0 → 100644
View file @
a8a9b788
//
// BUYPaymentButton.h
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2015 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
typedef
NS_ENUM
(
NSInteger
,
BUYPaymentButtonStyle
)
{
BUYPaymentButtonStyleWhite
=
0
,
BUYPaymentButtonStyleWhiteOutline
,
BUYPaymentButtonStyleBlack
};
typedef
NS_ENUM
(
NSInteger
,
BUYPaymentButtonType
)
{
BUYPaymentButtonTypePlain
=
0
,
BUYPaymentButtonTypeBuy
,
BUYPaymentButtonTypeSetup
NS_ENUM_AVAILABLE_IOS
(
9
_0
)
};
@interface
BUYPaymentButton
:
UIButton
+
(
instancetype
)
buttonWithType
:(
BUYPaymentButtonType
)
buttonType
style
:(
BUYPaymentButtonStyle
)
buttonStyle
;
@end
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/PaymentButton/BUYPaymentButton.m
0 → 100644
View file @
a8a9b788
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
a8a9b788
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK/Buy.h
View file @
a8a9b788
...
...
@@ -75,7 +75,6 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
#import <Buy/BUYShopifyErrorCodes.h>
#import <Buy/BUYPaymentToken.h>
#import <Buy/BUYPaymentButton.h>
#import <Buy/NSArray+BUYAdditions.h>
#import <Buy/NSDate+BUYAdditions.h>
...
...
Mobile Buy SDK/Mobile Buy SDK/Static Framework/Buy.h
View file @
a8a9b788
...
...
@@ -72,7 +72,6 @@
#import "BUYShopifyErrorCodes.h"
#import "BUYPaymentToken.h"
#import "BUYPaymentButton.h"
#import "NSArray+BUYAdditions.h"
#import "NSDateFormatter+BUYAdditions.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment