1.微信提現(xiàn)
先說說微信提現(xiàn)的問題,因?yàn)槲⑿诺囊螅岈F(xiàn)到微信錢包需要第三方登錄到微信獲取用戶unionId,登錄這塊我用的是友盟(偷個(gè)懶..)
先說登錄 下面代碼寫在提現(xiàn)到微信的點(diǎn)擊事件中
#pragma mark - WeChat提現(xiàn)需登錄獲取openID
- (void)loginViewClickedWechatButton
{
UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToWechatSession];
snsPlatform.loginClickHandler(self,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){
//獲取用戶名、uid、token等
if (response.responseCode == UMSResponseCodeSuccess) {
UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary]valueForKey:UMShareToWechatSession];
NSLog(@"\n uid : %@",snsAccount.unionId);
//self.WxId就是提現(xiàn)需要的
self.WxId = snsAccount.unionId;
}
});
}
確認(rèn)登錄之后回到App
#pragma mark - 提現(xiàn)到微信
- (void)withdrawalToWeChat
{
UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"提現(xiàn)到微信:" message:nil preferredStyle:UIAlertControllerStyleAlert];
[alertC addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.keyboardType = UIKeyboardTypeDecimalPad;
textField.placeholder = @"請(qǐng)輸入提現(xiàn)金額";
}];
[alertC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
[alertC addAction:[UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
UITextField *textF = alertC.textFields[0]; //金額
//然后在這里寫后臺(tái)給的提現(xiàn)到微信錢包的接口,把ID和錢數(shù)傳過去
[self requestDataWxId:self.WxId Money:money];
}]];
[self presentViewController:alertC animated:YES completion:nil];
}
2.支付寶提現(xiàn)
支付寶提現(xiàn)就簡(jiǎn)單多了 給后臺(tái)傳提現(xiàn)賬號(hào)和錢數(shù)就OK
前提是要有一個(gè)給力的后臺(tái)啊!!!說多了都是淚
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。