BaseDelivery.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace crmeb\basic;
  12. /**
  13. * Class BaseDelivery
  14. * @package crmeb\basic
  15. */
  16. abstract class BaseDelivery extends BaseStorage
  17. {
  18. /**
  19. * 回调地址
  20. * @var null
  21. */
  22. protected $callback_url = null;
  23. /**
  24. * 初始化
  25. * @param array $config
  26. * @return mixed|void
  27. */
  28. protected function initialize(array $config)
  29. {
  30. $this->callback_url = rtrim(sys_config('site_url'), '/') . '/api/city_delivery/notify';
  31. }
  32. /**
  33. * @param $data
  34. * @return mixed
  35. */
  36. abstract function addMerchant($data); //注册商户
  37. /**
  38. * @param $data
  39. * @return mixed
  40. */
  41. abstract function addShop($data); //创建门店
  42. /**
  43. * @param $data
  44. * @return mixed
  45. */
  46. abstract function updateShop($data); //更新门店
  47. /**
  48. * @param $data
  49. * @return mixed
  50. */
  51. abstract function addOrder($data); //发布订单
  52. /**
  53. * @param $data
  54. * @return mixed
  55. */
  56. abstract function getOrderPrice($data); //计算订单价格
  57. /**
  58. * @param $data
  59. * @return mixed
  60. */
  61. abstract function getOrderDetail($data); //获取订单详情
  62. /**
  63. * @param $data
  64. * @return mixed
  65. */
  66. abstract function cancelOrder($data); //取消订单
  67. /**
  68. * @param $data
  69. * @return mixed
  70. */
  71. abstract function getRecharge($data); //获取充值地址
  72. /**
  73. * @param $data
  74. * @return mixed
  75. */
  76. abstract function getBalance($data); //获取余额
  77. /**
  78. * @param $data
  79. * @return mixed
  80. */
  81. abstract function addTip($data); //支付小费
  82. /**
  83. * @param $data
  84. * @return mixed
  85. */
  86. abstract function getCity($data); //获取城市信息
  87. }