当前位置: 首页>>代码示例>>PHP>>正文


PHP AlipayNotify::getPostData方法代码示例

本文整理汇总了PHP中AlipayNotify::getPostData方法的典型用法代码示例。如果您正苦于以下问题:PHP AlipayNotify::getPostData方法的具体用法?PHP AlipayNotify::getPostData怎么用?PHP AlipayNotify::getPostData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AlipayNotify的用法示例。


在下文中一共展示了AlipayNotify::getPostData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dirname

 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */
/**
 * This is the Notify URL file, called by Alipay system
 *
 * First, we need to verify the genuineness of the notification by calling the Alipay "notify_verify" service
 * Then we performs some tests with local values
 * Finally, after we made the proper actions, we need to answer to Alipay with the word "success" or "fail"
 * @see AlipayNotify
 */
require_once '../../config/config.inc.php';
require_once dirname(__FILE__) . '/alipay.php';
require_once dirname(__FILE__) . '/api/loader.php';
$alipay_notify = new AlipayNotify();
$alipay_notify->getPostData();
switch ($alipay_notify->getNotifyType()) {
    case "trade_status_sync":
        $default_config = array('secrete_key' => false);
        $service = Configuration::get('ALIPAY_SERVICE_NOTIFY_VERIFY');
        $credentials = AlipayTools::getCredentials($service, $default_config);
        $alipayapi = new AlipayApi($credentials);
        $alipay_notify->setParamList('notify_verify');
        $alipayapi->prepareRequest($alipay_notify, false);
        $url = $alipayapi->createUrl();
        $alipay_notify->setParamList('compare_sign');
        $params = $alipayapi->getProtocolParams();
        unset($params['partner']);
        unset($params['service']);
        $alipayapi->setProtocolParams($params);
        $alipayapi->setSecreteKey(Configuration::get('ALIPAY_SECRETE_KEY'));
开发者ID:mathieuesteban,项目名称:alipay,代码行数:31,代码来源:notify_url.php


注:本文中的AlipayNotify::getPostData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。