PaymentRepositories.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <<<<<<< HEAD
  2. <?php
  3. namespace crmeb\repositories;
  4. use app\models\store\StoreOrder;
  5. use app\models\user\UserRecharge;
  6. /**
  7. * Class PaymentRepositories
  8. * @package crmeb\repositories
  9. */
  10. class PaymentRepositories
  11. {
  12. /**
  13. * 公众号下单成功之后
  14. * @param $order
  15. * @param $prepay_id
  16. */
  17. public static function wechatPaymentPrepare($order, $prepay_id)
  18. {
  19. }
  20. /**
  21. * 小程序下单成功之后
  22. * @param $order
  23. * @param $prepay_id
  24. */
  25. public static function wechatPaymentPrepareProgram($order, $prepay_id)
  26. {
  27. }
  28. /**
  29. * 使用余额支付订单时
  30. * @param $userInfo
  31. * @param $orderInfo
  32. */
  33. public static function yuePayProduct($userInfo, $orderInfo)
  34. {
  35. }
  36. /**
  37. * 订单支付成功之后
  38. * @param string|null $order_id 订单id
  39. * @return bool
  40. */
  41. public static function wechatProduct(string $order_id = null)
  42. {
  43. try {
  44. if (StoreOrder::be(['order_id' => $order_id, 'paid' => 1])) return true;
  45. return StoreOrder::paySuccess($order_id);
  46. } catch (\Exception $e) {
  47. return false;
  48. }
  49. }
  50. /**
  51. * 订单支付成功之后
  52. * @param string|null $order_id 订单id
  53. * @return bool
  54. */
  55. public static function aliProduct(string $order_id = null)
  56. {
  57. try {
  58. if (StoreOrder::be(['order_id' => $order_id, 'paid' => 1])) return true;
  59. return StoreOrder::paySuccess($order_id, 'ali');
  60. } catch (\Exception $e) {
  61. return false;
  62. }
  63. }
  64. /**
  65. * 充值成功后
  66. * @param string|null $order_id 订单id
  67. * @return bool
  68. */
  69. public static function wechatUserRecharge(string $order_id = null)
  70. {
  71. try {
  72. if (UserRecharge::be(['order_id' => $order_id, 'paid' => 1])) return true;
  73. return UserRecharge::rechargeSuccess($order_id);
  74. } catch (\Exception $e) {
  75. return false;
  76. }
  77. }
  78. =======
  79. <?php
  80. namespace crmeb\repositories;
  81. use app\models\store\StoreOrder;
  82. use app\models\user\UserRecharge;
  83. /**
  84. * Class PaymentRepositories
  85. * @package crmeb\repositories
  86. */
  87. class PaymentRepositories
  88. {
  89. /**
  90. * 公众号下单成功之后
  91. * @param $order
  92. * @param $prepay_id
  93. */
  94. public static function wechatPaymentPrepare($order, $prepay_id)
  95. {
  96. }
  97. /**
  98. * 小程序下单成功之后
  99. * @param $order
  100. * @param $prepay_id
  101. */
  102. public static function wechatPaymentPrepareProgram($order, $prepay_id)
  103. {
  104. }
  105. /**
  106. * 使用余额支付订单时
  107. * @param $userInfo
  108. * @param $orderInfo
  109. */
  110. public static function yuePayProduct($userInfo, $orderInfo)
  111. {
  112. }
  113. /**
  114. * 订单支付成功之后
  115. * @param string|null $order_id 订单id
  116. * @return bool
  117. */
  118. public static function wechatProduct(string $order_id = null)
  119. {
  120. try {
  121. if (StoreOrder::be(['order_id' => $order_id, 'paid' => 1])) return true;
  122. return StoreOrder::paySuccess($order_id);
  123. } catch (\Exception $e) {
  124. return false;
  125. }
  126. }
  127. /**
  128. * 订单支付成功之后
  129. * @param string|null $order_id 订单id
  130. * @return bool
  131. */
  132. public static function aliProduct(string $order_id = null)
  133. {
  134. try {
  135. if (StoreOrder::be(['order_id' => $order_id, 'paid' => 1])) return true;
  136. return StoreOrder::paySuccess($order_id, 'ali');
  137. } catch (\Exception $e) {
  138. return false;
  139. }
  140. }
  141. /**
  142. * 充值成功后
  143. * @param string|null $order_id 订单id
  144. * @return bool
  145. */
  146. public static function wechatUserRecharge(string $order_id = null)
  147. {
  148. try {
  149. if (UserRecharge::be(['order_id' => $order_id, 'paid' => 1])) return true;
  150. return UserRecharge::rechargeSuccess($order_id);
  151. } catch (\Exception $e) {
  152. return false;
  153. }
  154. }
  155. >>>>>>> 386b37d33e5ba817cba00df29efaefbd692e4dd1
  156. }