StripePaymentGateway
extends AbstractPaymentGateway
in package
Tags
Table of Contents
- $allowedMethods : array<string|int, string>
- Equals to <code>$paymentMethods</code> property if the currency is euro, [] or ['card'] otherwise.
- $api : StripeAPI
- $checkoutLocale : string
- $id : string
- Unprefixed payment gateway ID.
- $paymentMethods : array<string|int, string>
- Enabled payment methods.
- $publicKey : string
- Public API key.
- $secretKey : string
- Secret API key.
- $webhookKey : string
- Webhook endpoint secret key.
- $webhooks : StripeWebhooksListener
- $accountCountry : string
- $description : string
- Public description.
- $hasSandboxSupport : bool
- $isEnabled : bool
- $isInternal : bool
- If true, then don't show this payment gateway on the settings page.
- $isSandbox : bool
- $name : string
- Gateway name (label) on the settings page.
- $publicName : string
- Public name (label) shown on the frontend.
- __construct() : mixed
- enqueueScripts() : void
- An empty method is provided to add wp_enqueue_script() handlers of each of the payment methods, if necessary.
- getApi() : StripeAPI
- getCheckoutLocales() : array<string|int, mixed>
- getDescription() : string
- getFields() : array<string|int, mixed>
- getFrontendData() : array<string|int, mixed>
- getId() : string
- getMode() : string
- getName() : string
- getPaymentMethods() : array<string|int, mixed>
- getPublicKey() : string
- getPublicName() : string
- getSecretKey() : string
- getWebhookKey() : string
- isActive() : bool
- isEnabled() : bool
- isInternal() : bool
- isOnlinePayment() : bool
- isSandbox() : bool
- isSupportsSandbox() : bool
- preparePaymentIntent() : PaymentIntent|WP_Error
- printBillingFields() : mixed
- processPayment() : bool|WP_Error
- addListeners() : mixed
- getAdminDescription() : string
- getAllowedMethods() : array<string|int, mixed>|array<string|int, string>
- getOption() : mixed
- getOptionName() : string
- getOptionNameRaw() : string
- getPaymentMethodName() : string
- isTranslatableOption() : bool
- setupProperties() : mixed
- transformWalletsToPaymentMethods() : array<string|int, mixed>
Properties
$allowedMethods
Equals to <code>$paymentMethods</code> property if the currency is euro, [] or ['card'] otherwise.
public
array<string|int, string>
$allowedMethods
= array()
Tags
$api
public
StripeAPI
$api
= null
Tags
$checkoutLocale
public
string
$checkoutLocale
= 'auto'
Tags
$id
Unprefixed payment gateway ID.
public
string
$id
= 'stripe'
Tags
$paymentMethods
Enabled payment methods.
public
array<string|int, string>
$paymentMethods
= array()
Tags
$publicKey
Public API key.
public
string
$publicKey
= ''
Tags
$secretKey
Secret API key.
public
string
$secretKey
= ''
Tags
$webhookKey
Webhook endpoint secret key.
public
string
$webhookKey
= ''
Tags
$webhooks
public
StripeWebhooksListener
$webhooks
= null
Tags
$accountCountry
protected
string
$accountCountry
= ''
Tags
$description
Public description.
protected
string
$description
= ''
Tags
$hasSandboxSupport
protected
bool
$hasSandboxSupport
= true
Tags
$isEnabled
protected
bool
$isEnabled
= false
Tags
$isInternal
If true, then don't show this payment gateway on the settings page.
protected
bool
$isInternal
= false
Tags
$isSandbox
protected
bool
$isSandbox
= false
Tags
$name
Gateway name (label) on the settings page.
protected
string
$name
= 'Abstract Payment'
Tags
$publicName
Public name (label) shown on the frontend.
protected
string
$publicName
= ''
Tags
Methods
__construct()
public
__construct() : mixed
Tags
Return values
mixed —enqueueScripts()
An empty method is provided to add wp_enqueue_script() handlers of each of the payment methods, if necessary.
public
enqueueScripts() : void
Return values
void —getApi()
public
getApi() : StripeAPI
Tags
Return values
StripeAPI —getCheckoutLocales()
public
getCheckoutLocales() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —[Locale => Locale title]
getDescription()
public
getDescription() : string
Tags
Return values
string —getFields()
public
getFields() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Raw field args.
getFrontendData()
public
getFrontendData() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getId()
public
getId() : string
Tags
Return values
string —getMode()
public
getMode() : string
Tags
Return values
string —'live'|'sandbox'
getName()
public
getName() : string
Tags
Return values
string —getPaymentMethods()
public
getPaymentMethods() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —[Payment method ID => Payment method name]
getPublicKey()
public
getPublicKey() : string
Tags
Return values
string —getPublicName()
public
getPublicName() : string
Tags
Return values
string —getSecretKey()
public
getSecretKey() : string
Tags
Return values
string —getWebhookKey()
public
getWebhookKey() : string
Tags
Return values
string —isActive()
public
isActive() : bool
Tags
Return values
bool —isEnabled()
public
isEnabled() : bool
Tags
Return values
bool —isInternal()
public
isInternal() : bool
Tags
Return values
bool —If true, then don't show this payment gateway on the settings page.
isOnlinePayment()
public
isOnlinePayment() : bool
Tags
Return values
bool —isSandbox()
public
isSandbox() : bool
Tags
Return values
bool —Is sandbox enabled.
isSupportsSandbox()
public
isSupportsSandbox() : bool
Tags
Return values
bool —preparePaymentIntent()
public
preparePaymentIntent(Payment $payment, string $payment_method_id) : PaymentIntent|WP_Error
Parameters
- $payment : Payment
- $payment_method_id : string
Tags
Return values
PaymentIntent|WP_Error —Payment Intent or WP_Error.
printBillingFields()
public
printBillingFields() : mixed
Tags
Return values
mixed —processPayment()
public
processPayment(Payment $payment, array<string|int, mixed> $args) : bool|WP_Error
Parameters
- $payment : Payment
- $args : array<string|int, mixed>
Tags
Return values
bool|WP_Error —addListeners()
protected
addListeners() : mixed
Tags
Return values
mixed —getAdminDescription()
protected
getAdminDescription() : string
Tags
Return values
string —Payment gateway description on the top of the page, before the first field.
getAllowedMethods()
protected
getAllowedMethods(array<string|int, mixed> $paymentMethods) : array<string|int, mixed>|array<string|int, string>
Parameters
- $paymentMethods : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>|array<string|int, string> —getOption()
protected
getOption(string $option[, mixed $default = '' ]) : mixed
Parameters
- $option : string
- $default : mixed = ''
-
Optional. '' by default.
Tags
Return values
mixed —getOptionName()
protected
getOptionName(string $option) : string
Parameters
- $option : string
Tags
Return values
string —Prefixed option name.
getOptionNameRaw()
protected
getOptionNameRaw(string $option) : string
Parameters
- $option : string
Tags
Return values
string —Unprefixed option name.
getPaymentMethodName()
protected
getPaymentMethodName(PaymentMethod $paymentMethod) : string
Parameters
- $paymentMethod : PaymentMethod
Tags
Return values
string —isTranslatableOption()
protected
isTranslatableOption(string $option) : bool
Parameters
- $option : string
Tags
Return values
bool —setupProperties()
protected
setupProperties() : mixed
Tags
Return values
mixed —transformWalletsToPaymentMethods()
protected
transformWalletsToPaymentMethods(array<string|int, mixed> $paymentMethods) : array<string|int, mixed>
Parameters
- $paymentMethods : array<string|int, mixed>