accountDetailRepository = $accountDetailRepository; $this->settings = $settings; $this->connectClient = $connectClient; } /** * @since 2.13.0 */ private function setUpProperties() { global $post; $this->stripeAccounts = $this->settings->getAllStripeAccounts(); $this->defaultStripeAccountSlug = $this->isGlobalSettingPage() ? $this->settings->getDefaultStripeAccountSlug() : $this->settings->getDefaultStripeAccountSlugForDonationForm($post->ID); } /** * Render Stripe account manager setting field. * * @since 2.13.0 * * @param array $field */ public function handle($field) { $this->setUpProperties(); $classes = ! empty($field['wrapper_class']) ? esc_attr($field['wrapper_class']) : '' ?>
getIntroductionSectionMarkup(); ?>

getStripeAccountListSectionMarkup(); $this->getAddNewStripeAccountSectionMarkup(); ?>
getDefaultStripeAccountNotice(); ?>
isGlobalSettingPage()) { return; } ?>

Stripe documentation for more information.', 'give'), 'https://docs.givewp.com/stripe-fees' ); ?>


getStripeAccountOnBoardingModalMarkup(); if ( ! $this->stripeAccounts || ( ! $this->isGlobalSettingPage() && 1 === count($this->stripeAccounts))) : $this->getNoStripeAccountMarkup(); return; endif; ?>
stripeAccounts as $stripeAccountDetails) { $this->getStripeAccountMarkup($stripeAccountDetails); } ?>
canShowCompatibilityNotice()) { $this->getCompatibilityNoticeMarkup(); return; } ?>

getStripeConnectButtonMarkup(); // Check if premium is active. if (give_stripe_is_premium_active()) { /** * This action hook will be used to load Manual API fields for premium addon. * * @since 2.7.0 * * @param array $stripeAccounts All Stripe accounts. * */ do_action('give_stripe_premium_manual_api_fields', $this->stripeAccounts); } ?>
isGlobalDefaultStripeAccount($stripeAccountSlug)) { return; } $disconnectUrl = esc_url_raw(add_query_arg( [ 'account_type' => $stripeAccount['type'], 'action' => 'disconnect_stripe_account', 'account_slug' => $stripeAccountSlug, ], wp_nonce_url(admin_url('admin-ajax.php'), 'give_disconnect_connected_stripe_account_' . $stripeAccountSlug) )); $editStatementDescriptorUrl = esc_url_raw(add_query_arg( [ 'action' => 'edit_stripe_account_statement_descriptor', 'account-slug' => $stripeAccountSlug, ], admin_url('admin-ajax.php') )); $classes = $stripeAccountSlug === $this->defaultStripeAccountSlug ? ' give-stripe-boxshadow-option-wrap__selected' : ''; ?>
defaultStripeAccountSlug) : ?>
%s', 'https://stripe.com/docs/statement-descriptors#requirements', Give()->tooltips->render_help([ 'label' => esc_html__( 'This is the text that appears on your donor\'s bank statements. This is typically the name of your website or organization. Click on this icon to read more about Stripe statement text requirements.', 'give' ), 'size' => 'medium', ] ) ); ?>
isGlobalSettingPage()): ?>
stripeAccounts, $this->defaultStripeAccountSlug ); if ($stripeAccountActionsHtml) { printf( '
%s
', $stripeAccountActionsHtml ); } ?>
defaultStripeAccountSlug) : ?>
isGlobalSettingPage() ? admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways§ion=stripe-settings') : admin_url("post.php?post=$post->ID&action=edit&give_tab=stripe_form_account_options"); $modal_title = sprintf( '%1$s', esc_html__( 'You are connected! Now this is important: Please configure your Stripe webhook to finalize the setup.', 'give' ) ); $modal_first_detail = sprintf( '%1$s %2$s', esc_html__( 'In order for Stripe to function properly, you must add a new Stripe webhook endpoint. To do this please visit the Webhooks Section of your Stripe Dashboard and click the Add endpoint button and paste the following URL:', 'give' ), "{$site_url}?give-listener=stripe" ); $modal_second_detail = esc_html__( 'Stripe webhooks are required so GiveWP can communicate properly with the payment gateway to confirm payment completion, renewals, and more.', 'give' ); $can_display = ! empty($_GET['stripe_account']) ? '0' : '1'; ?>
notices->print_admin_notices( [ 'description' => sprintf( '%1$s %3$s %4$s', esc_html__( 'Give 2.7.0 introduces the ability to connect a single site to multiple Stripe accounts. To use this feature, you need to complete database updates. ', 'give' ), esc_url(admin_url('edit.php?post_type=give_forms&page=give-updates')), esc_html__('Click here', 'give'), esc_html__('to complete your pending database updates.', 'give') ), 'dismissible' => false, ] ); ?>

isGlobalSettingPage() ? esc_html__('No Stripe Accounts Connected', 'give') : esc_html__('Connect a New Stripe Account', 'give'); ?>

isGlobalSettingPage() ? esc_html__('Connect an account to get started!', 'give') : esc_html__( 'Add a new account to customize the Stripe account used for this donation form.', 'give' ) ?>

getStripeConnectButtonMarkup(); ?>
'connect', 'mode' => give_is_test_mode() ? 'test' : 'live', 'return_url' => ! $this->isGlobalSettingPage() ? rawurlencode( sprintf( admin_url('post.php?post=%d&action=edit&give_tab=stripe_form_account_options'), get_the_ID() ) ) : rawurlencode( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways§ion=stripe-settings' ) ), 'website_url' => get_bloginfo('url'), 'give_stripe_connected' => '0', ], esc_url_raw($this->connectClient->getApiUrl('stripe/connect.php')) ); $stripeSvgIcon = ' '; return sprintf( '%2$s', esc_url($link), esc_html__('Connect with Stripe', 'give'), $stripeSvgIcon ); } /** * @since 2.13.0 */ private function getDefaultStripeAccountNotice() { ?>

isGlobalSettingPage() ? esc_html__( 'You can set this globally (for all donation forms) or override the Stripe account per donation form.', 'give' ) : esc_html__('This overrides the global default account setting for this donation form.', 'give'); ?>

isGlobalSettingPage() && $globalDefaultStripeAccountDetail['account_slug'] === $accountSlug; } }