Exemplo n.º 1
0
 public function requestToken($auth_code)
 {
     $AlipaySystemOauthTokenRequest = new AlipaySystemOauthTokenRequest();
     $AlipaySystemOauthTokenRequest->setCode($auth_code);
     $AlipaySystemOauthTokenRequest->setGrantType("authorization_code");
     $result = aopclient_request_execute($AlipaySystemOauthTokenRequest);
     return $result;
 }
Exemplo n.º 2
0
 public function getAlipaySystemOauthTokenRequest($authCode)
 {
     $c = new AopClient();
     $c->appId = self::appId;
     $c->rsaPrivateKeyFilePath = dirname(__FILE__) . self::rsaPrivateKeyFilePath;
     $c->format = 'json';
     $req = new AlipaySystemOauthTokenRequest();
     $req->setGrantType("authorization_code");
     $req->setCode($authCode);
     $resp = $c->execute($req);
     return $resp;
 }