Git下载地址
微信支付可支付的demo
NOTICE
该SDK包含了 微信分享 微信登录等已经做成组件在cocoapods里
可以搜索
-> WeChatPaySDK (0.0.2)
A short description of WeChatPaySDK.
pod 'WeChatPaySDK', '~> 0.0.2'
- Homepage: https://github.com/7General
- Source: https://github.com/7General/WeChatPaySDK.git
- Versions: 0.0.2, 0.0.1 [master repo]
WechatAuthSDK.h(auth相关)
WXApi.h(业务相关)
WXApiObject.h(各种对象)
libWeChatSDK.a (这个不能少)
//注册微信支付
[WXApi registerApp:MXWechatAPPID withDescription:@"微信支付"];
#pragma mark - 微信支付回调
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [WXApi handleOpenURL:url delegate:[WXApiManager sharedManager]];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [WXApi handleOpenURL:url delegate:[WXApiManager sharedManager]];
}
// NOTE: 9.0以后使用新API接口
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options
{
return [WXApi handleOpenURL:url delegate:[WXApiManager sharedManager]];
}
+ (void)WakeupWeChatPay:(MSSendPayRequest *)payRequest {
PayReq *request = [[PayReq alloc] init];
request.openID = payRequest.openID;
request.partnerId = payRequest.partnerId;
request.prepayId= payRequest.prepayId;
request.package = payRequest.package;
request.nonceStr= payRequest.nonceStr;
request.timeStamp = payRequest.timeStamp;
request.sign= payRequest.sign;
// 调用微信
[WXApi sendReq:request];
}
有些地方说的不到位,还请各位看官指正。。。
可以来微信公众号(洲洲哥)后台给我们留言。 快来扫码关注我们吧!