Paypal button integration

Hi,

I am trying to add a PayPal smart button API on my Wix corvid.
I am receiving the “Parsing error: unexpected token <” error
what am I doing wrong:?

  • I’ve tried to add this code to Wix HTML iframe but it looks really bad on mobile.
    This is the code:
// For full API documentation, including code examples, visit https://wix.to/94BuAAs

$w.onReady(function () {
    <div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=sb&currency=USD"></script>
<script>
    paypal.Buttons({
        style: {
            shape: 'rect',
            color: 'gold',
            layout: 'vertical',
            label: 'paypal',
 
        },
        createOrder: function(data, actions) {
 return actions.order.create({
                purchase_units: [{
                    amount: {
                        value: '119'
                    }
                }]
            });
        },
        onApprove: function(data, actions) {
 return actions.order.capture().then(function(details) {
                alert('Transaction completed by ' + details.payer.name.given_name + '!');
            });
        }
    }).render('#paypal-button-container');
</script>
});

You can’t mash together html and javascript in your code, you can only use javascript.
If you want to use html in Wix, then you have to add it through the html iframe or html component,

You can add a Paypal button through Wix already.
https://support.wix.com/en/article/adding-a-paypal-button-280640
https://www.paypal.com/us/smarthelp/article/how-do-i-create-a-paypal-button-using-the-wix-html-widget-ts2001
Or just use the Paypal button app in Wix Apps.
https://www.wix.com/app-market/paypal-button/overview

Have a read of these pages for more info too.
https://www.vorbly.com/Vorbly-Code/HTML-PAYPAL-BUTTON-CUSTOM-DESIGN
https://www.vorbly.com/Vorbly-Code/HTML-PAYPAL-BUTTON—ONLINE-PAYMENTS
https://www.vorbly.com/Vorbly-Code/WIX-PAYPAL-INTEGRATION—ONLINE-PAYMENTS

Our friend was asking about the Smart Logo, the one Paypal offers for free, but people charge through some sort of app in the Wix Store.