include_frontend_files(); } } /** * This adds the Next Gen Stripe Gateway to the list of give_stripe_supported_payment_methods. * * If this is not included, then the webhooks will not be registered unless a legacy stripe gateway is enabled. * * @since 3.0.0 */ public function addToStripeSupportedPaymentMethodsList() { add_filter('give_stripe_supported_payment_methods', static function ($gateways) { $gatewayId = StripePaymentElementGateway::id(); if (!in_array($gatewayId, $gateways, true)) { $gateways[] = $gatewayId; } return $gateways; }); } /** * This adds the Stripe details to the donation details page. * * @since 3.0.0 */ public function addDonationDetails() { /** * Transaction ID link in donation details */ add_filter( sprintf('give_payment_details_transaction_id-%s', StripePaymentElementGateway::id()), 'give_stripe_link_transaction_id', 10, 2 ); /** * Displays the stripe account details on donation details page. */ add_action('give_view_donation_details_payment_meta_after', static function ($donationId) { /** @var Donation $donation */ $donation = Donation::find($donationId); if ($donation->gatewayId === StripePaymentElementGateway::id()) { $stripeAccounts = give_stripe_get_all_accounts(); $accountId = give_get_meta($donationId, '_give_stripe_account_slug', true); $accountDetail = $stripeAccounts[$accountId] ?? []; $account = 'connect' === $accountDetail['type'] ? "{$accountDetail['account_name']} ({$accountId})" : give_stripe_convert_slug_to_title($accountId); ?>