Skip to content

Commit

Permalink
Update Wechatpay
Browse files Browse the repository at this point in the history
  • Loading branch information
tien.vu committed Apr 6, 2018
1 parent d663657 commit 9294483
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 50 deletions.
2 changes: 1 addition & 1 deletion PWWechatpayPlugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Pod::Spec.new do |s|
sp.source_files = "Plugins/PWWechatpayPlugin/Wechatpay/*.{h,m}"
sp.vendored_libraries = "Plugins/PWWechatpayPlugin/Wechatpay/libWeChatSDK.a"
sp.libraries = 'z', 'c++', 'sqlite3.0'
sp.frameworks = 'UIKit', 'SystemConfiguration', 'Foundation', 'CoreTelephony', 'Security'
sp.frameworks = 'UIKit', 'SystemConfiguration', 'Foundation', 'CoreTelephony', 'Security', 'CFNetwork'
end

end
2 changes: 1 addition & 1 deletion Plugins/PWWechatpayPlugin/Headers/PWOptionWechatpay.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

NS_ASSUME_NONNULL_BEGIN

NSString *const PWPaymentTypeWechatpay;
extern NSString *const PWPaymentTypeWechatpay;

@interface PWOptionWechatpay : NSObject

Expand Down
41 changes: 40 additions & 1 deletion Plugins/PWWechatpayPlugin/Wechatpay/README.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
重要!
SDK1.8.0
1. SDK支持打开小程序
2. SDK分享小程序支持shareTicket

SDK1.7.9
1. SDK订阅一次性消息

SDK1.7.8
1 SDK分享小程序支持大图

SDK1.7.7
1 增加SDK分享小程序
2 增加选择发票接口

SDK1.7.6
1. 提高稳定性
1 修复mta崩溃
2 新增接口支持开发者关闭mta数据统计上报

SDK1.7.5
1. 提高稳定性
2. 加快registerApp接口启动速度

SDK1.7.4
1. 更新支持iOS启用 ATS(App Transport Security)
2. 需要在工程中链接CFNetwork.framework
3. 在工程配置中的”Other Linker Flags”中加入”-Objc -all_load”

SDK1.7.3
1. 增强稳定性,适配iOS10
2. 修复小于32K的jpg格式缩略图设置失败的问题

SDK1.7.2
1. 修复因CTTeleponyNetworkInfo引起的崩溃问题

SDK1.7.1
1. 支持兼容ipv6(提升稳定性)
2. xCode Version 7.3.1 (7D1014) 编译

SDK1.7
1. 支持兼容ipv6
2. 修复若干问题增强稳定性
Expand Down Expand Up @@ -36,4 +75,4 @@ SDK1.5
1、废弃safeSendReq:接口,使用sendReq:即可。
2、新增+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id<WXApiDelegate>) delegate;
支持未安装微信情况下Auth,具体见WXApi.h接口描述
3、微信开放平台新增了微信模块用户统计功能,便于开发者统计微信功能模块的用户使用和活跃情况。开发者需要在工程中链接上:SystemConfiguration.framework,libz.dylib,libsqlite3.0.dylib。
3、微信开放平台新增了微信模块用户统计功能,便于开发者统计微信功能模块的用户使用和活跃情况。开发者需要在工程中链接上:SystemConfiguration.framework,libz.dylib,libsqlite3.0.dylib。
10 changes: 5 additions & 5 deletions Plugins/PWWechatpayPlugin/Wechatpay/WXApi.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
*
* 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。
* 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现,默认开启MTA数据上报
* iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。
* @attention 请保证在主线程中调用此函数
* @param appid 微信开发者ID
Expand All @@ -60,16 +60,16 @@
*/
+(BOOL) registerApp:(NSString *)appid;


