UnifyPayOrderRequestManager.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. //
  2. // UnifyPayOrderRequestManager.h
  3. // testDEMO
  4. //
  5. // Created by SunXP on 17/4/28.
  6. // Copyright © 2017年 L. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #define URL_ORDER_TEST_POS_1 @"https://qr-test1.chinaums.com/netpay-route-server/api/"
  10. #define URL_ORDER_TEST_POS_2 @"https://qr-test2.chinaums.com/netpay-route-server/api/"
  11. #define URL_ORDER_TEST_POS_3 @"https://qr-test3.chinaums.com/netpay-route-server/api/"
  12. #define URL_ORDER_TEST_WX_ALI_1 @"http://npfdev.izhong.me/netpay-route-server/api/"
  13. #define URL_ORDER_TEST_WX_ALI_2 @"http://umspay.izhong.me/netpay-route-server/api/"
  14. #define URL_ORDER_PROD @"https://qr.chinaums.com/netpay-route-server/api/"
  15. #define WX_POS_TEST_MD5KEY @"EahB2xfpCCpaYtKw2yCWzcTfChTxXEYKCGwBEaMcDKbEHCpE"
  16. #define POS_PRO_MD5KEY @"3ypmTzxdXhFty7HCrZynehjcjdcaAb3HDRwJQpTFYZfjWHEZ"
  17. #define WX_ALI_TEST_MD5KEY @"1234567890lkkjjhhguuijmjfidfi4urjrjmu4i84jvm"
  18. #define ALI_TEST_2_MD5KEY @"dwpRz2B6akcp8fwp6JJjenHCH7FKHFcCPE3NkiMJAQzhtD3W"
  19. #define WX_ALI_PRO_MD5KEY @"kkikm48475jrnfjmdnh3yyt35eyjdnnbxheujjejemmjyu3u4i4jj4d9ikfjjdf"
  20. //#define WX_PRO_MD5KEY @"fZjyfDK7ix7CKhhBSC8mQWTAtmp44JsTrbkkyKXtxNAxxPFT"
  21. #define WX_PRO_MD5KEY @"BcNys5ix3zj4TTSz8HhrXWrZJZHWJBXzMSXdNWxPZ6B7JasS"
  22. #define WX_TEST_MD5KEY @"fcAmtnx7MwismjWNhNKdHC44mNXtnEQeJkRrhKJwyrW2ysRR"
  23. #define CLOUD_PRO_MD5KEY @"AcZdi46z6GibDwi5WXQEdypEWt2WSdNH6RHT3YAwnmCWwQEG"
  24. #define ALI_PRO_MD5KEY @"AcZdi46z6GibDwi5WXQEdypEWt2WSdNH6RHT3YAwnmCWwQEG"
  25. extern NSString *const Test_1_Title;
  26. extern NSString *const Test_2_Title;
  27. extern NSString *const Test_3_Title;
  28. extern NSString *const Prod_Title;
  29. extern NSString *const True_Title;
  30. extern NSString *const False_Title;
  31. extern NSString *const MsgSrcId_1016;
  32. extern NSString *const MsgSrcId_3028;
  33. extern NSString *const MsgSrcId_3816;
  34. extern NSString *const MsgSrcId_3194;
  35. extern NSString *const MsgSrcId_3245;
  36. extern NSString *const MsgSrcId_1028;
  37. extern NSString *const MsgSrcId_1000;
  38. extern NSString *const MsgSrcId_5000;
  39. extern NSString *const MsgSrc_TestPay;
  40. extern NSString *const MsgSrc_NetPay_Demo;
  41. typedef NS_ENUM(NSInteger, UnifyPayChannel) {
  42. unifyPayChannelWXPay = 0,
  43. unifyPayChannelPosPay,
  44. unifyPayChannelAlipay,
  45. unifyPayChannelAliMiniProgramPay,
  46. unifyPayChannelCloudPay,
  47. unifyPayChannelApplePay,
  48. };
  49. typedef void (^SuccessHandler)(NSDictionary *response);
  50. typedef void (^FailHandler)(void);
  51. @interface UnifyPayOrderRequestManager : NSObject
  52. @property (nonatomic, assign) UnifyPayChannel payChannel; // 支付渠道
  53. @property (nonatomic, copy) NSString *subAppId;
  54. @property (nonatomic, copy) NSString *requestTimestamp; // 当前时间
  55. @property (nonatomic, copy) NSString *merOrderId; // 商户订单号
  56. @property (nonatomic, copy) NSString *mid; // 商户号
  57. @property (nonatomic, copy) NSString *tid; // 终端号
  58. @property (nonatomic, copy) NSString *instMid; // 机构商户号
  59. @property (nonatomic, copy) NSString *goods; // 商品详情
  60. @property (nonatomic, copy) NSString *totalAmount; // 总金额,单位分
  61. @property (nonatomic, copy) NSString *merchantUserId; // 商户用户号
  62. @property (nonatomic, copy) NSString *mobile; // 手机号
  63. @property (nonatomic, copy) NSString *msgSrc; // 消息来源
  64. @property (nonatomic, copy) NSString *urlStr; // 下单接口URL
  65. @property (nonatomic, copy) NSString *MD5Key; // MD5Key
  66. @property (nonatomic, copy) NSString *notifyUrl; // 通知地址
  67. @property (nonatomic, copy) NSString *srcReserve; //商户定制化展示的内容,长度不大于255
  68. @property (nonatomic, copy) NSString *secureTransaction; //担保标示
  69. #pragma mark --apple pay 字段
  70. @property (nonatomic, copy) NSString *attachedData; //商户附加数据
  71. @property (nonatomic, copy) NSString *expireTime; //订单过期时间
  72. @property (nonatomic, copy) NSString *orderDesc; //订单描述
  73. @property (nonatomic, copy) NSString *originalAmount; //订单原始金额,单位分,用于记录前端系统打折前的金额
  74. @property (nonatomic, copy) NSString *customerId; //全民付用户号
  75. @property (nonatomic, copy) NSString *signType; /// 签名算法
  76. //以后需求可能用的上
  77. //@property (nonatomic, copy) NSString *specifiedPaymentMedium; /// 支付介质
  78. @property (nonatomic, copy) NSString *divisionFlag; /// 分账标记
  79. @property (nonatomic, copy) NSString *platformAmount; /// 平台商户分账 金额
  80. @property (nonatomic, copy) NSArray *subOrdersArray;
  81. @property (nonatomic, copy) NSString *subOrdersStr;
  82. +(UnifyPayOrderRequestManager *)shareInstance;
  83. - (NSData *)packToData;
  84. - (void)sendOrderRequestWithPostData:(NSData *)postData successHandler:(SuccessHandler)successHandler failHandler:(FailHandler)failHandler;
  85. @end