StripeAPI
in package
Tags
Table of Contents
- API_VERSION = '2022-11-15'
- PARTNER_ID = 'pp_partner_Fs0jSMbknaJwVC'
- TRANSIENT_KEY_ACCOUNT_COUNTRY = 'mpa_stripe_account_country'
- $secretKey : string
- __construct() : mixed
- checkMinimumAmount() : bool
- Checks Stripe minimum amount value authorized per currency.
- convertToSmallestUnit() : int
- createPaymentIntent() : PaymentIntent|WP_Error
- getAccountCountry() : string
- getMinimumAmount() : float
- getPaymentIntent() : PaymentIntent|WP_Error
- getPaymentMethod() : PaymentMethod|WP_Error
- registerApp() : mixed
- updatePaymentIntentDescription() : true|WP_Error
Constants
API_VERSION
public
mixed
API_VERSION
= '2022-11-15'
Tags
PARTNER_ID
public
mixed
PARTNER_ID
= 'pp_partner_Fs0jSMbknaJwVC'
Tags
TRANSIENT_KEY_ACCOUNT_COUNTRY
public
mixed
TRANSIENT_KEY_ACCOUNT_COUNTRY
= 'mpa_stripe_account_country'
Tags
Properties
$secretKey
public
string
$secretKey
= ''
Tags
Methods
__construct()
public
__construct(string $secretKey) : mixed
Parameters
- $secretKey : string
Tags
Return values
mixed —checkMinimumAmount()
Checks Stripe minimum amount value authorized per currency.
public
checkMinimumAmount(float $amount, string $currency) : bool
Parameters
- $amount : float
- $currency : string
Tags
Return values
bool —convertToSmallestUnit()
public
convertToSmallestUnit(float $amount[, string $currency = null ]) : int
Parameters
- $amount : float
- $currency : string = null
-
Optional.
Tags
Return values
int —createPaymentIntent()
public
createPaymentIntent(array<string|int, mixed> $requestArgs) : PaymentIntent|WP_Error
Parameters
- $requestArgs : array<string|int, mixed>
Tags
Return values
PaymentIntent|WP_Error —Payment Intent or WP_Error.
getAccountCountry()
public
getAccountCountry() : string
Tags
Return values
string —two-letter account country code
getMinimumAmount()
public
getMinimumAmount(string $currency) : float
Parameters
- $currency : string
Tags
Return values
float —getPaymentIntent()
public
getPaymentIntent(string $paymentIntentId) : PaymentIntent|WP_Error
Parameters
- $paymentIntentId : string
Tags
Return values
PaymentIntent|WP_Error —getPaymentMethod()
public
getPaymentMethod(string $paymentMethodId) : PaymentMethod|WP_Error
Parameters
- $paymentMethodId : string
Tags
Return values
PaymentMethod|WP_Error —registerApp()
public
registerApp() : mixed
Tags
Return values
mixed —updatePaymentIntentDescription()
public
updatePaymentIntentDescription(PaymentIntent $paymentIntent, string $description) : true|WP_Error
Parameters
- $paymentIntent : PaymentIntent
- $description : string