Notify.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace Cmbc\Api;
  3. class Notify extends Core
  4. {
  5. protected function init()
  6. {
  7. $this->api = 'https://ipaynow.acquire.cmbchina.com/';
  8. $this->param['funcode'] = 'WP001';
  9. $this->param['version'] = '1.0.0';
  10. }
  11. public function request($request, $tool = false)
  12. {
  13. $this->data = $request;
  14. $tool->log('支付回调-初始化11', $request);
  15. $this->setParam('mhtOrderNo');
  16. $this->setParam('mhtOrderName');
  17. $this->setParam('mhtOrderType');
  18. $this->setParam('mhtCurrencyType');
  19. $this->setParam('mhtOrderAmt');
  20. $this->setParam('oriMhtOrderAmt');
  21. $this->setParam('discountAmt');
  22. $this->setParam('mhtOrderDetail');
  23. $this->setParam('mhtOrderTimeOut');
  24. $this->setParam('mhtOrderStartTime');
  25. $this->setParam('payTime');
  26. $this->setParam('nowPayOrderNo');
  27. $this->setParam('transStatus');
  28. $this->setParam('mhtCharset');
  29. $this->setParam('deviceType');
  30. $this->setParam('payChannelType');
  31. $this->setParam('channelOrderNo');
  32. $this->setParam('payConsumerId');
  33. $this->setParam('mhtReserved');
  34. $this->setParam('bankType');
  35. $this->setParam('cardType');
  36. $this->setParam('signType');
  37. $error = $this->getError();
  38. if ($error) {
  39. return $tool->updateOrder($this->param['mhtOrderNo'], $this->param['mhtOrderAmt'], $error);
  40. }
  41. $tool->log('支付回调-初始化22', $this->param);
  42. $signature = $this->createSignature($this->param['signType']);
  43. if ($signature != $this->data['signature']) {
  44. $tool->updateOrder($this->param['mhtOrderNo'], $this->param['mhtOrderAmt'], '签名错误');
  45. }
  46. return $this->param;
  47. }
  48. public function response($response)
  49. {
  50. return $response;
  51. }
  52. }