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
41513430
Commit
41513430
authored
May 19, 2016
by
Gabriel O'Flaherty-Chan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUYPaymentButton -> PaymentButton
parent
c5fe5706
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
34 deletions
+34
-34
project.pbxproj
.../Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
+6
-6
PaymentButton.h
...ile Buy SDK Advanced Sample/PaymentButton/PaymentButton.h
+11
-11
PaymentButton.m
...ile Buy SDK Advanced Sample/PaymentButton/PaymentButton.m
+17
-17
No files found.
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
View file @
41513430
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
902C9B921BB08FF500FC456E
/* SummaryItemsTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
902C9B911BB08FF500FC456E
/* SummaryItemsTableViewCell.m */
;
};
902C9B921BB08FF500FC456E
/* SummaryItemsTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
902C9B911BB08FF500FC456E
/* SummaryItemsTableViewCell.m */
;
};
9079F5F41BB1AAA100CB1B35
/* CollectionListViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9079F5F31BB1AAA100CB1B35
/* CollectionListViewController.m */
;
};
9079F5F41BB1AAA100CB1B35
/* CollectionListViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9079F5F31BB1AAA100CB1B35
/* CollectionListViewController.m */
;
};
90A6F42D1BA8BCAC003E7C4F
/* PassKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90A6F42C1BA8BCAC003E7C4F
/* PassKit.framework */
;
};
90A6F42D1BA8BCAC003E7C4F
/* PassKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90A6F42C1BA8BCAC003E7C4F
/* PassKit.framework */
;
};
9A0B0C871CEC8F370037D68F
/*
BUYPaymentButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C861CEC8F370037D68F
/* BUY
PaymentButton.m */
;
};
9A0B0C871CEC8F370037D68F
/*
PaymentButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C861CEC8F370037D68F
/*
PaymentButton.m */
;
};
B2C560B91CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B41CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m */
;
};
B2C560B91CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B41CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m */
;
};
B2C560BA1CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B61CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m */
;
};
B2C560BA1CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B61CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m */
;
};
B2C560BB1CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B81CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m */
;
};
B2C560BB1CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B81CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m */
;
};
...
@@ -198,8 +198,8 @@
...
@@ -198,8 +198,8 @@
9079F5F21BB1AAA100CB1B35
/* CollectionListViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CollectionListViewController.h
;
sourceTree
=
"<group>"
;
};
9079F5F21BB1AAA100CB1B35
/* CollectionListViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CollectionListViewController.h
;
sourceTree
=
"<group>"
;
};
9079F5F31BB1AAA100CB1B35
/* CollectionListViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CollectionListViewController.m
;
sourceTree
=
"<group>"
;
};
9079F5F31BB1AAA100CB1B35
/* CollectionListViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CollectionListViewController.m
;
sourceTree
=
"<group>"
;
};
90A6F42C1BA8BCAC003E7C4F
/* PassKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
PassKit.framework
;
path
=
System/Library/Frameworks/PassKit.framework
;
sourceTree
=
SDKROOT
;
};
90A6F42C1BA8BCAC003E7C4F
/* PassKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
PassKit.framework
;
path
=
System/Library/Frameworks/PassKit.framework
;
sourceTree
=
SDKROOT
;
};
9A0B0C851CEC8F370037D68F
/*
BUYPaymentButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUY
PaymentButton.h
;
sourceTree
=
"<group>"
;
};
9A0B0C851CEC8F370037D68F
/*
PaymentButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
PaymentButton.h
;
sourceTree
=
"<group>"
;
};
9A0B0C861CEC8F370037D68F
/*
BUYPaymentButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUY
PaymentButton.m
;
sourceTree
=
"<group>"
;
};
9A0B0C861CEC8F370037D68F
/*
PaymentButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
PaymentButton.m
;
sourceTree
=
"<group>"
;
};
B2C560B31CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
ProductViewControllerThemeStyleTableViewCell.h
;
path
=
"Product View/ProductViewControllerThemeStyleTableViewCell.h"
;
sourceTree
=
"<group>"
;
};
B2C560B31CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
ProductViewControllerThemeStyleTableViewCell.h
;
path
=
"Product View/ProductViewControllerThemeStyleTableViewCell.h"
;
sourceTree
=
"<group>"
;
};
B2C560B41CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
ProductViewControllerThemeStyleTableViewCell.m
;
path
=
"Product View/ProductViewControllerThemeStyleTableViewCell.m"
;
sourceTree
=
"<group>"
;
};
B2C560B41CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
ProductViewControllerThemeStyleTableViewCell.m
;
path
=
"Product View/ProductViewControllerThemeStyleTableViewCell.m"
;
sourceTree
=
"<group>"
;
};
B2C560B51CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
ProductViewControllerThemeTintColorTableViewCell.h
;
path
=
"Product View/ProductViewControllerThemeTintColorTableViewCell.h"
;
sourceTree
=
"<group>"
;
};
B2C560B51CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
ProductViewControllerThemeTintColorTableViewCell.h
;
path
=
"Product View/ProductViewControllerThemeTintColorTableViewCell.h"
;
sourceTree
=
"<group>"
;
};
...
@@ -337,8 +337,8 @@
...
@@ -337,8 +337,8 @@
8476128F1CAB059100AB17AA
/* PaymentButton */
=
{
8476128F1CAB059100AB17AA
/* PaymentButton */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
9A0B0C851CEC8F370037D68F
/*
BUY
PaymentButton.h */
,
9A0B0C851CEC8F370037D68F
/* PaymentButton.h */
,
9A0B0C861CEC8F370037D68F
/*
BUY
PaymentButton.m */
,
9A0B0C861CEC8F370037D68F
/* PaymentButton.m */
,
847612901CAB059100AB17AA
/* ImageKit.h */
,
847612901CAB059100AB17AA
/* ImageKit.h */
,
847612911CAB059100AB17AA
/* ImageKit.m */
,
847612911CAB059100AB17AA
/* ImageKit.m */
,
847612921CAB059100AB17AA
/* UIButton+PaymentButton.h */
,
847612921CAB059100AB17AA
/* UIButton+PaymentButton.h */
,
...
@@ -581,7 +581,7 @@
...
@@ -581,7 +581,7 @@
8476127B1CAB047600AB17AA
/* HeaderBackgroundView.m in Sources */
,
8476127B1CAB047600AB17AA
/* HeaderBackgroundView.m in Sources */
,
BE8B82951B8E65D700E3F871
/* PreCheckoutViewController.m in Sources */
,
BE8B82951B8E65D700E3F871
/* PreCheckoutViewController.m in Sources */
,
8476127F1CAB047600AB17AA
/* OptionSelectionViewController.m in Sources */
,
8476127F1CAB047600AB17AA
/* OptionSelectionViewController.m in Sources */
,
9A0B0C871CEC8F370037D68F
/*
BUY
PaymentButton.m in Sources */
,
9A0B0C871CEC8F370037D68F
/* PaymentButton.m in Sources */
,
8476127C1CAB047600AB17AA
/* HeaderOverlayView.m in Sources */
,
8476127C1CAB047600AB17AA
/* HeaderOverlayView.m in Sources */
,
B2C560BA1CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
,
B2C560BA1CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
,
B2C560C21CEE39180015AA40
/* UIColor+Additions.m in Sources */
,
B2C560C21CEE39180015AA40
/* UIColor+Additions.m in Sources */
,
...
...
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/PaymentButton/
BUY
PaymentButton.h
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/PaymentButton/PaymentButton.h
View file @
41513430
//
//
//
BUY
PaymentButton.h
// PaymentButton.h
// Mobile Buy SDK
// Mobile Buy SDK
//
//
// Created by Shopify.
// Created by Shopify.
...
@@ -24,20 +24,20 @@
...
@@ -24,20 +24,20 @@
// THE SOFTWARE.
// THE SOFTWARE.
//
//
typedef
NS_ENUM
(
NSInteger
,
BUY
PaymentButtonStyle
)
{
typedef
NS_ENUM
(
NSInteger
,
PaymentButtonStyle
)
{
BUY
PaymentButtonStyleWhite
=
0
,
PaymentButtonStyleWhite
=
0
,
BUY
PaymentButtonStyleWhiteOutline
,
PaymentButtonStyleWhiteOutline
,
BUY
PaymentButtonStyleBlack
PaymentButtonStyleBlack
};
};
typedef
NS_ENUM
(
NSInteger
,
BUY
PaymentButtonType
)
{
typedef
NS_ENUM
(
NSInteger
,
PaymentButtonType
)
{
BUY
PaymentButtonTypePlain
=
0
,
PaymentButtonTypePlain
=
0
,
BUY
PaymentButtonTypeBuy
,
PaymentButtonTypeBuy
,
BUY
PaymentButtonTypeSetup
NS_ENUM_AVAILABLE_IOS
(
9
_0
)
PaymentButtonTypeSetup
NS_ENUM_AVAILABLE_IOS
(
9
_0
)
};
};
@interface
BUY
PaymentButton
:
UIButton
@interface
PaymentButton
:
UIButton
+
(
instancetype
)
buttonWithType
:(
BUYPaymentButtonType
)
buttonType
style
:(
BUY
PaymentButtonStyle
)
buttonStyle
;
+
(
instancetype
)
buttonWithType
:(
PaymentButtonType
)
buttonType
style
:(
PaymentButtonStyle
)
buttonStyle
;
@end
@end
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/PaymentButton/
BUY
PaymentButton.m
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/PaymentButton/PaymentButton.m
View file @
41513430
//
//
//
BUY
PaymentButton.m
// PaymentButton.m
// Mobile Buy SDK
// Mobile Buy SDK
//
//
// Created by Shopify.
// Created by Shopify.
...
@@ -25,25 +25,25 @@
...
@@ -25,25 +25,25 @@
//
//
@import
PassKit
;
@import
PassKit
;
#import "
BUY
PaymentButton.h"
#import "PaymentButton.h"
@interface
BUY
CustomPaymentButton
:
UIButton
@interface
CustomPaymentButton
:
UIButton
@property
(
nonatomic
,
assign
)
BUY
PaymentButtonType
customButtonType
;
@property
(
nonatomic
,
assign
)
PaymentButtonType
customButtonType
;
@property
(
nonatomic
,
assign
)
BUY
PaymentButtonStyle
customButtonStyle
;
@property
(
nonatomic
,
assign
)
PaymentButtonStyle
customButtonStyle
;
-
(
void
)
buttonWithType
:(
BUYPaymentButtonType
)
customButtonType
style
:(
BUY
PaymentButtonStyle
)
customButtonStyle
;
-
(
void
)
buttonWithType
:(
PaymentButtonType
)
customButtonType
style
:(
PaymentButtonStyle
)
customButtonStyle
;
@end
@end
@implementation
BUY
CustomPaymentButton
@implementation
CustomPaymentButton
-
(
void
)
buttonWithType
:(
BUYPaymentButtonType
)
customButtonType
style
:(
BUY
PaymentButtonStyle
)
customButtonStyle
{
-
(
void
)
buttonWithType
:(
PaymentButtonType
)
customButtonType
style
:(
PaymentButtonStyle
)
customButtonStyle
{
self
.
customButtonType
=
customButtonType
;
self
.
customButtonType
=
customButtonType
;
self
.
customButtonStyle
=
customButtonStyle
;
self
.
customButtonStyle
=
customButtonStyle
;
self
.
layer
.
cornerRadius
=
6
;
self
.
layer
.
cornerRadius
=
6
;
self
.
clipsToBounds
=
YES
;
self
.
clipsToBounds
=
YES
;
if
(
self
.
customButtonStyle
==
BUY
PaymentButtonStyleWhiteOutline
)
{
if
(
self
.
customButtonStyle
==
PaymentButtonStyleWhiteOutline
)
{
self
.
layer
.
borderColor
=
[[
UIColor
blackColor
]
CGColor
];
self
.
layer
.
borderColor
=
[[
UIColor
blackColor
]
CGColor
];
self
.
layer
.
borderWidth
=
1
;
self
.
layer
.
borderWidth
=
1
;
}
}
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
UIColor
*
backgroundColor
=
[
UIColor
whiteColor
];
UIColor
*
backgroundColor
=
[
UIColor
whiteColor
];
UIColor
*
foregroundColor
=
[
UIColor
blackColor
];
UIColor
*
foregroundColor
=
[
UIColor
blackColor
];
if
(
self
.
customButtonStyle
==
BUY
PaymentButtonStyleBlack
)
{
if
(
self
.
customButtonStyle
==
PaymentButtonStyleBlack
)
{
backgroundColor
=
[
UIColor
blackColor
];
backgroundColor
=
[
UIColor
blackColor
];
foregroundColor
=
[
UIColor
whiteColor
];
foregroundColor
=
[
UIColor
whiteColor
];
}
}
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
[
foregroundColor
setFill
];
[
foregroundColor
setFill
];
switch
(
self
.
customButtonType
)
{
switch
(
self
.
customButtonType
)
{
case
BUY
PaymentButtonTypeBuy
:
{
case
PaymentButtonTypeBuy
:
{
//// Subframes
//// Subframes
CGRect
buyWithApplyPay
=
CGRectMake
(
CGRectGetMinX
(
frame
)
+
(
CGRectGetWidth
(
frame
)
*
0
.
09790
f
+
0
.
5
f
),
CGRectGetMinY
(
frame
)
+
(
CGRectGetHeight
(
frame
)
*
0
.
25000
f
-
0
.
32
f
)
+
0
.
82
f
,
(
CGRectGetWidth
(
frame
)
*
0
.
89055
f
+
0
.
15
f
)
-
(
CGRectGetWidth
(
frame
)
*
0
.
09790
f
+
0
.
5
f
)
+
0
.
35
f
,
(
CGRectGetHeight
(
frame
)
*
0
.
75414
f
+
0
.
5
f
)
-
(
CGRectGetHeight
(
frame
)
*
0
.
25000
f
-
0
.
32
f
)
-
0
.
82
f
);
CGRect
buyWithApplyPay
=
CGRectMake
(
CGRectGetMinX
(
frame
)
+
(
CGRectGetWidth
(
frame
)
*
0
.
09790
f
+
0
.
5
f
),
CGRectGetMinY
(
frame
)
+
(
CGRectGetHeight
(
frame
)
*
0
.
25000
f
-
0
.
32
f
)
+
0
.
82
f
,
(
CGRectGetWidth
(
frame
)
*
0
.
89055
f
+
0
.
15
f
)
-
(
CGRectGetWidth
(
frame
)
*
0
.
09790
f
+
0
.
5
f
)
+
0
.
35
f
,
(
CGRectGetHeight
(
frame
)
*
0
.
75414
f
+
0
.
5
f
)
-
(
CGRectGetHeight
(
frame
)
*
0
.
25000
f
-
0
.
32
f
)
-
0
.
82
f
);
...
@@ -413,7 +413,7 @@
...
@@ -413,7 +413,7 @@
}
}
}
}
break
;
break
;
case
BUY
PaymentButtonTypePlain
:
{
case
PaymentButtonTypePlain
:
{
//// applePay Drawing
//// applePay Drawing
UIBezierPath
*
applePayPath
=
UIBezierPath
.
bezierPath
;
UIBezierPath
*
applePayPath
=
UIBezierPath
.
bezierPath
;
[
applePayPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
65968
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
37344
f
*
CGRectGetHeight
(
frame
))];
[
applePayPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
65968
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
37344
f
*
CGRectGetHeight
(
frame
))];
...
@@ -569,17 +569,17 @@
...
@@ -569,17 +569,17 @@
@end
@end
@implementation
BUY
PaymentButton
@implementation
PaymentButton
+
(
instancetype
)
buttonWithType
:(
BUYPaymentButtonType
)
buttonType
style
:(
BUY
PaymentButtonStyle
)
buttonStyle
{
+
(
instancetype
)
buttonWithType
:(
PaymentButtonType
)
buttonType
style
:(
PaymentButtonStyle
)
buttonStyle
{
Class
ApplePayButton
=
NSClassFromString
(
@"PKPaymentButton"
);
Class
ApplePayButton
=
NSClassFromString
(
@"PKPaymentButton"
);
if
(
ApplePayButton
)
{
if
(
ApplePayButton
)
{
return
(
BUY
PaymentButton
*
)[
ApplePayButton
buttonWithType
:
buttonType
return
(
PaymentButton
*
)[
ApplePayButton
buttonWithType
:
buttonType
style
:
buttonStyle
];
style
:
buttonStyle
];
}
else
{
}
else
{
BUYCustomPaymentButton
*
customPaymentButton
=
[
BUY
CustomPaymentButton
buttonWithType
:
UIButtonTypeCustom
];
CustomPaymentButton
*
customPaymentButton
=
[
CustomPaymentButton
buttonWithType
:
UIButtonTypeCustom
];
[
customPaymentButton
buttonWithType
:
buttonType
style
:
buttonStyle
];
[
customPaymentButton
buttonWithType
:
buttonType
style
:
buttonStyle
];
return
(
BUY
PaymentButton
*
)
customPaymentButton
;
return
(
PaymentButton
*
)
customPaymentButton
;
}
}
}
}
...
...
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