-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppFactoryTest.php
35 lines (29 loc) · 942 Bytes
/
AppFactoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace application_center;
class AppFactoryTest{
public function getAppInfo(){
$token = "app_id";
$class = new AppFactoryServer();
$appClient = $class->CreateAppFactory($token);
return $appClient->getAppInfo();
}
public function login(){
$utoken = "user client utoken";
$appClient = $this->getAppInfo();
$userInfo = $appClient->getUserModule()->getUtoken($utoken);
if ($userInfo != null) return $userInfo ;
$appClient->login();
$appClient->getUserModule()->createUser();
$appClient->getUserModule()->setUtoken();
$appClient->loginAfter();
}
public function pay(){
$appClient = $this->getAppInfo();
$appClient->tradePay();
}
public function executeSdk(){
$appClient = $this->getAppInfo();
$sdkClient = $appClient->getSdkClient();
$sdkClient->pushMessage();
}
}