NAME

PayProp::API::Public::Client::Authorization::Base - Base module for authorization modules.

SYNOPSIS

{
	package PayProp::API::Public::Client::Authorization::Custom;

	use Mouse;
	extends qw/ PayProp::API::Public::Client::Authorization::Base /;

	...;

	__PACKAGE__->meta->make_immutable;
}

my $CustomAuthorization = PayProp::API::Public::Client::Authorization::Custom->new;

DESCRIPTION

*DO NOT INSTANTIATE THIS MODULE DIRECTLY*

Base authorization module for alternative implementations. This module expects for PayProp::API::Public::Client::Authorization::* modules to define their own implementation on how the token should be returned. The base module will handle retrieving token either directly or from a defined storage solution.

The only requirement this module has is for extending modules to override _token_request_p method that returns a Mojo::Promise containing token and token_type in a HashRef.

See PayProp::API::Public::Client::Authorization::ClientCredentials implementation using storage and request pattern, and PayProp::API::Public::Client::Authorization::APIKey for returning token information directly.