关于微信和支付宝提现的问题

1.微信提现

先说说微信提现的问题,因为微信的要求,提现到微信钱包需要第三方登录到微信获取用户unionId,登录这块我用的是友盟(偷个懒..)

先说登录 下面代码写在提现到微信的点击事件中
#pragma mark - WeChat提现需登录获取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就是提现需要的
    self.WxId = snsAccount.unionId;  
        }
   });
}
确认登录之后回到App
#pragma mark - 提现到微信
- (void)withdrawalToWeChat
{
  UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"提现到微信:" message:nil preferredStyle:UIAlertControllerStyleAlert];

  [alertC addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
    
    textField.keyboardType = UIKeyboardTypeDecimalPad;
    
    textField.placeholder = @"请输入提现金额";
  }];

  [alertC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
  [alertC addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
    
    UITextField *textF = alertC.textFields[0];  //金额
    //然后在这里写后台给的提现到微信钱包的接口,把ID和钱数传过去
     [self requestDataWxId:self.WxId Money:money];
  }]];

    [self presentViewController:alertC animated:YES completion:nil];
}

2.支付宝提现

支付宝提现就简单多了 给后台传提现账号和钱数就OK

前提是要有一个给力的后台啊!!!说多了都是泪

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 支付宝简介文档 (适用于ydm-java接口与后台,如有误入,但愿也能给您带来帮助) 此文档写于2017年3月,只...
    隔壁付叔叔阅读 17,354评论 3 19
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 179,267评论 25 708
  • 很多时候 贪婪来自于无知 摆脱无知也就是摆脱了贪婪,让自己变得聪明点,那么最好的方法就是——每天进步一点点,每天更...
    竹子Auguss阅读 434评论 0 0
  • 今天我们上画画课啦!老师上我门把画画用品拿出来。我拿出来油画棒。还有笔袋。还有折纸,还有图画本儿。我把我的垫板...
    段智耀阅读 171评论 0 0
  • 被时间拨乱了的我的心也不知此时的我在干嘛,更不知道这该死的第一篇该归于日记本还是随笔,虽然他们的字数不一样,他们被...
    铁板阅读 200评论 0 1

友情链接更多精彩内容