Authorization payment

@param array $params

@return boolean
760541
public function auth($params)
	{
		$requestParams = $this->initRequestParams('auth', $params);
		$this->request('auth', $requestParams);

		return empty($this->error);
	}
376679
public function delete($params = array())
    {
        $arr = array( "id" => $params["id"] );
        $rawResponse = $this->client->request('delete', 'api/bank_accounts/' . $arr["id"], $arr);
        return $rawResponse;
    }
31593
protected function getAccessTokenRequest(array $params)
    {
        $request = parent::getAccessTokenRequest($params);
        $uri = $request->getUri()
            ->withUserInfo($this->clientId, $this->clientSecret);

        return $request->withUri($uri);
    }
351129
public function setAuthHeader($params)
    {
        if (is_array($params)) {
            $this->authHeader = $this->toHeader($params);
        } else {
            if (strpos($params, 'Authorization: ') !== false) {
                $params = str_replace('Authorization: ', '', $params);
            }

            $this->authHeader = $params;
        }
    }
806212
protected function getAuthorization($response)
    {
        $method = Arr::get($response, 'method');

        if ('card' == $method) {
            return Arr::get($response, 'authorization');
        }

        if ('bank_account' == $method) {
            $payment = Arr::get($response, 'payment_method', []);

            return Arr::get($payment, 'clabe');
        }

        if ('store' == $method) {
            $payment = Arr::get($response, 'payment_method', []);

            return Arr::get($payment, 'barcode_url');
        }
    }
1282489
public function repay($params = array())
    {
        $arr = array( "id" => $params["id"]);
        $rawResponse = $this->client->request('post', 'api/lending/borrows/' . $arr['id'] . '/repay', $arr);
        return $rawResponse;
    }
1054928
public function getPermissions(array $params = []): Collection
    {
        if ($this->permissions === null) {
            $this->permissions = $this->cache->remember(self::$cacheKey, self::$cacheExpirationTime, function () {
                return $this->getPermissionClass()
                    ->with('roles')
                    ->get();
            });
        }

        $permissions = clone $this->permissions;

        foreach ($params as $attr => $value) {
            $permissions = $permissions->where($attr, $value);
        }

        return $permissions;
    }
1000663
protected function hasNewConnectionParams(array $params)
    {
        if (!$this->getSession()->has(self::SESSION_CONNECTION_KEY)) {
            return true;
        }

        $currentParams = $this->getSession()->get(self::SESSION_CONNECTION_KEY);

        foreach ($this->getParamsKey() as $key) {
            if (isset($currentParams[$key]) && $params[$key] !== $currentParams[$key]) {
                return true;
            }
        }

        return false;
    }
1330746
public function PaymentOrderCreate(array $params)
    {
        $request = new Request();
        $request->setMethod('POST');

        foreach (array('PaymentPageId', 'Amount', 'Currency', 'MerchantUrls') as $param) {
            if (!isset($params[$param])) {
                throw new InvalidArgumentException($param);
            }
        }

        $params['MerchantId'] = $this->options['merchantId'];
        $request->setContent(json_encode(array('PaymentOrder' => $params)));

        return $this->doRequest('PaymentOrder/Create', $request)->getContentJson();
    }
882711
public function create(array $params)
    {
        if (!array_key_exists('amount', $params) ||
            !array_key_exists('currency', $params) ||
            !array_key_exists('description', $params) ||
            !array_key_exists('order_id', $params) ||
            !array_key_exists('payment_options', $params) ||
            !array_key_exists('type', $params)
        ) {
            throw new \InvalidArgumentException('Invalid data provided.');
        }

        return $this->post('/orders', [], $params);
    }
579345
public function isGranted($permission, Array $params = null)
    {
        if ($this->checkPermissionCurrent($permission, $params)) {
            return true;
        }

        if ($this->checkPermissionRecursive($permission, $params)) {
            return true;
        }

        return false;
    }
