vipsystem会员系统插件第三方支付宝API接口调试

2016年3月19日建站历程 原创教程1 6,3355

本贴中诉诸的技术,正在本站会员系统中使用。为保护本站用户利益,防止被某些人恶意利用,代码部分仅供部分朋友收看,还请理解。文章源自狐狸影视城-https://fox-studio.net/31002.html

 文章源自狐狸影视城-https://fox-studio.net/31002.html

vipsystem会员系统插件第三方支付宝API接口调试文章源自狐狸影视城-https://fox-studio.net/31002.html

自己改的网站的VipSystem会员系统插件,需要配合第三方程序来做接口,实现从支付宝充值,网站自动到账的流程。文章源自狐狸影视城-https://fox-studio.net/31002.html

目前使用的是一个需要24小时挂机的软件,在软件中登录支付宝帐号,来监测支付宝页面的交易记录,然后返回值到网站指定的php文件中。文章源自狐狸影视城-https://fox-studio.net/31002.html

在这个php中进行MD5的匹配对比,之后执行网站充值并写入数据库。最后返回判断充值成功或失败的值。文章源自狐狸影视城-https://fox-studio.net/31002.html

以上是这个软件和插件接口的工作流程,下面看看插件中接口文件的php源代码。文章源自狐狸影视城-https://fox-studio.net/31002.html

  1. <?php
  2. require('../../../wp-config.php' );
  3. $tradeNo=isset($_POST['tradeNo'])?$_POST['tradeNo']:'';
  4. $Money=isset($_POST['Money'])?$_POST['Money']:'';
  5. $title=isset($_POST['title'])?$_POST['title']:'';
  6. $memo=isset($_POST['memo'])?$_POST['memo']:'';
  7. $Gateway=isset($_POST['Gateway'])?$_POST['Gateway']:'';
  8. $Sign=isset($_POST['Sign'])?$_POST['Sign']:'';
  9. $alipay_account=isset($_POST['alipay_account'])?$_POST['alipay_account']:'';
  10. $ali_pid=get_option('erphpdown_zhuanid');
  11. $ali_key=get_option('erphpdown_zhuankey');
  12. $SignStr=strtoupper(md5($ali_pid.$ali_key.$tradeNo.$Money.$title.$memo));
  13. if($Sign==$SignStr)
  14. {
  15.     global $wpdb;
  16.     $checktrade = $wpdb->get_col("select ice_note from wp_ice_money where ice_alipay = '$tradeNo'");
  17.     if($checktrade){exit('success');}
  18.     $userinfo = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_login = '$title' ORDER BY ID");
  19.     if($userinfo)
  20.     {
  21.         $userid = $userinfo[0];
  22.         if(addUserMoney($userid$Money))
  23.         {
  24.             $sql="INSERT INTO $wpdb->icemoney (ice_money,ice_num,ice_user_id,ice_time,ice_success,ice_note,ice_success_time,ice_alipay) 
  25.             VALUES ('$Money','".date("y").mt_rand(10000000,99999999)."','".$userid."','".date("Y-m-d H:i:s")."',1,'8','".date("Y-m-d H:i:s")."','$tradeNo')";
  26.             mysql_query($sql);
  27.         }
  28.         exit('Success');
  29.     }
  30.     else
  31.     {
  32.         exit('IncorrectOrder');
  33.     }
  34. }
  35. else
  36. {
  37.     exit('Fail');
  38. }
  39. ?>

源代码没有备注,很难看懂从软件都返回了那些信息。文章源自狐狸影视城-https://fox-studio.net/31002.html

通过打印并写入文件命令,将上方的 $ 所有返回表单数据,全部写入一个指定的文件中。文章源自狐狸影视城-https://fox-studio.net/31002.html

