本文整理汇总了PHP中PayPal::receive方法的典型用法代码示例。如果您正苦于以下问题:PHP PayPal::receive方法的具体用法?PHP PayPal::receive怎么用?PHP PayPal::receive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PayPal
的用法示例。
在下文中一共展示了PayPal::receive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exit
}
}
}
exit('Error when continuing order');
} elseif (empty($_GET['token'])) {
exit('Access denied');
}
$response = $handler->request(array('METHOD' => 'GetExpressCheckoutDetails', 'TOKEN' => $_GET['token']));
$context = '';
$params = array();
if (!is_array($response)) {
$modx->log(modX::LOG_LEVEL_ERROR, '[miniShop2] Error on receive details of PayPal operation: ' . $response . '; ' . print_r($_GET, 1));
} else {
if (!empty($response['PAYMENTREQUEST_0_INVNUM'])) {
if ($order = $modx->getObject('msOrder', $response['PAYMENTREQUEST_0_INVNUM'])) {
$handler->receive($order, $response);
$context = $order->get('context');
$params['msorder'] = $order->get('id');
} else {
$modx->log(modX::LOG_LEVEL_ERROR, '[miniShop2] Could not retrieve order with id ' . $response['PAYMENTREQUEST_0_INVNUM']);
}
} else {
$modx->log(modX::LOG_LEVEL_ERROR, '[miniShop2] Error on receive details of PayPal operation: ' . print_r($response, 1) . '; ' . print_r($_GET, 1));
}
}
$success = $cancel = $modx->getOption('site_url');
if ($id = $modx->getOption('ms2_payment_paypal_success_id', null, 0)) {
$success = $modx->makeUrl($id, $context, $params, 'full');
}
if ($id = $modx->getOption('ms2_payment_paypal_cancel_id', null, 0)) {
$cancel = $modx->makeUrl($id, $context, $params, 'full');