Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
Overview
Versioning
Changelog
Upgrade your API version
Upgrade your SDK version
Essentials
SDKs
API
Testing
Stripe CLI
Sample projects
Tools
Workbench
Developers Dashboard
Stripe Shell
Stripe for Visual Studio Code
Features
Workflows
Event destinations
Stripe health alertsFile uploads
AI solutions
Agent toolkit
Security and privacy
Security
Privacy
Extend Stripe
Build Stripe apps
Use apps from Stripe
    Overview
    Stripe-built apps
    Adobe Commerce
      Cookbooks
        Add additional metadata to payments
        Add custom events to Stripe webhooks
        Add external payment methods to the payment form
        Disable shipping methods in the Express Checkout modals
        Enable manual capture
        Enable multicapture
        Enable overcapture
        Hide the terms displayed in the PaymentElement form
        Integrate a custom fee to the tax calculation
        Place an order before a 3D Secure payment is collected
        Style the payment form at the checkout
        Test why a specific payment method doesn't appear
      Payments and tax app for Adobe Commerce
      Standalone tax app for Adobe Commerce
    Cegid
    Commercetools
    Mirakl
    NetSuite
    Oracle Opera
    PrestaShop
    Salesforce
    SAP
    Shopware 6
    Stripe Tax for BigCommerce
    Stripe Tax for WooCommerce
    Partner apps
    Build your own app
Partners
Partner ecosystem
Partner certification
HomeDeveloper resourcesUse apps from StripeAdobe CommerceCookbooks

Hide the terms displayed in the PaymentElement form

Disable the terms text under the PaymentElement using a custom module.

Some payment methods inside the PaymentElement display terms relevant to their use. Use this guide to disable the terms text under the PaymentElement using a custom module.

See the API documentation for more information.

Create a new module

Create a new module with the following directory structure. Replace Vendor with your preferred vendor name.

app/code/Vendor/StripeCustomizations/ ├── etc/ │ ├── module.xml │ └── di.xml ├── Plugin/ │ └── Payments/ │ └── Service/ │ └── PaymentMethodOptionsServicePlugin.php ├── registration.php

Inside registration.php, register your module with Magento.

<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_StripeCustomizations', __DIR__ );

Inside etc/module.xml, define the module and set up dependencies to make sure it loads after the Stripe module.

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Vendor_StripeCustomizations" setup_version="1.0.0"> <sequence> <module name="StripeIntegration_Payments"/> </sequence> </module> </config>

Inside etc/di.xml, define the following plugin:

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="StripeIntegration\Payments\Service\PaymentMethodOptionsService"> <plugin name="vendor_stripecustomizations_payments_paymentmethodoptionsservice_plugin" type="Vendor\StripeCustomizations\Plugin\Payments\Service\PaymentMethodOptionsServicePlugin" sortOrder="10" disabled="false" /> </type> </config>

Inside Plugin/Payments/Service/PaymentMethodOptionsServicePlugin.php, create the plugin class:

<?php namespace Vendor\StripeCustomizations\Plugin\Payments\Service; use StripeIntegration\Payments\Service\PaymentMethodOptionsService; class PaymentMethodOptionsServicePlugin { /** * After plugin for getPaymentElementTerms method. * * @param PaymentMethodOptionsService $subject * @param array $result * @return array */ public function afterGetPaymentElementTerms(PaymentMethodOptionsService $subject, $result) { if (isset($result['paypal'])) { // Can be 'auto', 'always', or 'never'. We recommend against using 'auto' due to the usage of deferred intents in the module. $result['paypal'] = 'never'; } return $result; } }
Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc