NAME

PayProp::API::Public::Client::Role::APIRequest - Role to encapsulate API requests.

SYNOPSIS

package PayProp::API::Public::Client::Request::*;
with qw/ PayProp::API::Public::Client::Role::APIRequest /;

...;

__PACKAGE__->meta->make_immutable;

DESCRIPTION

Define methods to call various API endpoints via retry flow.

api_request_p

Method to be called from API modules that implements retry mechanism and handls exceptions.

my $Promise = $self->api_request_p({
	method => 'POST',
	params => { ... },
});

Return:

C<Mojo::Promise> resolving to underlying API response modules on success
or C<PayProp::API::Public::Client::Exception::Response> on API error response.