Search code examples
paypalpaypal-sandbox

Make a custom "Log In with PayPal button"


I have Successfully Integrate "Log In with PayPal" Functionality in my Application. I have used the below code to generate button and functionality.

<p><span id="myContainers"></span></p>

        <script src="https://www.paypalobjects.com/js/external/api.js"></script>
        <script>
        paypal.use( ["login"], function(login) {
          login.render ({
            "appid": "{{App_id}}",
            "authend": "sandbox",
            "scopes": "profile email address phone https://uri.paypal.com/services/paypalattributes",
            "containerid": "myContainers",
            "locale": "en-us",
            "returnurl": "http://localhost/test/paypal_login_2/result.php"
          });
        });
        </script>

And I am getting below output

paypal button image

I Don't want this default "log in with PayPal button". Instead of it, I want a normal link.

I researched about it but not get any success. please share, if anybody did before.

Thanks In Advance.


Solution

  • I have about it but couldn't get a positive response. I have used one trick for it.

    you can hide default Paypal button using CSS which generated by itself.

    and create your custom link and trigger the default button on click on the link.

    e.g.

    $(document).on('click', '#ppLogin', function(){
       $("#myContainer button").trigger("click");
    });
    

    Its Works perfect for me.