现在支付宝商户对于商家接入支付宝即时到账接口管理比较严格,一般都是需要支付宝企业账户才能申请开通即时到账接口的。这对于大部分个人商家来说,无疑不利于快速回笼资金。
本接口通过一个变通的方式,利用支付宝系统中的转账付款功能,来跟自己的商城实现对接,让客户在下单后直接跳转到支付宝的转账付款页面,通过转账付款的方式来给自己的支付宝账号付款。
客户在转账付款界面无需自已填写订单相关信息,程序自动填写。如:收款账号、付款金额、付款备注等信息。客户在网站下单后只管支付就行了。
<?php /** * ECSHOP 支付宝转账付款功能,配合我们的支付通软件,可实现全自动订单付款状态更新、会员自动充值功能! 现在支付宝商户对于商家接入支付宝即时到账接口管理比较严格,一般都是需要企业账户才能申请开通即时到账接口的。这对于大部分个人商家来说,无疑不利于快速回笼资金。本接口通过一个变通的方式,利用支付宝系统中的转账付款功能,来跟自己的商城实现对接,让客户在下单后直接跳转到这个支付宝的转账付款页面,然后输入自己的账号密码,就可以给自己的账号付款了。配合我们提供的【支付通】软件,可以实现24小时自动更新网站订单状态,自动为会员充值等功能。请进入我们的官方网站下载软件并使用吧! * ==================================================================================================== * 版权所有 2010-2015 支付通,并保留所有权利。 * ==================================================================================================== */ if (!defined('IN_ECS')) { die('Hacking attempt'); } $payment_lang = ROOT_PATH . 'languages/' .$GLOBALS['_CFG']['lang']. '/payment/alipayeasypay.php'; if (file_exists($payment_lang)) { global $_LANG; include_once($payment_lang); } /* 模块的基本信息 */ if (isset($set_modules) && $set_modules == TRUE) { $i = isset($modules) ? count($modules) : 0; /* 代码 */ $modules[$i]['code'] = basename(__FILE__, '.php'); /* 描述对应的语言项 */ $modules[$i]['desc'] = 'alipayeasypay_desc'; /* 是否支持货到付款 */ $modules[$i]['is_cod'] = '0'; /* 是否支持在线支付 */ $modules[$i]['is_online'] = '1'; /* 作者 */ $modules[$i]['author'] = 'yiditushe(老曹)'; /* 网址 */ $modules[$i]['website'] = 'http://easypay.myshopex.com/'; /* 版本号 */ $modules[$i]['version'] = '1.0.0'; /* 配置信息 */ $modules[$i]['config'] = array( array('name' => 'alipayeasypay_account', 'type' => 'text', 'value' => ''), array('name' => 'alipayeasypay_key', 'type' => 'text', 'value' => ''), array('name' => 'alipayeasypay_mobile', 'type' => 'text', 'value' => ''), ); return; } /** * 类 */ class alipayeasypay { /** * 构造函数 * * @access public * @param * * @return void */ function alipayeasypay() { } function __construct() { $this->alipayeasypay(); } /** * 生成支付代码 * @param array $order 订单信息 * @param array $payment 支付方式信息 */ function get_code($order, $payment) { if (!defined('EC_CHARSET')) { $charset = 'utf-8'; } else { $charset = EC_CHARSET; } $parameter = array( 'optEmail' => $payment['alipayeasypay_account'], 'payAmount' => $order['order_amount'], ); if($order['order_id']){ $parameter['title']= $order['order_sn']."|".$order['log_id']; $parameter['memo']= ("订单号:".$order['order_sn']); }else{ $parameter['title']= $order['log_id']."|".$order['log_id']; $parameter['memo']= ("会员充值:".$order['user_name']); } if($payment['alipayeasypay_mobile']){ $parameter['smsNo']= $payment['alipayeasypay_mobile']; } $button = '<p style="text-align:center;" ><form id="__allpayForm" accept-charset="gbk" method="post" onsubmit="document.charset=\'gbk\';" target="_blank" action="https://shenghuo.alipay.com/send/payment/fill.htm">'; foreach ($parameter as $keys => $value) { $button .="<input type='hidden' name='$keys' value='$value' />"; } $button .= '<input type="submit" id="__paymentButton" value="' . $GLOBALS['_LANG']['pay_button'] . '" />'; $button .= '</form></p>'; return $button; } /** * 响应操作 */ function respond() { if (!empty($_POST)) { foreach($_POST as $key => $data) { $_GET[$key] = $data; } } $payment = get_payment($_GET['code']); $sig = $_GET['sig'];//签名 $tradeno = $_GET['tradeNo'];//交易号 $desc = $_GET['desc'];//交易名称(付款说明) $time = $_GET['time'];//付款时间 $username = $_GET['username'];//客户名称 $userid = $_GET['userid'];//客户id $money = $amount = $_GET['amount'];//交易额 $status = $_GET['status'];//交易状态 $order_sn_logid = str_replace("付款-", "", $desc); $key = $payment['alipayeasypay_key']; //验证签名 if(strtoupper(md5("$tradeno|$desc|$time|$username|$userid|$amount|$status|$key")) == $sig){ //这里做订单业务,在下面写您的代码即可 //检查付款金额和支付单的金额是否一致,不一致的话,报错处理 /* 检查支付的金额是否相符 */ list($order_sn, $log_id) = explode("|", $order_sn_logid); if (!check_money($log_id, $money)){ echo "支付金额不一致";exit; return false; } /* 改变订单状态 */ order_paid($log_id, 2); echo "ok";exit; return true; }else{ echo "验证签名失败";exit; return false; } } } ?>
相关文章:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
