PayPal message is hidden by the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the PayPal Messages implementation for next.js app:
import { COMPONENTS, DISABLE_FUNDING } from './PayPalBanner.constants'; import { PayPalBannerProps } from './PayPalBanner.types'; import styles from './PayPalBanner.module.scss'; export const PayPalBanner = ({ placement, layout, color, ratio, clientId, currency, }: PayPalBannerProps): JSX.Element => { const initialOptions = { 'client-id': clientId, currency, components: COMPONENTS, 'disable-funding': DISABLE_FUNDING, }; const messagesOptions = { placement, className: styles['paypal-banner'], style: { layout, color, ratio, }, }; return ( <PayPalScriptProvider options={initialOptions}> <PayPalMessages {...messagesOptions} /> </PayPalScriptProvider> ); };
When using "4x1" ratio, the scripts hide the Message with this warning in the console:
"paypal_messages_hidden {description: 'PayPal Message has been hidden. Message must be vi…of 0px x 0px. Current container is 160px x 448px.', index: '4', duration: 4969, timestamp: '1657708224321'}".
Basically, the script changes the iframe style to "opacity: 0 !important". If the container height is changed according to the height of the Message it solves the problem at first glance. But when you change the height of the browser (make it lower) the Message is hidden again on reload.
How to solve this problem? Thanks!

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Are there any restrictions to charge using only html, vanilla javascript and php with rest api? in REST APIs
- My form has recently stopped sending the quantity info direct to the paypal checkout page. in PayPal Payments Standard
- locale doesn't change language in SDKs
- Locale doesn't change language in PayPal Payments Standard
- Need help with copy/paste PayPal Button script not working in SDKs