PHP Class PayPal\Core\PayPalCredentialManager

PayPalCredentialManager holds all the credential information in one place.
ファイルを表示 Open project: paypal/rest-api-sdk-php Class Usage Examples

Public Methods

Method Description
__clone ( ) Disabling __clone call
getCredentialObject ( null $userId = null ) : OAuthTokenCredential Obtain Credential Object based on UserId provided.
getInstance ( array | null $config = null ) : PayPalCredentialManager Create singleton instance for this class.
setCredentialObject ( OAuthTokenCredential $credential, string | null $userId = null, boolean $default = true ) Sets credential object for users

Private Methods

Method Description
__construct ( $config ) Constructor initialize credential for multiple accounts specified in property file
initCredential ( array $config ) Load credentials for multiple accounts, with priority given to Signature credential.

Method Details

__clone() public method

Disabling __clone call
public __clone ( )

getCredentialObject() public method

Obtain Credential Object based on UserId provided.
public getCredentialObject ( null $userId = null ) : OAuthTokenCredential
$userId null
return PayPal\Auth\OAuthTokenCredential

getInstance() public static method

Create singleton instance for this class.
public static getInstance ( array | null $config = null ) : PayPalCredentialManager
$config array | null
return PayPalCredentialManager

setCredentialObject() public method

Sets credential object for users
public setCredentialObject ( OAuthTokenCredential $credential, string | null $userId = null, boolean $default = true )
$credential PayPal\Auth\OAuthTokenCredential
$userId string | null User Id associated with the account
$default boolean If set, it would make it as a default credential for all requests