46 lines
1.7 KiB
Objective-C
46 lines
1.7 KiB
Objective-C
//
|
|
// XPEnterpriseRechargePresenter.m
|
|
// xplan-ios
|
|
//
|
|
// Created by 冯硕 on 2022/5/14.
|
|
//
|
|
|
|
#import "XPEnterpriseRechargePresenter.h"
|
|
#import "XPEnterpriseRechargeProtocol.h"
|
|
#import "Api+EnterpriseRecharge.h"
|
|
#import "Api+Mine.h"
|
|
#import "EnterpriseRechargeListInfoModel.h"
|
|
#import "WalletInfoModel.h"
|
|
#import "AccountInfoStorage.h"
|
|
#import "YYUtility.h"
|
|
@implementation XPEnterpriseRechargePresenter
|
|
|
|
///获取充值列表
|
|
- (void)getRechargeList:(NSString *)channelType {
|
|
[Api enterpriseRechargeList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
EnterpriseRechargeListInfoModel * info = [EnterpriseRechargeListInfoModel modelWithDictionary:data.data];
|
|
[[self getView] getRechargeListSuccess:info];
|
|
}] channelType:channelType];
|
|
}
|
|
|
|
/// 获取钱包信息
|
|
- (void)getUserWalletInfo {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
|
[Api getUserWalletInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
|
|
[[self getView] getUserWalletInfo:model];
|
|
}] uid:uid ticket:ticket];
|
|
}
|
|
|
|
///发起支付
|
|
- (void)requestPay:(NSString *)chargeProdId payChannel:(NSString *)payChannel roomUid:(NSString *)roomUid {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
|
NSString * clientIp= [YYUtility ipAddress];
|
|
[Api requestPay:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
[[self getView] requestPaySuccess:data.data payChannel:payChannel];
|
|
} showLoading:YES] chargeProdId:chargeProdId payChannel:payChannel clientIp:clientIp uid:uid ticket:ticket roomUid:roomUid];
|
|
}
|
|
@end
|