ClientOperation
in package
Used as a wrapper for API requests to Stripe.
Allows method chaining so things like mode can be set intuitively.
Tags
Table of Contents
Properties
- $client : StripeClient
- $messages : array<string|int, mixed>
- $mode : string
- $property : string
- $secret_key : string
- $service : AbstractService
Methods
- __call() : mixed
- Wrapper for Stripe API operations.
- __construct() : mixed
- get_wp_error() : WP_Error
- has_property() : mixed
- mode() : $this
- add_expanded_properties() : array<string|int, mixed>
- get_api_options() : array<string|int, mixed>
- get_error_message() : string
- parse_args() : array<string|int, mixed>
- prepare_request_args() : array<string|int, mixed>
- Prevents any unwanted arguments from being added to a Stripe request.
- sanitize_intent_params() : array<string|int, mixed>
Properties
$client
private
StripeClient
$client
$messages
private
array<string|int, mixed>
$messages
= []
$mode
private
string
$mode
$property
private
string
$property
$secret_key
private
string
$secret_key
$service
private
AbstractService
$service
Methods
__call()
Wrapper for Stripe API operations.
public
__call(string $method, array<string|int, mixed> $args) : mixed
This way, all exceptions can be caught gracefully.
Parameters
- $method : string
- $args : array<string|int, mixed>
Tags
__construct()
public
__construct(StripeClient $client, string $property[, string $secret_key = '' ][, string $mode = '' ]) : mixed
Parameters
- $client : StripeClient
- $property : string
- $secret_key : string = ''
- $mode : string = ''
Tags
get_wp_error()
public
get_wp_error(ApiErrorException $e[, string $code = 'stripe-error' ]) : WP_Error
Parameters
- $e : ApiErrorException
- $code : string = 'stripe-error'
Tags
Return values
WP_Errorhas_property()
public
has_property(mixed $key) : mixed
Parameters
- $key : mixed
mode()
public
mode(string $mode) : $this
Parameters
- $mode : string
Return values
$thisadd_expanded_properties()
private
add_expanded_properties(array<string|int, mixed> $params, array<string|int, mixed> $properties) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
- $properties : array<string|int, mixed>
Return values
array<string|int, mixed>get_api_options()
private
get_api_options() : array<string|int, mixed>
Return values
array<string|int, mixed>get_error_message()
private
get_error_message(mixed $err) : string
Parameters
- $err : mixed
Return values
stringparse_args()
private
parse_args(array<string|int, mixed> $args, string $method) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
- $method : string
Return values
array<string|int, mixed>prepare_request_args()
Prevents any unwanted arguments from being added to a Stripe request.
private
prepare_request_args(array<string|int, mixed> $args, string $method) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
- $method : string
Tags
Return values
array<string|int, mixed>sanitize_intent_params()
private
sanitize_intent_params(array<string|int, mixed> $params, string $method) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
- $method : string