47270
protected function _check(array $user, array $params) {
		if ($this->getConfig('includeAuthentication') && $this->_isPublic($params)) {
			return true;
		}

		if (!$user) {
			return false;
		}

		if ($this->getConfig('superAdmin')) {
			$superAdminColumn = $this->getConfig('superAdminColumn');
			if (!$superAdminColumn) {
				$superAdminColumn = $this->getConfig('idColumn');
			}
			if (!isset($user[$superAdminColumn])) {
				throw new Exception('Missing super Admin Column in user table');
			}
			if ($user[$superAdminColumn] === $this->getConfig('superAdmin')) {
				return true;
			}
		}

		// Give any logged in user access to ALL actions when `allowUser` is
		// enabled except when the `adminPrefix` is being used.
		if ($this->getConfig('allowUser')) {
			if (empty($params['prefix'])) {
				return true;
			}
			if ($params['prefix'] !== $this->getConfig('adminPrefix')) {
				return true;
			}
		}

		$userRoles = $this->_getUserRoles($user);

		// Allow access to all prefixed actions for users belonging to
		// the specified role that matches the prefix.
		if ($this->getConfig('authorizeByPrefix') && !empty($params['prefix'])) {
			if (in_array($params['prefix'], $this->getConfig('prefixes'))) {
				$roles = $this->_getAvailableRoles();
				$role = isset($roles[$params['prefix']]) ? $roles[$params['prefix']] : null;
				if ($role && in_array($role, $userRoles)) {
					return true;
				}
			}
		}

		// Allow logged in super admins access to all resources
		if ($this->getConfig('superAdminRole')) {
			foreach ($userRoles as $userRole) {
				if ((string)$userRole === (string)$this->getConfig('superAdminRole')) {
					return true;
				}
			}
		}

		if ($this->_acl === null) {
			$this->_acl = $this->_getAcl($this->getConfig('aclFilePath'));
		}

		// Allow access if user has a role with wildcard access to the resource
		$iniKey = $this->_constructIniKey($params);
		if (isset($this->_acl[$iniKey]['actions']['*'])) {
			$matchArray = $this->_acl[$iniKey]['actions']['*'];
			foreach ($userRoles as $userRole) {
				if (in_array((string)$userRole, $matchArray)) {
					return true;
				}
			}
		}

		// Allow access if user has been granted access to the specific resource
		if (isset($this->_acl[$iniKey]['actions'])) {
			if (array_key_exists($params['action'], $this->_acl[$iniKey]['actions']) && !empty($this->_acl[$iniKey]['actions'][$params['action']])) {
				$matchArray = $this->_acl[$iniKey]['actions'][$params['action']];
				foreach ($userRoles as $userRole) {
					if (in_array((string)$userRole, $matchArray)) {
						return true;
					}
				}
			}
		}
		return false;
	}
309337
public function doAuthorization(array $array)
    {
        $this->formatRequest($array);
        $WSRequest = array(
            'payment'                   => $this->payment($array['payment']),
            'card'                      => $this->card($array['card']),
            'order'                     => $this->order($array['order']),
            'buyer'                     => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']),
            'owner'                     => $this->owner($array['owner'], $array['ownerAddress']),
            'privateDataList'           => $this->privateData,
            'authentication3DSecure'    => $this->authentication3DSecure($array['3DSecure']),
            'bankAccountData'           => $this->bankAccountData($array['bankAccountData']),
            'subMerchant'               => $this->subMerchant($array['subMerchant']),
            'asynchronousRetryTimeout'  => $array['asynchronousRetryTimeout']
        );
        return $this->webServiceRequest($array, $WSRequest, self::DIRECT_API, 'doAuthorization');
    }
200644
public function hasAccessToken(array $param = [])
    {
        if (! $this->hasStoredToken()) {
            $this->logger->debug(__CLASS__, 'has', sprintf('No access token found in %s', $this->getFilePath()));

            return false;
        }

        if ($this->isNotExpired()) {
            $this->logger->debug(__CLASS__, 'has', 'Valid access token found');

            return true;
        }

        $this->logger->debug(__CLASS__, 'has', sprintf('No valid access token found in %s', $this->getFilePath()));

        return false;
    }
904321
public function refundTransaction($params)
    {
        $this->sdk->ServiceURL = $this->getApiEndpoint('AioChargeback');
        $this->sdk->ChargeBack = array_replace(
            $this->sdk->ChargeBack,
            array_intersect_key($params, $this->sdk->ChargeBack)
        );

        return $this->sdk->AioChargeback();
    }
338141
public function createPrintUnimartC2CBillTransaction(array $params)
    {
        // 參數初始化
        $this->sdk->Send = array_merge($this->sdk->Send, [
            'AllPayLogisticsID' => '',
            'CVSPaymentNo' => '',
            'CVSValidationNo' => '',
            'PlatformID' => '',
        ]);

        $this->sdk->Send = array_replace(
            $this->sdk->Send,
            array_intersect_key($params, $this->sdk->Send)
        );

        return $this->sdk->formToArray(
            $this->sdk->PrintUnimartC2CBill()
        );
    }
664119
public function fast($params = array())
    {
        $arr = array(
            "id" => $params["id"]
        );
        $rawResponse = $this->client->request('post', 'api/deposit_money/' . $arr["id"] . "/fast", $arr);
        return $rawResponse;
    }