/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
*
* 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。
* @see registerApp
* iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。
* @attention 请保证在主线程中调用此函数
* @param appid 微信开发者ID
* @param appdesc 应用附加信息,长度不超过1024字节
* @param isEnableMTA 是否支持MTA数据上报
* @return 成功返回YES,失败返回NO。
*/
+(BOOL) registerApp:(NSString *)appid withDescription:(NSString *)appdesc;
+(BOOL) registerApp:(NSString *)appid enableMTA:(BOOL)isEnableMTA;


/*! @brief WXApi的成员函数,向微信终端程序注册应用支持打开的文件类型。
Expand Down
174 changes: 132 additions & 42 deletions Plugins/PWWechatpayPlugin/Wechatpay/WXApiObject.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

/*! @brief 错误码
*
Expand Down Expand Up @@ -57,6 +58,7 @@ enum WXMPWebviewType {
};



/*! @brief 应用支持接收微信的文件类型
*
*/
Expand Down Expand Up @@ -114,6 +116,8 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)
#pragma mark - WXMediaMessage
@class WXMediaMessage;

#ifndef BUILD_WITHOUT_PAY

/*! @brief 第三方向微信终端发起支付的消息结构体
*
* 第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果
Expand All @@ -136,8 +140,11 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)

@end

#endif


#ifndef BUILD_WITHOUT_PAY

#pragma mark - PayResp
/*! @brief 微信终端返回给第三方的关于支付结果的结构体
*
Expand All @@ -150,37 +157,7 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)

@end



/*! @brief 第三方向微信终端发起拆企业红包的消息结构体
*
* 第三方向微信终端发起拆企业红包的消息结构体,微信终端处理后会向第三方返回处理结果
* @see HBReq
*/
@interface HBReq : BaseReq

/** 随机串,防重发 */
@property (nonatomic, retain) NSString *nonceStr;
/** 时间戳,防重发 */
@property (nonatomic, assign) UInt32 timeStamp;
/** 商家根据微信企业红包开发文档填写的数据和签名 */
@property (nonatomic, retain) NSString *package;
/** 商家根据微信企业红包开发文档对数据做的签名 */
@property (nonatomic, retain) NSString *sign;

@end



#pragma mark - HBResp
/*! @brief 微信终端返回给第三方的关于拆企业红包结果的结构体
*
* 微信终端返回给第三方的关于拆企业红包结果的结构体
*/
@interface HBResp : BaseResp

@end

#endif



Expand Down Expand Up @@ -351,6 +328,15 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)
@property (nonatomic, retain) NSString* sessionFrom;
@end

#pragma mark - OpenTempSessionResp
/*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。
*
* 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。
*/
@interface OpenTempSessionResp : BaseResp

@end

#pragma mark - OpenWebviewReq
/* ! @brief 第三方通知微信启动内部浏览器,打开指定网页
*
Expand All @@ -373,16 +359,6 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)

@end


#pragma mark - OpenTempSessionResp
/*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。
*
* 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。
*/
@interface OpenTempSessionResp : BaseResp

@end

#pragma mark - OpenRankListReq
/* ! @brief 第三方通知微信,打开硬件排行榜
*
Expand Down Expand Up @@ -469,6 +445,32 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)
@property (nonatomic,retain) NSString* appID;
@end;

#pragma mark - WXInvoiceItem

@interface WXInvoiceItem : NSObject
/** 卡id
* @attention 长度不能超过1024字节
*/
@property (nonatomic,retain) NSString* cardId;
/** ext信息
* @attention 长度不能超过2024字节
*/
@property (nonatomic,retain) NSString* extMsg;
/**
* @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。
*/
@property (nonatomic,assign) UInt32 cardState;
/**
* @attention req不需要填,chooseCard返回的。
*/
@property (nonatomic,retain) NSString* encryptCode;
/**
* @attention req不需要填,chooseCard返回的。
*/
@property (nonatomic,retain) NSString* appID;

@end

