Paypal Pay later message is not showing for specific domain

sumeet_galaxy
Contributor
Contributor

On a simple HTML page, Paypal Pay later message is not showing for specific domains. This is the simple code -

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <meta charset="utf-8">
    <title>test popular products</title>
    <script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
<body>
<?php
ini_set('display_error',1);
error_reporting();
?>Test
<div id="pp-pay-later-message"></div>
</body>
</html>

<script src="https://www.paypal.com/sdk/js?client-id=abc-xyz&components=messages"></script>
<script>$(document).ready( function() { 

    var price = $(".product-info-price .price").text();
    var newPrice = price.replace('£', '').replace('€','');
    var productPrice = parseFloat(newPrice);
    // console.log(productPrice);
    paypal
      .Messages({
        amount: productPrice,
        style: {
          layout: "text",
          logo: {
            type: "primary",
          },
        },
      })
    .render("#pp-pay-later-message");

    jQuery("#product-options-wrapper select").on('change', function() {
    setTimeout(function(){  
    var price = jQuery(".product-info-price .price").text();
    var newPrice = price.replace('£', '');
    var productPrice = parseFloat(newPrice);
    // console.log(productPrice);
    paypal
      .Messages({
        amount: productPrice,
        style: {
          layout: "text",
          logo: {
            type: "primary",
          },
        },
      })
      .render("#pp-pay-later-message");
    }, 500); 
   }); 
});</script>

But it is working fine in my localhost and in other domains but not for a specific domain. What will be the reason for not working for a specific domain?

 

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.