Class: CheckoutSdk::SdkAuthorization
- Inherits:
-
Object
- Object
- CheckoutSdk::SdkAuthorization
- Defined in:
- lib/checkout_sdk/sdk_authorization.rb
Instance Attribute Summary collapse
-
#credential ⇒ Object
Returns the value of attribute credential.
-
#platform_type ⇒ Object
Returns the value of attribute platform_type.
Instance Method Summary collapse
- #authorization_header ⇒ Object
-
#initialize(platform_type, credential) ⇒ SdkAuthorization
constructor
A new instance of SdkAuthorization.
Constructor Details
#initialize(platform_type, credential) ⇒ SdkAuthorization
Returns a new instance of SdkAuthorization.
9 10 11 12 |
# File 'lib/checkout_sdk/sdk_authorization.rb', line 9 def initialize(platform_type, credential) @platform_type = platform_type @credential = credential end |
Instance Attribute Details
#credential ⇒ Object
Returns the value of attribute credential.
5 6 7 |
# File 'lib/checkout_sdk/sdk_authorization.rb', line 5 def credential @credential end |
#platform_type ⇒ Object
Returns the value of attribute platform_type.
5 6 7 |
# File 'lib/checkout_sdk/sdk_authorization.rb', line 5 def platform_type @platform_type end |
Instance Method Details
#authorization_header ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/checkout_sdk/sdk_authorization.rb', line 14 def case @platform_type when PlatformType::PREVIOUS, PlatformType::CUSTOM @credential when PlatformType::DEFAULT, PlatformType::OAUTH "Bearer #{@credential}" else raise CheckoutAuthorizationException, 'Invalid platform type' end end |