我使用的代码如下:文章源自狐狸影视城-https://fox-studio.net/31002.html

  1. //数据写入get.txt文件中
  2. $myfile = fopen("get.txt""w"or die("Unable to open file!");
  3. $txt ="tradeNo=".$tradeNo."\n";
  4. fwrite($myfile$txt);
  5. $txt ="Money=".$Money."\n";
  6. fwrite($myfile$txt);
  7. $txt ="title=".$title."\n";
  8. fwrite($myfile$txt);
  9. $txt ="memo=".$memo."\n";
  10. fwrite($myfile$txt);
  11. $txt ="Gateway=".$Gateway."\n";
  12. fwrite($myfile$txt);
  13. $txt ="Sign=".$Sign."\n";
  14. fwrite($myfile$txt);
  15. $txt ="alipay_account=".$alipay_account."\n";
  16. fwrite($myfile$txt);
  17. $txt ="ali_pid=".$ali_pid."\n";
  18. fwrite($myfile$txt);
  19. $txt ="ali_key=".$ali_key."\n";
  20. fwrite($myfile$txt);
  21. $txt ="SignStr=".$SignStr."\n";
  22. fwrite($myfile$txt);
  23. fclose($myfile);

代码很机械化,一看就懂了。他会在同目录下创建一个文件,并写入你指定的函数返回值。文章源自狐狸影视城-https://fox-studio.net/31002.html

但是,如果没有充值操作,这些值是不会从软件发送,也就不会有值返回。我使用自己网站的小号登录,并充值0.01元的操作。获得如下返回内容:文章源自狐狸影视城-https://fox-studio.net/31002.html

tradeNo=201603192000400111009600316774**文章源自狐狸影视城-https://fox-studio.net/31002.html

Money=.01文章源自狐狸影视城-https://fox-studio.net/31002.html

title=3081*1336*文章源自狐狸影视城-https://fox-studio.net/31002.html

memo=fox-studio.net文章源自狐狸影视城-https://fox-studio.net/31002.html

Gateway=alipay文章源自狐狸影视城-https://fox-studio.net/31002.html

Sign=3B5DD97615FF384D8C0F6E7C0EBF73C*文章源自狐狸影视城-https://fox-studio.net/31002.html

alipay_account=317239773@qq.com文章源自狐狸影视城-https://fox-studio.net/31002.html

ali_pid=1176*文章源自狐狸影视城-https://fox-studio.net/31002.html

ali_key=0872d097a1d756ea**2e7414569c4c0*文章源自狐狸影视城-https://fox-studio.net/31002.html

SignStr=3B5DD97615FF384D8C0F6E7C0EBF73C*文章源自狐狸影视城-https://fox-studio.net/31002.html

最后再通过代码对比,就很简单的写出了每行代码的功能。也就明白了软件返回了什么样的东西。最后添加上备注的结果如下:文章源自狐狸影视城-https://fox-studio.net/31002.html

此处为隐藏的内容
注册登录后,方可查看

其中的文章源自狐狸影视城-https://fox-studio.net/31002.html

  1. //数据写入get.txt文件中  

以下的内容为创建写入的文件和从软件中返回的内容。文章源自狐狸影视城-https://fox-studio.net/31002.html

 文章源自狐狸影视城-https://fox-studio.net/31002.html

如此,就可以通过一点手段,来做到破解软件的目的。或者你会自己编写程序的话,也就可以自己去做一个软件加API接口了!文章源自狐狸影视城-https://fox-studio.net/31002.html

VipSystem的用户群中,已经有一个朋友和我在研究新的软件,来实现通过转账的方式做到自动充值的目的。并且会作为本插件的内置功能提供使用。当然,我们付出了努力与精力,插件的价格也会有所改变。作为回报作者,以及维护的成本。价格肯定会很便宜。文章源自狐狸影视城-https://fox-studio.net/31002.html

文章源自狐狸影视城-https://fox-studio.net/31002.html
weinxin
千年骚狐
  • 本文由 发表于 2016年3月19日
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
评论:1   其中:访客  1   博主  0
    • 好书网
      好书网 2

      进来看看、周末好

    匿名

    发表评论

    匿名网友 填写信息

    :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

    确定