| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace app\api\service;
- class ThirdPayService extends BaseService
- {
- //256D40416947FAD6C41742179D5389466DC6E793
- private $wxService;
- public function __construct()
- {
- $this->wxService = new WxService();
- }
- // ali支付
- public function payAli($order)
- {
- return $this->ok("appid=sadasdaasfmkasklan&sign=sdfsdjkgsdnsvmklsas");
- }
- // 微信支付
- public function payWechat($platform, $openid, $order_no, $order_amount, $description = "购买服务")
- {
- switch ($platform) {
- case "app":
- return $this->wxService->appPay($openid, $order_no, $description, $order_amount);
- case "web":
- return $this->wxService->webPay($openid, $order_no, $description, $order_amount);
- case "applet":
- return $this->wxService->appletPay($openid, $order_no, $description, $order_amount);
- }
- return $this->fail("支付方式错误!");
- }
- public function refundByWx($platform, $order_no, $description, $order_amount, $refund_amount)
- {
- switch ($platform) {
- case "app":
- return $this->wxService->appRefund($order_no, $description, $order_amount, $refund_amount);
- case "web":
- return $this->wxService->webRefund($order_no, $description, $order_amount, $refund_amount);
- case "applet":
- return $this->wxService->appletRefund($order_no, $description, $order_amount, $refund_amount);
- }
- return $this->fail("支付方式错误!");
- }
- public function refundByAli($order)
- {
- return $this->ok(true);
- }
- }
|