123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- namespace liuniu\repositories;
- use app\common\model\Lave;
- use app\common\model\LaveMonth;
- use app\common\model\OrderLevel;
- class PaymentRepositories
- {
- /**
- * 公众号下单成功之后
- * @param $order
- * @param $prepay_id
- */
- public static function wechatPaymentPrepare($order, $prepay_id)
- {
- }
- /**
- * 小程序下单成功之后
- * @param $order
- * @param $prepay_id
- */
- public static function wechatPaymentPrepareProgram($order, $prepay_id)
- {
- }
- /**
- * 使用余额支付订单时
- * @param $userInfo
- * @param $orderInfo
- */
- public static function yuePayProduct($userInfo, $orderInfo)
- {
- }
- /**
- * 订单支付成功之后
- * @param string|null $order_id 订单id
- * @return bool
- */
- public static function wechatProduct(string $order_id = null)
- {
- try {
- if (StoreOrder::be(['order_id' => $order_id, 'paid' => 1])) return true;
- return StoreOrder::paySuccess($order_id);
- } catch (\Exception $e) {
- return false;
- }
- }
- /**
- * 捐款支付成功之后
- * @param string|null $order_id 订单id
- * @return bool
- */
- public static function wechatLave($event)
- {
- list($cid, $order_id) = $event;
- try {
- if (Lave::where(['cid' => $cid, 'order_id' => $order_id, 'paid' => 1])->find()) return true;
- return Lave::paySuccess($cid, $order_id);
- } catch (\Exception $e) {
- return false;
- }
- }
- /**
- * 捐款支付成功之后
- * @param string|null $order_id 订单id
- * @return bool
- */
- public static function wechatLevel($event)
- {
- list($cid, $order_id) = $event;
- try {
- if (OrderLevel::where(['cid' => $cid, 'order_id' => $order_id, 'paid' => 1])->find()) return true;
- return OrderLevel::paySuccess($cid, $order_id);
- } catch (\Exception $e) {
- return false;
- }
- }
- /**
- * 月捐款支付成功之后
- * @param string|null $order_id 订单id
- * @return bool
- */
- public static function wechatMonthLave($event)
- {
- list($cid, $order_id) = $event;
- try {
- if (LaveMonth::where(['cid' => $cid, 'contract_code' => $order_id, 'paid' => 1])->find()) return true;
- return LaveMonth::paySuccess($cid, $order_id);
- } catch (\Exception $e) {
- return false;
- }
- }
- /**
- * 月捐款申请扣款
- * @param string|null $order_id 订单id
- * @return bool
- */
- public static function wechatMonthLavePay($event)
- {
- list($cid, $order_id) = $event;
- try {
- if (LaveMonth::where(['cid' => $cid, 'nonce_str' => $order_id, 'paid' => 1])->find()) return true;
- return LaveMonth::pappayapplySuccess($cid, $order_id);
- } catch (\Exception $e) {
- return false;
- }
- }
- }
|