更换项目

This commit is contained in:
liyuhua
2023-07-14 18:50:55 +08:00
parent fff67e0aee
commit fc0480ea2c
9340 changed files with 236665 additions and 221827 deletions

View File

@@ -0,0 +1,82 @@
//
// YMMineRechargePresenter.m
// YUMI
//
// Created by YUMI on 2021/9/24.
//
#import "XPMineRechargePresenter.h"
///Api
#import "Api+Mine.h"
///Tool
#import "AccountInfoStorage.h"
#import "YYUtility.h"
#import "NSObject+MJExtension.h"
///P
#import "XPMineRechargeProtocol.h"
///Model
#import "RechargeListModel.h"
#import "WalletInfoModel.h"
@implementation XPMineRechargePresenter
///
- (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];
}
///
/// @param channel 8
- (void)requestRechargeListWithChannel:(NSString *)channel {
[Api getRechargeList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [RechargeListModel modelsWithArray:data.data];
[[self getView] requestRechargeListSucccess:array];
}] channelType:channel];
}
///
/// @param chargeProdId id
- (void)requestIAPRechargeOrderWithChargeProdId:(NSString *)chargeProdId {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
NSString * deviceInfo = [YYUtility deviceID];
NSString * clientIp= [YYUtility ipAddress];
[Api requestIAPRecharge:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSString *orderId = (NSString *)data.data[@"recordId"];
[[self getView] requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] requestIAPRechargeOrderFail];
}] chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
}
///
/// @param receipt
/// @param orderId
/// @param transcationId id
- (void)checkReceiptWithData:(NSString *)receipt orderId:(NSString *)orderId transcationId:(NSString *)transcationId {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api checkReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] checkReceiptSuccess:transcationId];
} showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
}
///
/// @param transcations
- (void)checkTranscationIds:(NSArray *)transcations {
NSString * transcationIdStr = [transcations toJSONString];
[Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] checkTranscationIdsSuccess];
}] transcationIdStr:transcationIdStr];
}
@end