Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
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
ios1x
Commits
0670e2bb
Commit
0670e2bb
authored
Jun 16, 2017
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,支付验证。
parent
534c3f10
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
65 deletions
+79
-65
project.pbxproj
iCemarose.xcodeproj/project.pbxproj
+6
-0
KWMBeforePayData.h
iCemarose/Class/Model/KWMBeforePayData.h
+17
-0
KWMBeforePayData.m
iCemarose/Class/Model/KWMBeforePayData.m
+15
-0
KWMFilter.h
iCemarose/Class/Model/KWMFilter.h
+1
-1
KWMBeforePayVC.h
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.h
+7
-1
KWMBeforePayVC.m
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
+32
-0
KWMPayTypeVC.h
iCemarose/Class/UI/ShopCart/KWMPayTypeVC.h
+1
-0
ShopCart.storyboard
iCemarose/Class/UI/ShopCart/ShopCart.storyboard
+0
-63
No files found.
iCemarose.xcodeproj/project.pbxproj
View file @
0670e2bb
...
...
@@ -187,6 +187,7 @@
C03943C01DD1FCE900141475
/* KWMProductType.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C03943BF1DD1FCE900141475
/* KWMProductType.m */
;
};
C03943C31DD1FD3F00141475
/* KWMProductTypeResult.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C03943C21DD1FD3F00141475
/* KWMProductTypeResult.m */
;
};
C03A05061E35DC5800BAA889
/* KWMNewGiftCardVC.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C03A05051E35DC5800BAA889
/* KWMNewGiftCardVC.m */
;
};
C048B8E21EF3C04B000DA7AF
/* KWMBeforePayData.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C048B8E11EF3C04B000DA7AF
/* KWMBeforePayData.m */
;
};
C05910941E34A729002990B3
/* KWMNewGiftCardCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C05910921E34A729002990B3
/* KWMNewGiftCardCell.m */
;
};
C05910951E34A729002990B3
/* KWMNewGiftCardCell.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C05910931E34A729002990B3
/* KWMNewGiftCardCell.xib */
;
};
C06665091D75A2E500F02EF4
/* KWMOrderCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C06665041D75A2E500F02EF4
/* KWMOrderCell.m */
;
};
...
...
@@ -632,6 +633,8 @@
C03943C21DD1FD3F00141475
/* KWMProductTypeResult.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMProductTypeResult.m
;
sourceTree
=
"<group>"
;
};
C03A05041E35DC5800BAA889
/* KWMNewGiftCardVC.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMNewGiftCardVC.h
;
sourceTree
=
"<group>"
;
};
C03A05051E35DC5800BAA889
/* KWMNewGiftCardVC.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMNewGiftCardVC.m
;
sourceTree
=
"<group>"
;
};
C048B8E01EF3C04B000DA7AF
/* KWMBeforePayData.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMBeforePayData.h
;
sourceTree
=
"<group>"
;
};
C048B8E11EF3C04B000DA7AF
/* KWMBeforePayData.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMBeforePayData.m
;
sourceTree
=
"<group>"
;
};
C05910911E34A729002990B3
/* KWMNewGiftCardCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
KWMNewGiftCardCell.h
;
path
=
../../ShopCart/Cell/KWMNewGiftCardCell.h
;
sourceTree
=
"<group>"
;
};
C05910921E34A729002990B3
/* KWMNewGiftCardCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
KWMNewGiftCardCell.m
;
path
=
../../ShopCart/Cell/KWMNewGiftCardCell.m
;
sourceTree
=
"<group>"
;
};
C05910931E34A729002990B3
/* KWMNewGiftCardCell.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
name
=
KWMNewGiftCardCell.xib
;
path
=
../../ShopCart/Cell/KWMNewGiftCardCell.xib
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1163,6 +1166,8 @@
9BE61CFD1ECD66BC0031D21E
/* KWMShoppingCart.m */
,
C0CCB3BB1EEA589200BC2FB8
/* KWMFilter.h */
,
C0CCB3BC1EEA589200BC2FB8
/* KWMFilter.m */
,
C048B8E01EF3C04B000DA7AF
/* KWMBeforePayData.h */
,
C048B8E11EF3C04B000DA7AF
/* KWMBeforePayData.m */
,
);
path
=
Model
;
sourceTree
=
"<group>"
;
...
...
@@ -2167,6 +2172,7 @@
C03120B01EF2B26B00E49EFA
/* KWMPayUtil.m in Sources */
,
9BE61CFB1ECD56E70031D21E
/* KWMDictioaryResult.m in Sources */
,
C034E6D81D6AEF1B006EE129
/* KWMImageUtil.m in Sources */
,
C048B8E21EF3C04B000DA7AF
/* KWMBeforePayData.m in Sources */
,
C03846941DB89EEB008C3BAB
/* KWMCemaroseResult.m in Sources */
,
C0F586951E25C17A001248E2
/* KWMProductDetailVC.m in Sources */
,
C0F586871E24F820001248E2
/* KWMNewTypeSelectedVC.m in Sources */
,
...
...
iCemarose/Class/Model/KWMBeforePayData.h
0 → 100644
View file @
0670e2bb
//
// KWMBeforePayData.h
// iCemarose
//
// Created by HouWeiBin on 2017/6/16.
// Copyright © 2017年 kollway. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "KWMBaseModel.h"
#import "KWMWechatPayData.h"
@interface
KWMBeforePayData
:
KWMBaseModel
@property
(
nonatomic
)
KWMWechatPayData
*
wechatPayData
;
@end
iCemarose/Class/Model/KWMBeforePayData.m
0 → 100644
View file @
0670e2bb
//
// KWMBeforePayData.m
// iCemarose
//
// Created by HouWeiBin on 2017/6/16.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "KWMBeforePayData.h"
@implementation
KWMBeforePayData
@end
iCemarose/Class/Model/KWMFilter.h
View file @
0670e2bb
...
...
@@ -7,8 +7,8 @@
//
// 筛选model
//
#import "KWMBaseModel.h"
#import <JSONModel/JSONModel.h>
#import <Foundation/Foundation.h>
@interface
KWMFilter
:
KWMBaseModel
...
...
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.h
View file @
0670e2bb
...
...
@@ -14,7 +14,7 @@
#import "KWMAddGiftCardVC.h"
#import "KWMShippingVC.h"
#import "KWMPayTypeVC.h"
#import "KWMBeforePayData.h"
@interface
KWMBeforePayVC
:
KWMBaseVC
<
KWMGiftCardDelegate
,
KWMDiscountDelegate
,
KWMSelectAddressDelegate
,
KWMSelectShippingRateDelegate
,
KWMPayTypeDelegate
>
...
...
@@ -44,6 +44,10 @@
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lbShippingRate
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
vPayType
;
@property
(
weak
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
heightPayType
;
@property
(
nonatomic
)
BUYAddress
*
address
;
//创建订单异步请求
...
...
@@ -60,6 +64,8 @@
@property
(
nonatomic
)
KWMPayType
payType
;
@property
(
nonatomic
)
KWMBeforePayData
*
beforePayData
;
@property
(
strong
,
nonatomic
)
NSString
*
cartCookie
;
-
(
IBAction
)
onClickPayType
:(
id
)
sender
;
...
...
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
View file @
0670e2bb
...
...
@@ -46,6 +46,7 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
title
=
@"提交订单"
;
self
.
beforePayData
=
[
KWMBeforePayData
new
];
//支付成功回调广播接收者 ##通过广播接受appdelegate中的支付回调。
NSNotificationCenter
*
notifi
=
[
NSNotificationCenter
defaultCenter
];
[
notifi
addObserver
:
self
selector
:
@selector
(
paySuccess
)
name
:
KWMPaySuccess
object
:
nil
];
...
...
@@ -61,7 +62,13 @@
-
(
void
)
setPayType
:
(
KWMPayType
)
payType
{
_payType
=
payType
;
//web支付,隐藏选择支付栏
if
(
payType
==
TypeWebpay
){
self
.
heightPayType
.
constant
=
0
;
self
.
vPayType
.
hidden
=
YES
;
}
else
{
self
.
lbPayType
.
text
=
[
KWMPayUtil
payTypeString
:
payType
];
}
}
-
(
void
)
initDefaultData
{
...
...
@@ -594,6 +601,31 @@
}];
}
-
(
void
)
validateOrderPayResult
{
//微信支付,用户支付后,当用户没有点击完成按钮,而是直接使用home键,或者点击状态栏左上角返回APP订单页面时,微信的回调不会调用,而很容易出现订单结果丢失的情况,所以需要再确认一次订单是否完成。
//支付宝暂时没有这种问题。
__weak
KWMBeforePayVC
*
weakSelf
=
self
;
if
(
self
.
beforePayData
&&
self
.
beforePayData
.
wechatPayData
){
NSString
*
sign
=
@""
;
NSDictionary
*
parameters
=
@{
@"transaction_id"
:
self
.
beforePayData
.
wechatPayData
.
prepayid
,
@"sign"
:
sign
};
weakSelf
.
beforePayData
.
wechatPayData
=
nil
;
void
(
^
failure
)(
NSURLSessionDataTask
*
,
NSError
*
)
=
^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
){
};
void
(
^
success
)(
NSURLSessionDataTask
*
,
KWMCheckoutPayResult
*
)
=
^
(
NSURLSessionDataTask
*
task
,
KWMCheckoutPayResult
*
result
){
if
(
result
)
if
(
result
&&
result
.
status
&&
[
result
.
status
isEqualToString
:
@"success"
]){
if
(
result
.
code
&&
result
.
code
.
integerValue
==
1000
){
[
weakSelf
paySuccess
];
}
}
};
[
self
.
api
wechatPayOrderQuery
:
parameters
success
:
success
failure
:
failure
];
}
}
//支付宝支付
-
(
void
)
requestAliPay
{
NSDictionary
*
parameters
=
[
KWMPayUtil
aliPayParameters
:
self
.
checkout
];
...
...
iCemarose/Class/UI/ShopCart/KWMPayTypeVC.h
View file @
0670e2bb
...
...
@@ -10,6 +10,7 @@
typedef
NS_ENUM
(
NSInteger
,
KWMPayType
)
{
TypeNone
=
0
,
TypeWebpay
,
TypeCredit
,
TypeAlipay
,
TypeWechatPay
...
...
iCemarose/Class/UI/ShopCart/ShopCart.storyboard
View file @
0670e2bb
...
...
@@ -1496,65 +1496,6 @@
<outletCollection
property=
"gestureRecognizers"
destination=
"sVp-3n-Jr5"
appends=
"YES"
id=
"KDE-el-ula"
/>
</connections>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"SFF-e9-hE6"
userLabel=
"信用卡"
>
<rect
key=
"frame"
x=
"0.0"
y=
"135"
width=
"375"
height=
"55"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"lne-LW-nPv"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"75"
height=
"55"
/>
<subviews>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"ic_pay_credit_card"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"LRL-q6-ddo"
>
<rect
key=
"frame"
x=
"29"
y=
"21"
width=
"17"
height=
"14"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"14"
id=
"DzZ-qm-kZY"
/>
<constraint
firstAttribute=
"width"
constant=
"17"
id=
"ddV-GJ-MCj"
/>
</constraints>
</imageView>
</subviews>
<color
key=
"backgroundColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
<constraint
firstItem=
"LRL-q6-ddo"
firstAttribute=
"centerX"
secondItem=
"lne-LW-nPv"
secondAttribute=
"centerX"
id=
"0Qd-1I-nYc"
/>
<constraint
firstItem=
"LRL-q6-ddo"
firstAttribute=
"centerY"
secondItem=
"lne-LW-nPv"
secondAttribute=
"centerY"
id=
"EbE-8R-mfG"
/>
<constraint
firstAttribute=
"width"
constant=
"75"
id=
"p1y-5n-Tzy"
/>
</constraints>
</view>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"信用卡支付"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"FUc-8V-X5I"
>
<rect
key=
"frame"
x=
"75"
y=
"18"
width=
"70"
height=
"20"
/>
<fontDescription
key=
"fontDescription"
name=
"PingFangSC-Regular"
family=
"PingFang SC"
pointSize=
"14"
/>
<color
key=
"textColor"
red=
"0.30588235289999999"
green=
"0.30588235289999999"
blue=
"0.30588235289999999"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"7ow-Jk-Xtf"
userLabel=
"line"
>
<rect
key=
"frame"
x=
"0.0"
y=
"54"
width=
"375"
height=
"1"
/>
<color
key=
"backgroundColor"
red=
"0.84705882349999995"
green=
"0.85882352939999995"
blue=
"0.87058823529999996"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"1"
id=
"rX2-Nt-VD6"
/>
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
red=
"0.95686274510000002"
green=
"0.96078431369999995"
blue=
"0.96862745100000003"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<constraints>
<constraint
firstAttribute=
"bottom"
secondItem=
"7ow-Jk-Xtf"
secondAttribute=
"bottom"
id=
"5Vj-RK-Tbz"
/>
<constraint
firstItem=
"lne-LW-nPv"
firstAttribute=
"leading"
secondItem=
"SFF-e9-hE6"
secondAttribute=
"leading"
id=
"5tN-yN-UX7"
/>
<constraint
firstItem=
"FUc-8V-X5I"
firstAttribute=
"top"
secondItem=
"SFF-e9-hE6"
secondAttribute=
"top"
id=
"AKU-nX-Kty"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"lne-LW-nPv"
secondAttribute=
"bottom"
id=
"HFb-Zg-Crc"
/>
<constraint
firstAttribute=
"height"
constant=
"55"
id=
"MKL-DZ-TKj"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"FUc-8V-X5I"
secondAttribute=
"bottom"
id=
"QSS-5U-oHH"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"7ow-Jk-Xtf"
secondAttribute=
"trailing"
id=
"dAT-my-HZC"
/>
<constraint
firstItem=
"lne-LW-nPv"
firstAttribute=
"top"
secondItem=
"SFF-e9-hE6"
secondAttribute=
"top"
id=
"eMM-I3-SpQ"
/>
<constraint
firstItem=
"7ow-Jk-Xtf"
firstAttribute=
"leading"
secondItem=
"SFF-e9-hE6"
secondAttribute=
"leading"
id=
"geZ-nO-hyA"
/>
<constraint
firstItem=
"FUc-8V-X5I"
firstAttribute=
"leading"
secondItem=
"lne-LW-nPv"
secondAttribute=
"trailing"
id=
"xLT-xE-iiu"
/>
<constraint
firstItem=
"FUc-8V-X5I"
firstAttribute=
"centerY"
secondItem=
"SFF-e9-hE6"
secondAttribute=
"centerY"
id=
"xyG-l9-ge7"
/>
</constraints>
<variation
key=
"default"
>
<mask
key=
"constraints"
>
<exclude
reference=
"AKU-nX-Kty"
/>
<exclude
reference=
"QSS-5U-oHH"
/>
</mask>
</variation>
<connections>
<outletCollection
property=
"gestureRecognizers"
destination=
"mLJ-OU-y8G"
appends=
"YES"
id=
"fVF-We-VGt"
/>
</connections>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"F5Z-f9-woo"
userLabel=
"line"
>
<rect
key=
"frame"
x=
"0.0"
y=
"20"
width=
"375"
height=
"1"
/>
<color
key=
"backgroundColor"
red=
"0.84705882349999995"
green=
"0.85882352939999995"
blue=
"0.87058823529999996"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
...
...
@@ -1567,15 +1508,12 @@
<constraints>
<constraint
firstItem=
"Os1-zi-TuD"
firstAttribute=
"top"
secondItem=
"hCm-Y0-mLE"
secondAttribute=
"bottom"
constant=
"5"
id=
"1Op-ws-NER"
/>
<constraint
firstItem=
"RWh-QT-lMr"
firstAttribute=
"leading"
secondItem=
"GN1-MI-97h"
secondAttribute=
"leading"
id=
"FqV-QP-aGs"
/>
<constraint
firstItem=
"SFF-e9-hE6"
firstAttribute=
"top"
secondItem=
"RWh-QT-lMr"
secondAttribute=
"bottom"
id=
"GZU-BU-qqF"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"SFF-e9-hE6"
secondAttribute=
"trailing"
id=
"K2R-b6-oqU"
/>
<constraint
firstItem=
"F5Z-f9-woo"
firstAttribute=
"top"
secondItem=
"hCm-Y0-mLE"
secondAttribute=
"bottom"
id=
"KrQ-le-ju8"
/>
<constraint
firstItem=
"F5Z-f9-woo"
firstAttribute=
"leading"
secondItem=
"GN1-MI-97h"
secondAttribute=
"leading"
id=
"LgM-fg-iqD"
/>
<constraint
firstItem=
"RWh-QT-lMr"
firstAttribute=
"top"
secondItem=
"Os1-zi-TuD"
secondAttribute=
"bottom"
id=
"M28-33-kXa"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"RWh-QT-lMr"
secondAttribute=
"trailing"
id=
"RWN-IR-Enf"
/>
<constraint
firstItem=
"Os1-zi-TuD"
firstAttribute=
"leading"
secondItem=
"GN1-MI-97h"
secondAttribute=
"leading"
id=
"djL-HZ-jDK"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"F5Z-f9-woo"
secondAttribute=
"trailing"
id=
"hk5-WF-ntv"
/>
<constraint
firstItem=
"SFF-e9-hE6"
firstAttribute=
"leading"
secondItem=
"GN1-MI-97h"
secondAttribute=
"leading"
id=
"lMM-72-TAd"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"Os1-zi-TuD"
secondAttribute=
"trailing"
id=
"wN1-9o-QQf"
/>
</constraints>
</view>
...
...
@@ -2138,7 +2076,6 @@
<image
name=
"ic_count_bg"
width=
"100"
height=
"25"
/>
<image
name=
"ic_pay_AliPay"
width=
"18"
height=
"18"
/>
<image
name=
"ic_pay_WeChat"
width=
"20"
height=
"17"
/>
<image
name=
"ic_pay_credit_card"
width=
"17"
height=
"14"
/>
<image
name=
"ic_shopcar_delete"
width=
"13"
height=
"13"
/>
</resources>
</document>
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