本文整理汇总了PHP中PayPal::valid方法的典型用法代码示例。如果您正苦于以下问题:PHP PayPal::valid方法的具体用法?PHP PayPal::valid怎么用?PHP PayPal::valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PayPal
的用法示例。
在下文中一共展示了PayPal::valid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process($sProvider = '')
{
switch ($sProvider) {
case 'paypal':
$oPayPal = new PayPal($this->config->values['module.setting']['sandbox.enable']);
if ($oPayPal->valid() && $this->httpRequest->postExists('item_number')) {
if ($this->oUserModel->updateMembership($this->httpRequest->post('item_number'), $this->iProfileId, $this->httpRequest->post('amount'), $this->dateTime->dateTime('Y-m-d H:i:s'))) {
$this->log($oPayPal, t('PayPal payment was made, the following information:'));
$this->_bStatus = true;
// Status is OK
}
}
unset($oPayPal);
break;
case '2co':
$o2CO = new TwoCO($this->config->values['module.setting']['sandbox.enable']);
$sVendorId = $this->config->values['module.setting']['2co.vendor_id'];
$sSecretWord = $this->config->values['module.setting']['2co.secret_word'];
if ($o2CO->valid($sVendorId, $sSecretWord) && $this->httpRequest->postExists('sale_id')) {
if ($this->oUserModel->updateMembership($this->httpRequest->post('sale_id'), $this->iProfileId, $this->httpRequest->post('price'), $this->dateTime->dateTime('Y-m-d H:i:s'))) {
$this->log($o2CO, t('2CheckOut payment was made, the following information:'));
$this->_bStatus = true;
// Status is OK
}
}
unset($o2CO);
break;
case 'ccbill':
// In developing...
// Contact us at <ph7software@gmail.com> if you want to help us develop the payment system CCBill
break;
default:
$this->displayPageNotFound(t('Provinder Not Found!'));
}
// Set the page titles
$this->sTitle = $this->_bStatus ? t('Thank you!') : t('Error occurred!');
$this->view->page_title = $this->sTitle;
$this->view->h2_title = $this->sTitle;
if ($this->_bStatus) {
$this->updateAffCom();
}
// Set the valid page
$sPage = $this->_bStatus ? 'success' : 'error';
$this->manualTplInclude($sPage . $this->view->getTplExt());
// Output
$this->output();
}