#pragma mark - AddCardToWXCardPackageReq
/* ! @brief 请求添加卡券至微信卡包
*
Expand Down Expand Up @@ -522,6 +524,49 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)
@property (nonatomic,retain) NSArray* cardAry;
@end


#pragma mark - WXChooseInvoiceReq
/* ! @brief 请求从微信选取发票
*
*/
@interface WXChooseInvoiceReq : BaseReq
@property (nonatomic, strong) NSString *appID;
@property (nonatomic, assign) UInt32 shopID;
@property (nonatomic, strong) NSString *signType;
@property (nonatomic, strong) NSString *cardSign;
@property (nonatomic, assign) UInt32 timeStamp;
@property (nonatomic, strong) NSString *nonceStr;
@end

#pragma mark - WXChooseInvoiceResp
/** ! @brief 微信返回第三方请求选择发票结果
*
*/
@interface WXChooseInvoiceResp : BaseResp
@property (nonatomic, strong) NSArray* cardAry;
@end

#pragma mark - WXSubscriptionReq
@interface WXSubscribeMsgReq : BaseReq
@property (nonatomic, assign) UInt32 scene;
@property (nonatomic, strong) NSString * templateId;
@property (nonatomic, strong) NSString * reserved;
@end

#pragma mark - WXSubscriptionReq
@interface WXSubscribeMsgResp : BaseResp

@property (nonatomic, strong) NSString *templateId;
@property (nonatomic, assign) UInt32 scene;
@property (nonatomic, strong) NSString *action;
@property (nonatomic, strong) NSString * reserved;
@property (nonatomic, strong) NSString * openId;

@end

#pragma mark - WXMediaMessage


#pragma mark - WXMediaMessage

/*! @brief 多媒体消息结构体
Expand Down Expand Up @@ -779,6 +824,52 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)

@end

@interface WXMiniProgramObject : NSObject

/*! @brief WXMiniProgramObject对象
*
* @note 返回的WXMiniProgramObject对象是自动释放的
*/
+(WXMiniProgramObject *) object;

@property (nonatomic, strong) NSString *webpageUrl; //低版本网页链接

@property (nonatomic, strong) NSString *userName; //小程序username

@property (nonatomic, strong) NSString *path; //小程序页面的路径

@property (nonatomic, strong) NSData *hdImageData; // 小程序新版本的预览图 128k

@property (nonatomic, assign) BOOL withShareTicket; //是否使用带 shareTicket 的转发

@end

#pragma mark - WXLaunchMiniProgramReq

/*! @brief WXLaunchMiniProgramReq对象, 可实现通过sdk拉起微信小程序
*
* @note 返回的WXLaunchMiniProgramReq对象是自动释放的
*/
@interface WXLaunchMiniProgramReq : BaseReq

+(WXLaunchMiniProgramReq *) object;

@property (nonatomic, strong) NSString *userName; //拉起的小程序的username
@property (nonatomic, strong) NSString *path; //拉起小程序页面的路径,不填默认拉起小程序首页

@end

#pragma mark - WXLaunchMiniProgramResp
/*! @brief 微信终端向第三方程序返回的WXLaunchMiniProgramReq处理结果。
*
* 第三方程序向微信终端发送WXLaunchMiniProgramReq后,微信发送回来的处理结果,该结果用WXLaunchMiniProgramResp表示。
*/
@interface WXLaunchMiniProgramResp : BaseResp

@property (nonatomic, retain) NSString *extMsg;

@end


#pragma mark - WXTextObject
/*! @brief 多媒体消息中包含的文本数据对象
Expand All @@ -800,4 +891,3 @@ typedef NS_ENUM(UInt64, enAppSupportContentFlag)
@property (nonatomic, retain) NSString *contentText;

@end

Empty file modified Plugins/PWWechatpayPlugin/Wechatpay/WechatAuthSDK.h
100644 → 100755
Empty file.
Binary file modified Plugins/PWWechatpayPlugin/Wechatpay/libWeChatSDK.a
100644 → 100755
Binary file not shown.
Binary file modified Plugins/PWWechatpayPlugin/libPWWechatpayPlugin.a
Binary file not shown.

0 comments on commit 9294483

Please sign in to comment.