parent
d58c040997
commit
10efb83532
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\common\payment ;
|
||||||
|
|
||||||
|
use app\common\payment\Ipayment;
|
||||||
|
|
||||||
|
//實作金流串接介面
|
||||||
|
class EcpayCredit implements Ipayment{
|
||||||
|
public function pay ( $order )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\common\payment ;
|
||||||
|
|
||||||
|
use app\common\payment\Ipayment;
|
||||||
|
|
||||||
|
//實作金流串接介面
|
||||||
|
class CmpAtm implements Ipayment{
|
||||||
|
public function pay ( $order )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\common\payment;
|
||||||
|
|
||||||
|
//定義一個金流串接介面
|
||||||
|
interface Ipayment
|
||||||
|
{
|
||||||
|
public function pay($order);
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\common\payment;
|
||||||
|
|
||||||
|
use app\common\payment\Ipayment;
|
||||||
|
|
||||||
|
class Payment
|
||||||
|
{
|
||||||
|
private $paymentGateway;
|
||||||
|
|
||||||
|
public function __construct(Ipayment $paymentGateway){
|
||||||
|
$this->paymentGateway = $paymentGateway;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process($order){
|
||||||
|
$this->paymentGateway->pay($order);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\service;
|
||||||
|
|
||||||
|
use think\Exception;
|
||||||
|
|
||||||
|
use app\common\lib\Sign;
|
||||||
|
|
||||||
|
|
||||||
|
class ApiService {
|
||||||
|
private static $instance = null;
|
||||||
|
|
||||||
|
private $httpClient;
|
||||||
|
|
||||||
|
private function __construct() {
|
||||||
|
// 初始化 GuzzleHttp\Client 實例
|
||||||
|
$this->httpClient = new \GuzzleHttp\Client([
|
||||||
|
'base_uri' => 'https://sso.h888.fun/api/v1/'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getInstance() {
|
||||||
|
if (self::$instance == null) {
|
||||||
|
self::$instance = new ApiService();
|
||||||
|
}
|
||||||
|
return self::$instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function callApi($url, $method = 'GET', $params = []) {
|
||||||
|
$params['appid'] = 'sc';
|
||||||
|
$params['timestamp'] = time();
|
||||||
|
|
||||||
|
$params['sign'] = Sign::genSign($params);
|
||||||
|
|
||||||
|
$options = ['query' => $params];
|
||||||
|
$response = $this->httpClient->request($method, $url, $options);
|
||||||
|
|
||||||
|
if($response->getStatusCode()!=200){
|
||||||
|
//throw 異常;
|
||||||
|
throw new Exception('get sso user info error!!!');
|
||||||
|
}
|
||||||
|
|
||||||
|
$sso_data = json_decode($response->getBody()->getContents(),true);
|
||||||
|
return $sso_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\service;
|
||||||
|
|
||||||
|
use app\service\ApiService;
|
||||||
|
|
||||||
|
class Sso{
|
||||||
|
public static function getUserInfo($params){
|
||||||
|
$apiService = ApiService::getInstance();
|
||||||
|
$response = $apiService->callApi('user/getInfo', 'GET', $params);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 12 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,24 +1,3 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel="icon" href="/card/favicon.ico"><link rel="stylesheet" href="/card/css/flex2html.css"><link href="https://dev.iconly.io/public/1osUDQK8vVhk/iconly.css" rel="stylesheet"><title>card</title><style>[v-cloak] {
|
||||||
<html lang="">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
<link rel="stylesheet" href="./css/flex2html.css">
|
|
||||||
<title>card</title>
|
|
||||||
<style>
|
|
||||||
[v-cloak] {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}</style><link href="/card/css/app.b9e4f83d.css" rel="preload" as="style"><link href="/card/css/chunk-vendors.a0eabc20.css" rel="preload" as="style"><link href="/card/js/app.648e3fb9.js" rel="preload" as="script"><link href="/card/js/chunk-vendors.503fc5a1.js" rel="preload" as="script"><link href="/card/css/chunk-vendors.a0eabc20.css" rel="stylesheet"><link href="/card/css/app.b9e4f83d.css" rel="stylesheet"></head><body><noscript><strong>UTel感應式電子名片</strong></noscript><div id="app"></div><script src="/card/js/flex2html.min.js"></script><script src="/card/js/chunk-vendors.503fc5a1.js"></script><script src="/card/js/app.648e3fb9.js"></script></body></html>
|
||||||
</style>
|
|
||||||
<link href="/card/js/app.js" rel="preload" as="script"><link href="/card/js/chunk-vendors.js" rel="preload" as="script"></head>
|
|
||||||
<body>
|
|
||||||
<noscript>
|
|
||||||
<strong>UTel感應式電子名片</strong>
|
|
||||||
</noscript>
|
|
||||||
<div id="app"></div>
|
|
||||||
<!-- built files will be auto injected -->
|
|
||||||
<script src="./js/flex2html.min.js"></script>
|
|
||||||
<script type="text/javascript" src="/card/js/chunk-vendors.js"></script><script type="text/javascript" src="/card/js/app.js"></script></body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,3 +1,3 @@
|
|||||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="/send/favicon.ico"><title>send</title><style>[v-cloak] {
|
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="/send/favicon.ico"><title>send</title><style>[v-cloak] {
|
||||||
display: none;
|
display: none;
|
||||||
}</style><link href="/send/css/app.5c51c852.css" rel="preload" as="style"><link href="/send/css/chunk-vendors.90bbb257.css" rel="preload" as="style"><link href="/send/js/app.c6aea39f.js" rel="preload" as="script"><link href="/send/js/chunk-vendors.9e25c284.js" rel="preload" as="script"><link href="/send/css/chunk-vendors.90bbb257.css" rel="stylesheet"><link href="/send/css/app.5c51c852.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but send doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/send/js/chunk-vendors.9e25c284.js"></script><script src="/send/js/app.c6aea39f.js"></script></body></html>
|
}</style><link href="/send/css/app.26e228e4.css" rel="preload" as="style"><link href="/send/css/chunk-vendors.90bbb257.css" rel="preload" as="style"><link href="/send/js/app.083ecfcd.js" rel="preload" as="script"><link href="/send/js/chunk-vendors.9e25c284.js" rel="preload" as="script"><link href="/send/css/chunk-vendors.90bbb257.css" rel="stylesheet"><link href="/send/css/app.26e228e4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but send doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/send/js/chunk-vendors.9e25c284.js"></script><script src="/send/js/app.083ecfcd.js"></script></body></html>
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue