支付宝移动服务器签名-php

1
2
3
4
5
6
7
8
9
10
11
12
<?php
echo ini_get('display_errors');
require_once dirname ( __FILE__ ).'/../third_party/alipay/config.php';
require_once dirname ( __FILE__ ).'/../third_party/alipay/AopSdk.php';
if (isset($_POST['params'])) {
$params = json_decode($_POST['params'],true);
$aop = new AopClient();
$aop->rsaPrivateKey = $config['merchant_private_key'];
$signed = urlencode($aop->generateSign($params,'RSA2'));
echo "sign=".$signed;
}
?>