Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../wp-conte.../plugins/wpforms-.../src/Integrat.../Stripe
File: Process.php
* @return bool
[500] Fix | Delete
*/
[501] Fix | Delete
public function process_email( $process, $fields, $form_data, $notification_id ) {
[502] Fix | Delete
[503] Fix | Delete
if ( ! $process ) {
[504] Fix | Delete
return false;
[505] Fix | Delete
}
[506] Fix | Delete
[507] Fix | Delete
if ( ! Helpers::has_stripe_enabled( [ $form_data ] ) ) {
[508] Fix | Delete
return $process;
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
if ( empty( $form_data['settings']['notifications'][ $notification_id ]['stripe'] ) ) {
[512] Fix | Delete
return $process;
[513] Fix | Delete
}
[514] Fix | Delete
[515] Fix | Delete
if ( empty( $this->api->get_payment() ) ) {
[516] Fix | Delete
return false;
[517] Fix | Delete
}
[518] Fix | Delete
[519] Fix | Delete
if ( ! $this->is_payment_processed ) {
[520] Fix | Delete
return false;
[521] Fix | Delete
}
[522] Fix | Delete
[523] Fix | Delete
return empty( $this->api->get_error() );
[524] Fix | Delete
}
[525] Fix | Delete
[526] Fix | Delete
/**
[527] Fix | Delete
* Update entry details for a successful payment.
[528] Fix | Delete
*
[529] Fix | Delete
* @since 1.8.2
[530] Fix | Delete
*
[531] Fix | Delete
* @param array $fields Final/sanitized submitted field data.
[532] Fix | Delete
* @param array $entry Copy of original $_POST.
[533] Fix | Delete
* @param array $form_data Form data and settings.
[534] Fix | Delete
* @param string $entry_id Entry ID.
[535] Fix | Delete
*/
[536] Fix | Delete
public function process_entry_data( $fields, $entry, $form_data, $entry_id ) {
[537] Fix | Delete
[538] Fix | Delete
$payment = $this->api->get_payment();
[539] Fix | Delete
[540] Fix | Delete
if ( empty( $payment->id ) || empty( $entry_id ) ) {
[541] Fix | Delete
return;
[542] Fix | Delete
}
[543] Fix | Delete
[544] Fix | Delete
wpforms()->get( 'entry' )->update(
[545] Fix | Delete
$entry_id,
[546] Fix | Delete
[
[547] Fix | Delete
'type' => 'payment',
[548] Fix | Delete
],
[549] Fix | Delete
'',
[550] Fix | Delete
'',
[551] Fix | Delete
[ 'cap' => false ]
[552] Fix | Delete
);
[553] Fix | Delete
}
[554] Fix | Delete
[555] Fix | Delete
/**
[556] Fix | Delete
* Get general errors before payment processing.
[557] Fix | Delete
*
[558] Fix | Delete
* @since 1.8.2
[559] Fix | Delete
*
[560] Fix | Delete
* @return string
[561] Fix | Delete
*/
[562] Fix | Delete
protected function get_entry_errors() {
[563] Fix | Delete
[564] Fix | Delete
// Check for Stripe payment tokens (card token or payment id).
[565] Fix | Delete
$error = $this->api->get_error();
[566] Fix | Delete
[567] Fix | Delete
// Check for Stripe keys.
[568] Fix | Delete
if ( ! Helpers::has_stripe_keys() ) {
[569] Fix | Delete
return esc_html__( 'Stripe payment stopped, missing keys.', 'wpforms-lite' );
[570] Fix | Delete
}
[571] Fix | Delete
[572] Fix | Delete
// Check that, despite how the form is configured, the form and
[573] Fix | Delete
// entry actually contain payment fields, otherwise no need to proceed.
[574] Fix | Delete
if ( ! wpforms_has_payment( 'form', $this->form_data ) || ! wpforms_has_payment( 'entry', $this->fields ) ) {
[575] Fix | Delete
return esc_html__( 'Stripe payment stopped, missing payment fields.', 'wpforms-lite' );
[576] Fix | Delete
}
[577] Fix | Delete
[578] Fix | Delete
// Check total charge amount.
[579] Fix | Delete
if ( empty( $this->amount ) || wpforms_sanitize_amount( 0 ) === $this->amount ) {
[580] Fix | Delete
return esc_html__( 'Stripe payment stopped, invalid/empty amount.', 'wpforms-lite' );
[581] Fix | Delete
}
[582] Fix | Delete
[583] Fix | Delete
if ( 50 > ( $this->amount * 100 ) ) {
[584] Fix | Delete
return esc_html__( 'Stripe payment stopped, amount less than minimum charge required.', 'wpforms-lite' );
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
return $error;
[588] Fix | Delete
}
[589] Fix | Delete
[590] Fix | Delete
/**
[591] Fix | Delete
* Process a payment.
[592] Fix | Delete
*
[593] Fix | Delete
* @since 1.8.2
[594] Fix | Delete
*/
[595] Fix | Delete
public function process_payment() {
[596] Fix | Delete
[597] Fix | Delete
if ( $this->is_api_errors() ) {
[598] Fix | Delete
return;
[599] Fix | Delete
}
[600] Fix | Delete
[601] Fix | Delete
// Proceed to executing the purchase.
[602] Fix | Delete
if ( ! empty( $this->settings['enable_recurring'] ) || ! empty( $this->settings['recurring']['enable'] ) ) {
[603] Fix | Delete
$this->process_payment_subscription();
[604] Fix | Delete
[605] Fix | Delete
return;
[606] Fix | Delete
}
[607] Fix | Delete
[608] Fix | Delete
$this->process_payment_single();
[609] Fix | Delete
}
[610] Fix | Delete
[611] Fix | Delete
/**
[612] Fix | Delete
* Process a subscription payment for forms with old payments interface.
[613] Fix | Delete
*
[614] Fix | Delete
* @since 1.8.4
[615] Fix | Delete
*/
[616] Fix | Delete
protected function process_legacy_payment_subscription() {
[617] Fix | Delete
[618] Fix | Delete
if ( ! $this->is_recurring_settings_ok( $this->settings['recurring'] ) ) {
[619] Fix | Delete
return;
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
$args = $this->get_base_subscription_args();
[623] Fix | Delete
[624] Fix | Delete
$args['settings'] = $this->settings['recurring'];
[625] Fix | Delete
$args['email'] = sanitize_email( $this->fields[ $args['settings']['email'] ]['value'] );
[626] Fix | Delete
$args['customer_name'] = ! empty( $args['settings']['customer_name'] ) ? sanitize_text_field( $this->fields[ $args['settings']['customer_name'] ]['value'] ) : '';
[627] Fix | Delete
[628] Fix | Delete
// Customer address.
[629] Fix | Delete
if ( isset( $args['settings']['customer_address'] ) && $args['settings']['customer_address'] !== '' ) {
[630] Fix | Delete
$args['customer_address'] = $this->map_address_field( $this->fields[ $args['settings']['customer_address'] ], $args['settings']['customer_address'] );
[631] Fix | Delete
}
[632] Fix | Delete
[633] Fix | Delete
$this->process_subscription( $args );
[634] Fix | Delete
[635] Fix | Delete
// Set payment processing flag.
[636] Fix | Delete
$this->is_payment_processed = true;
[637] Fix | Delete
}
[638] Fix | Delete
[639] Fix | Delete
/**
[640] Fix | Delete
* Process a single payment.
[641] Fix | Delete
*
[642] Fix | Delete
* @since 1.8.2
[643] Fix | Delete
*/
[644] Fix | Delete
public function process_payment_single() {
[645] Fix | Delete
[646] Fix | Delete
$amount_decimals = Helpers::get_decimals_amount();
[647] Fix | Delete
[648] Fix | Delete
// Define the basic payment details.
[649] Fix | Delete
$args = [
[650] Fix | Delete
'amount' => $this->amount * $amount_decimals,
[651] Fix | Delete
'currency' => strtolower( wpforms_get_currency() ),
[652] Fix | Delete
'metadata' => [
[653] Fix | Delete
'form_name' => sanitize_text_field( $this->form_data['settings']['form_title'] ),
[654] Fix | Delete
'form_id' => $this->form_id,
[655] Fix | Delete
],
[656] Fix | Delete
];
[657] Fix | Delete
[658] Fix | Delete
if ( ! Helpers::is_license_ok() && Helpers::is_application_fee_supported() ) {
[659] Fix | Delete
$args['application_fee_amount'] = (int) ( round( $this->amount * 0.03, 2 ) * $amount_decimals );
[660] Fix | Delete
}
[661] Fix | Delete
[662] Fix | Delete
// Payment description.
[663] Fix | Delete
if ( ! empty( $this->settings['payment_description'] ) ) {
[664] Fix | Delete
$args['description'] = html_entity_decode( $this->settings['payment_description'], ENT_COMPAT, 'UTF-8' );
[665] Fix | Delete
}
[666] Fix | Delete
[667] Fix | Delete
// Receipt email.
[668] Fix | Delete
if ( isset( $this->settings['receipt_email'] ) && $this->settings['receipt_email'] !== '' && ! empty( $this->fields[ $this->settings['receipt_email'] ]['value'] ) ) {
[669] Fix | Delete
$args['receipt_email'] = sanitize_email( $this->fields[ $this->settings['receipt_email'] ]['value'] );
[670] Fix | Delete
}
[671] Fix | Delete
[672] Fix | Delete
// Customer email.
[673] Fix | Delete
if ( isset( $this->settings['customer_email'] ) && $this->settings['customer_email'] !== '' && ! empty( $this->fields[ $this->settings['customer_email'] ]['value'] ) ) {
[674] Fix | Delete
$args['customer_email'] = sanitize_email( $this->fields[ $this->settings['customer_email'] ]['value'] );
[675] Fix | Delete
}
[676] Fix | Delete
[677] Fix | Delete
// Customer name.
[678] Fix | Delete
if ( isset( $this->settings['customer_name'] ) && $this->settings['customer_name'] !== '' && ! empty( $this->fields[ $this->settings['customer_name'] ]['value'] ) ) {
[679] Fix | Delete
$args['customer_name'] = sanitize_text_field( $this->fields[ $this->settings['customer_name'] ]['value'] );
[680] Fix | Delete
}
[681] Fix | Delete
[682] Fix | Delete
// Customer address.
[683] Fix | Delete
if ( isset( $this->settings['customer_address'] ) && $this->settings['customer_address'] !== '' ) {
[684] Fix | Delete
$args['customer_address'] = $this->map_address_field( $this->fields[ $this->settings['customer_address'] ], $this->settings['customer_address'] );
[685] Fix | Delete
}
[686] Fix | Delete
[687] Fix | Delete
// Shipping address.
[688] Fix | Delete
if ( isset( $this->settings['shipping_address'] ) && $this->settings['shipping_address'] !== '' ) {
[689] Fix | Delete
$args['shipping']['name'] = $args['customer_name'] ?? '';
[690] Fix | Delete
$args['shipping']['address'] = $this->map_address_field( $this->fields[ $this->settings['shipping_address'] ], $this->settings['shipping_address'] );
[691] Fix | Delete
}
[692] Fix | Delete
[693] Fix | Delete
$this->api->process_single( $args );
[694] Fix | Delete
[695] Fix | Delete
// Set payment processing flag.
[696] Fix | Delete
$this->is_payment_processed = true;
[697] Fix | Delete
[698] Fix | Delete
$this->update_credit_card_field_value();
[699] Fix | Delete
[700] Fix | Delete
$this->process_api_error( 'single' );
[701] Fix | Delete
}
[702] Fix | Delete
[703] Fix | Delete
/**
[704] Fix | Delete
* Process a subscription payment.
[705] Fix | Delete
*
[706] Fix | Delete
* @since 1.8.2
[707] Fix | Delete
*/
[708] Fix | Delete
public function process_payment_subscription() {
[709] Fix | Delete
[710] Fix | Delete
if ( Helpers::is_legacy_payment_settings( $this->form_data ) ) {
[711] Fix | Delete
$this->process_legacy_payment_subscription();
[712] Fix | Delete
[713] Fix | Delete
return;
[714] Fix | Delete
}
[715] Fix | Delete
[716] Fix | Delete
$args = $this->get_base_subscription_args();
[717] Fix | Delete
[718] Fix | Delete
foreach ( $this->settings['recurring'] as $recurring ) {
[719] Fix | Delete
[720] Fix | Delete
if ( ! $this->is_subscription_plan_valid( $recurring ) ) {
[721] Fix | Delete
continue;
[722] Fix | Delete
}
[723] Fix | Delete
[724] Fix | Delete
$args['email'] = sanitize_email( $this->fields[ $recurring['email'] ]['value'] );
[725] Fix | Delete
$args['settings'] = $recurring;
[726] Fix | Delete
[727] Fix | Delete
// Customer name.
[728] Fix | Delete
if ( isset( $recurring['customer_name'] ) && $recurring['customer_name'] !== '' && ! empty( $this->fields[ $recurring['customer_name'] ]['value'] ) ) {
[729] Fix | Delete
$args['customer_name'] = sanitize_text_field( $this->fields[ $recurring['customer_name'] ]['value'] );
[730] Fix | Delete
}
[731] Fix | Delete
[732] Fix | Delete
// Customer address.
[733] Fix | Delete
if ( isset( $recurring['customer_address'] ) && $recurring['customer_address'] !== '' ) {
[734] Fix | Delete
$args['customer_address'] = $this->map_address_field( $this->fields[ $recurring['customer_address'] ], $recurring['customer_address'] );
[735] Fix | Delete
}
[736] Fix | Delete
[737] Fix | Delete
$this->process_subscription( $args );
[738] Fix | Delete
[739] Fix | Delete
return;
[740] Fix | Delete
}
[741] Fix | Delete
[742] Fix | Delete
if ( ! empty( $this->settings['enable_one_time'] ) ) {
[743] Fix | Delete
$this->process_payment_single();
[744] Fix | Delete
[745] Fix | Delete
return;
[746] Fix | Delete
}
[747] Fix | Delete
[748] Fix | Delete
$this->log_error(
[749] Fix | Delete
esc_html__( 'Stripe Subscription payment stopped validation error.', 'wpforms-lite' ),
[750] Fix | Delete
$this->fields,
[751] Fix | Delete
'conditional_logic'
[752] Fix | Delete
);
[753] Fix | Delete
}
[754] Fix | Delete
[755] Fix | Delete
/**
[756] Fix | Delete
* Validate plan before process.
[757] Fix | Delete
*
[758] Fix | Delete
* @since 1.8.4
[759] Fix | Delete
*
[760] Fix | Delete
* @param array $plan Plan settings.
[761] Fix | Delete
*
[762] Fix | Delete
* @return bool
[763] Fix | Delete
*/
[764] Fix | Delete
protected function is_subscription_plan_valid( $plan ) {
[765] Fix | Delete
[766] Fix | Delete
return ! empty( $plan['email'] ) && $this->is_recurring_settings_ok( $plan );
[767] Fix | Delete
}
[768] Fix | Delete
[769] Fix | Delete
/**
[770] Fix | Delete
* Update the credit card field value to contain basic details.
[771] Fix | Delete
*
[772] Fix | Delete
* @since 1.8.2
[773] Fix | Delete
*/
[774] Fix | Delete
public function update_credit_card_field_value() {
[775] Fix | Delete
[776] Fix | Delete
foreach ( $this->fields as $field_id => $field ) {
[777] Fix | Delete
[778] Fix | Delete
if ( empty( $field['type'] ) || $this->api->get_config( 'field_slug' ) !== $field['type'] ) {
[779] Fix | Delete
continue;
[780] Fix | Delete
}
[781] Fix | Delete
[782] Fix | Delete
$details = $this->api->get_charge_details( [ 'name', 'last4', 'brand' ] );
[783] Fix | Delete
[784] Fix | Delete
if ( ! empty( $details['last4'] ) ) {
[785] Fix | Delete
$details['last4'] = 'xxxx xxxx xxxx ' . $details['last4'];
[786] Fix | Delete
}
[787] Fix | Delete
[788] Fix | Delete
if ( ! empty( $details['brand'] ) ) {
[789] Fix | Delete
$details['brand'] = ucfirst( $details['brand'] );
[790] Fix | Delete
}
[791] Fix | Delete
[792] Fix | Delete
$details = is_array( $details ) && ! empty( $details ) ? implode( "\n", array_filter( $details ) ) : '-';
[793] Fix | Delete
[794] Fix | Delete
/**
[795] Fix | Delete
* This filter allows to overwrite a Style Credit Card value in saved entry.
[796] Fix | Delete
*
[797] Fix | Delete
* @since 1.8.2
[798] Fix | Delete
*
[799] Fix | Delete
* @param array $details Card details.
[800] Fix | Delete
* @param object $payment Stripe payment objects.
[801] Fix | Delete
*/
[802] Fix | Delete
wpforms()->get( 'process' )->fields[ $field_id ]['value'] = apply_filters( 'wpforms_stripe_creditcard_value', $details, $this->api->get_payment() ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
[803] Fix | Delete
}
[804] Fix | Delete
}
[805] Fix | Delete
[806] Fix | Delete
/**
[807] Fix | Delete
* Check if there is at least one visible (not hidden by conditional logic) card field in the form.
[808] Fix | Delete
*
[809] Fix | Delete
* @since 1.8.2
[810] Fix | Delete
*/
[811] Fix | Delete
protected function is_card_field_visibility_ok() {
[812] Fix | Delete
[813] Fix | Delete
// If the form contains no fields with conditional logic the card field is visible by default.
[814] Fix | Delete
if ( empty( $this->form_data['conditional_fields'] ) ) {
[815] Fix | Delete
return true;
[816] Fix | Delete
}
[817] Fix | Delete
[818] Fix | Delete
foreach ( $this->fields as $field ) {
[819] Fix | Delete
[820] Fix | Delete
if ( empty( $field['type'] ) || $this->api->get_config( 'field_slug' ) !== $field['type'] ) {
[821] Fix | Delete
continue;
[822] Fix | Delete
}
[823] Fix | Delete
[824] Fix | Delete
// if the field is NOT in array of conditional fields, it's visible.
[825] Fix | Delete
if ( ! in_array( $field['id'], $this->form_data['conditional_fields'], true ) ) {
[826] Fix | Delete
return true;
[827] Fix | Delete
}
[828] Fix | Delete
[829] Fix | Delete
// if the field IS in array of conditional fields and marked as visible, it's visible.
[830] Fix | Delete
if ( ! empty( $field['visible'] ) ) {
[831] Fix | Delete
return true;
[832] Fix | Delete
}
[833] Fix | Delete
}
[834] Fix | Delete
[835] Fix | Delete
return false;
[836] Fix | Delete
}
[837] Fix | Delete
[838] Fix | Delete
/**
[839] Fix | Delete
* Log payment error.
[840] Fix | Delete
*
[841] Fix | Delete
* @since 1.8.2
[842] Fix | Delete
*
[843] Fix | Delete
* @param string $title Error title.
[844] Fix | Delete
* @param string $message Error message.
[845] Fix | Delete
* @param string $level Error level to add to 'payment' error level.
[846] Fix | Delete
*/
[847] Fix | Delete
protected function log_error( $title, $message = '', $level = 'error' ) {
[848] Fix | Delete
[849] Fix | Delete
if ( $message instanceof ApiErrorException ) {
[850] Fix | Delete
$body = $message->getJsonBody();
[851] Fix | Delete
$message = isset( $body['error']['message'] ) ? $body['error'] : $message->getMessage();
[852] Fix | Delete
}
[853] Fix | Delete
[854] Fix | Delete
wpforms_log(
[855] Fix | Delete
$title,
[856] Fix | Delete
$message,
[857] Fix | Delete
[
[858] Fix | Delete
'type' => [ 'payment', $level ],
[859] Fix | Delete
'form_id' => $this->form_id,
[860] Fix | Delete
]
[861] Fix | Delete
);
[862] Fix | Delete
}
[863] Fix | Delete
[864] Fix | Delete
/**
[865] Fix | Delete
* Collect errors from API and turn it into form errors.
[866] Fix | Delete
*
[867] Fix | Delete
* @since 1.8.2
[868] Fix | Delete
*
[869] Fix | Delete
* @param string $type Payment time (e.g. 'single' or 'subscription').
[870] Fix | Delete
*/
[871] Fix | Delete
protected function process_api_error( $type ) {
[872] Fix | Delete
[873] Fix | Delete
$message = $this->api->get_error();
[874] Fix | Delete
[875] Fix | Delete
if ( empty( $message ) ) {
[876] Fix | Delete
return;
[877] Fix | Delete
}
[878] Fix | Delete
[879] Fix | Delete
$message = sprintf(
[880] Fix | Delete
/* translators: %s - error message. */
[881] Fix | Delete
esc_html__( 'Payment Error: %s', 'wpforms-lite' ),
[882] Fix | Delete
$message
[883] Fix | Delete
);
[884] Fix | Delete
[885] Fix | Delete
$this->display_error( $message );
[886] Fix | Delete
[887] Fix | Delete
if ( $type === 'subscription' ) {
[888] Fix | Delete
$title = esc_html__( 'Stripe subscription payment stopped by error', 'wpforms-lite' );
[889] Fix | Delete
} else {
[890] Fix | Delete
$title = esc_html__( 'Stripe payment stopped by error', 'wpforms-lite' );
[891] Fix | Delete
}
[892] Fix | Delete
[893] Fix | Delete
$this->log_error( $title, $this->api->get_exception() );
[894] Fix | Delete
}
[895] Fix | Delete
[896] Fix | Delete
/**
[897] Fix | Delete
* Display form error.
[898] Fix | Delete
*
[899] Fix | Delete
* @since 1.8.2
[900] Fix | Delete
*
[901] Fix | Delete
* @param string $error Error to display.
[902] Fix | Delete
*/
[903] Fix | Delete
private function display_error( $error ) {
[904] Fix | Delete
[905] Fix | Delete
if ( ! $error ) {
[906] Fix | Delete
return;
[907] Fix | Delete
}
[908] Fix | Delete
[909] Fix | Delete
$field_slug = $this->api->get_config( 'field_slug' );
[910] Fix | Delete
[911] Fix | Delete
// Check if the form contains a required credit card. If it does
[912] Fix | Delete
// and there was an error, return the error to the user and prevent
[913] Fix | Delete
// the form from being submitted. This should not occur under normal
[914] Fix | Delete
// circumstances.
[915] Fix | Delete
foreach ( $this->form_data['fields'] as $field ) {
[916] Fix | Delete
[917] Fix | Delete
if ( empty( $field['type'] ) || $field_slug !== $field['type'] ) {
[918] Fix | Delete
continue;
[919] Fix | Delete
}
[920] Fix | Delete
[921] Fix | Delete
if ( ! empty( $field['required'] ) ) {
[922] Fix | Delete
wpforms()->get( 'process' )->errors[ $this->form_id ]['footer'] = $error;
[923] Fix | Delete
[924] Fix | Delete
return;
[925] Fix | Delete
}
[926] Fix | Delete
}
[927] Fix | Delete
}
[928] Fix | Delete
[929] Fix | Delete
/**
[930] Fix | Delete
* Process card error from Stripe API exception and adds rate limit tracking.
[931] Fix | Delete
*
[932] Fix | Delete
* @since 1.8.2
[933] Fix | Delete
*
[934] Fix | Delete
* @param ApiErrorException $e Stripe API exception to process.
[935] Fix | Delete
*/
[936] Fix | Delete
public function process_card_error( $e ) {
[937] Fix | Delete
[938] Fix | Delete
if ( Helpers::get_stripe_mode() === 'test' ) {
[939] Fix | Delete
return;
[940] Fix | Delete
}
[941] Fix | Delete
[942] Fix | Delete
if ( ! is_a( $e, '\WPForms\Vendor\Stripe\Exception\CardException' ) ) {
[943] Fix | Delete
return;
[944] Fix | Delete
}
[945] Fix | Delete
[946] Fix | Delete
/**
[947] Fix | Delete
* Allow to filter Stripe process card error.
[948] Fix | Delete
*
[949] Fix | Delete
* @since 1.8.2
[950] Fix | Delete
*
[951] Fix | Delete
* @param bool $flag True if any error.
[952] Fix | Delete
*/
[953] Fix | Delete
if ( ! apply_filters( 'wpforms_stripe_process_process_card_error', true ) ) { // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
[954] Fix | Delete
return;
[955] Fix | Delete
}
[956] Fix | Delete
[957] Fix | Delete
$this->rate_limit->increment_attempts();
[958] Fix | Delete
}
[959] Fix | Delete
[960] Fix | Delete
/**
[961] Fix | Delete
* Check if rate limit is under threshold and passes.
[962] Fix | Delete
*
[963] Fix | Delete
* @since 1.8.2
[964] Fix | Delete
*/
[965] Fix | Delete
protected function is_rate_limit_ok() {
[966] Fix | Delete
[967] Fix | Delete
return $this->rate_limit->is_ok();
[968] Fix | Delete
}
[969] Fix | Delete
[970] Fix | Delete
/**
[971] Fix | Delete
* Check if any API errors occurs.
[972] Fix | Delete
*
[973] Fix | Delete
* @since 1.8.4
[974] Fix | Delete
*
[975] Fix | Delete
* @return bool
[976] Fix | Delete
*/
[977] Fix | Delete
protected function is_api_errors() {
[978] Fix | Delete
[979] Fix | Delete
$this->api->setup_stripe();
[980] Fix | Delete
[981] Fix | Delete
$error = $this->api->get_error();
[982] Fix | Delete
[983] Fix | Delete
if ( $error ) {
[984] Fix | Delete
$this->process_api_error( 'general' );
[985] Fix | Delete
[986] Fix | Delete
return true;
[987] Fix | Delete
}
[988] Fix | Delete
[989] Fix | Delete
return false;
[990] Fix | Delete
}
[991] Fix | Delete
[992] Fix | Delete
/**
[993] Fix | Delete
* Check if recurring settings is configured correctly.
[994] Fix | Delete
*
[995] Fix | Delete
* @since 1.8.4
[996] Fix | Delete
*
[997] Fix | Delete
* @param {array} $settings Settings data.
[998] Fix | Delete
*
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function