StripePaymentGateway extends AbstractPaymentGateway
in package

Tags
since
1.5.0

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
since
1.5.0

$api

public StripeAPI $api = null
Tags
since
1.5.0

$checkoutLocale

public string $checkoutLocale = 'auto'
Tags
since
1.5.0

$id

Unprefixed payment gateway ID.

public string $id = 'stripe'
Tags
since
1.5.0

$paymentMethods

Enabled payment methods.

public array<string|int, string> $paymentMethods = array()
Tags
since
1.5.0

$publicKey

Public API key.

public string $publicKey = ''
Tags
since
1.5.0

$secretKey

Secret API key.

public string $secretKey = ''
Tags
since
1.5.0

$webhookKey

Webhook endpoint secret key.

public string $webhookKey = ''
Tags
since
1.5.0

$webhooks

public StripeWebhooksListener $webhooks = null
Tags
since
1.5.0

$accountCountry

protected string $accountCountry = ''
Tags
since
1.16.0

$description

Public description.

protected string $description = ''
Tags
since
1.5.0

$hasSandboxSupport

protected bool $hasSandboxSupport = true
Tags
since
1.5.0

$isEnabled

protected bool $isEnabled = false
Tags
since
1.5.0

$isInternal

If true, then don't show this payment gateway on the settings page.

protected bool $isInternal = false
Tags
since
1.5.0

$isSandbox

protected bool $isSandbox = false
Tags
since
1.5.0

$name

Gateway name (label) on the settings page.

protected string $name = 'Abstract Payment'
Tags
since
1.5.0

$publicName

Public name (label) shown on the frontend.

protected string $publicName = ''
Tags
since
1.5.0

Methods

__construct()

public __construct() : mixed
Tags
since
1.5.0
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
since
1.5.0
Return values
StripeAPI

getCheckoutLocales()

public getCheckoutLocales() : array<string|int, mixed>
Tags
since
1.5.0
see
https://stripe.com/docs/js/appendix/supported_locales
Return values
array<string|int, mixed>

[Locale => Locale title]

getDescription()

public getDescription() : string
Tags
since
1.5.0
Return values
string

getFields()

public getFields() : array<string|int, mixed>
Tags
since
1.5.0
Return values
array<string|int, mixed>

Raw field args.

getFrontendData()

public getFrontendData() : array<string|int, mixed>
Tags
since
1.5.0
Return values
array<string|int, mixed>

getId()

public getId() : string
Tags
since
1.5.0
Return values
string

getMode()

public getMode() : string
Tags
since
1.5.0
Return values
string

'live'|'sandbox'

getName()

public getName() : string
Tags
since
1.5.0
Return values
string

getPaymentMethods()

public getPaymentMethods() : array<string|int, mixed>
Tags
since
1.5.0
Return values
array<string|int, mixed>

[Payment method ID => Payment method name]

getPublicKey()

public getPublicKey() : string
Tags
since
1.5.0
Return values
string

getPublicName()

public getPublicName() : string
Tags
since
1.5.0
Return values
string

getSecretKey()

public getSecretKey() : string
Tags
since
1.5.0
Return values
string

getWebhookKey()

public getWebhookKey() : string
Tags
since
1.5.0
Return values
string

isActive()

public isActive() : bool
Tags
since
1.5.0
Return values
bool

isEnabled()

public isEnabled() : bool
Tags
since
1.5.0
Return values
bool

isInternal()

public isInternal() : bool
Tags
since
1.5.0
Return values
bool

If true, then don't show this payment gateway on the settings page.

isOnlinePayment()

public isOnlinePayment() : bool
Tags
since
1.14.0
Return values
bool

isSandbox()

public isSandbox() : bool
Tags
since
1.5.0
Return values
bool

Is sandbox enabled.

isSupportsSandbox()

public isSupportsSandbox() : bool
Tags
since
1.5.0
Return values
bool

preparePaymentIntent()

public preparePaymentIntent(Payment $payment, string $payment_method_id) : PaymentIntent|WP_Error
Parameters
$payment : Payment
$payment_method_id : string
Tags
since
1.14.0
see
PaymentsRestController::preparePayment()
Return values
PaymentIntent|WP_Error

Payment Intent or WP_Error.

printBillingFields()

public printBillingFields() : mixed
Tags
since
1.5.0
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
since
1.5.0

All payment process finish on front-end side. Payment status will set by received webhook. So return true or WP_Error for indicate about error.

Return values
bool|WP_Error

addListeners()

protected addListeners() : mixed
Tags
since
1.5.0
Return values
mixed

getAdminDescription()

protected getAdminDescription() : string
Tags
since
1.5.0
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
since
1.16.0
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
since
1.5.0
Return values
mixed

getOptionName()

protected getOptionName(string $option) : string
Parameters
$option : string
Tags
since
1.5.0
Return values
string

Prefixed option name.

getOptionNameRaw()

protected getOptionNameRaw(string $option) : string
Parameters
$option : string
Tags
since
1.5.0
Return values
string

Unprefixed option name.

getPaymentMethodName()

protected getPaymentMethodName(PaymentMethod $paymentMethod) : string
Parameters
$paymentMethod : PaymentMethod
Tags
since
1.16.0
Return values
string

isTranslatableOption()

protected isTranslatableOption(string $option) : bool
Parameters
$option : string
Tags
since
1.5.0
Return values
bool

setupProperties()

protected setupProperties() : mixed
Tags
since
1.5.0
Return values
mixed

transformWalletsToPaymentMethods()

protected transformWalletsToPaymentMethods(array<string|int, mixed> $paymentMethods) : array<string|int, mixed>
Parameters
$paymentMethods : array<string|int, mixed>
Tags
since
1.16.0

Converting wallets to a card payment method, because wallets are a variation of the 'card' payment method.

Return values
array<string|int, mixed>

Search results