我正在尝试将Payfast(www.payfast.co.za)与Yii php框架集成。付款工作正常,我得到了ITN回调,但我的数据库查询绝对没有效果。我想知道是否可能对Yii famework等有某种限制,禁止数据库查询。有没有人对这个问题有任何见解?
仅供参考,请求始终重定向到付款成功页面,但没有数据库更新。在成功之前,我使用了与Codeigniter完全相同的逻辑,因此让我相信它可能是一个Yii问题。
负责执行db查询的代码如下:
// If the transaction was valid
if( strcmp( $result, 'VALID' ) == 0 )
{
// Process as required
switch( $pfData['payment_status'] )
{
case 'COMPLETE':
// If complete, update your application, email the buyer and process the transaction as paid
Order::model()->updateAll(array('paid'=>1),'reference="'.$pfData['m_payment_id'].'"');
break;
case 'FAILED':
// There was an error, update your application and contact a member of PayFast's support team for further assistance
break;
case 'PENDING':
// The transaction is pending, please contact a member of PayFast's support team for further assistance
break;
default:
// If unknown status, do nothing (safest course of action)
break;
}
}
问题是开关似乎不起作用?如果您想查看完整代码,请参阅此处:https://www.payfast.co.za/developers/php