Notify.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. $this->setParam('mhtOrderNo');
  15. $this->setParam('mhtOrderName');
  16. $this->setParam('mhtOrderType');
  17. $this->setParam('mhtCurrencyType');
  18. $this->setParam('mhtOrderAmt');
  19. $this->setParam('oriMhtOrderAmt');
  20. $this->setParam('discountAmt');
  21. $this->setParam('mhtOrderDetail');
  22. $this->setParam('mhtOrderTimeOut');
  23. $this->setParam('mhtOrderStartTime');
  24. $this->setParam('payTime');
  25. $this->setParam('nowPayOrderNo');
  26. $this->setParam('transStatus');
  27. $this->setParam('mhtCharset');
  28. $this->setParam('deviceType');
  29. $this->setParam('payChannelType');
  30. $this->setParam('channelOrderNo');
  31. $this->setParam('payConsumerId');
  32. $this->setParam('mhtReserved');
  33. $this->setParam('bankType');
  34. $this->setParam('cardType');
  35. $this->setParam('signType');
  36. $error = $this->getError();
  37. if ($error) {
  38. return $tool->updateOrder($this->param['mhtOrderNo'], $this->param['mhtOrderAmt'], $error);
  39. }
  40. $signature = $this->createSignature($this->param['signType']);
  41. if ($signature != $data['signature']) {
  42. $tool->updateOrder($this->param['mhtOrderNo'], $this->param['mhtOrderAmt'], '签名错误');
  43. }
  44. return $this->param;
  45. }
  46. public function response($response)
  47. {
  48. return $response;
  49. }
  50. }