Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

html - How to customize PayPal button using script?

I am new with PayPal integration and setting and trying to customize the PayPal button in the below script.

<script src="https://www.paypal.com/sdk/js?client-id=sb"> // Required. Replace SB_CLIENT_ID with your sandbox client ID.
</script>
<div id="paypal-button-container"></div>
<script>
    paypal.Buttons({
        style: {
            layout: 'horizontal',
            color: 'gold',
            shape: 'pill',
            label: 'paypal'
        },
        createOrder: function (data, actions) {
            // This function sets up the details of the transaction, including the amount and line item details.
            return actions.order.create({
                purchase_units: [{
                    amount: {
                        value: '0.01'
                    }
                }]
            });
        }
    }).render('#paypal-button-container');
</script>

In their document, there is a PayPal icon before texting in the button which I am not getting so can you please guide me why I am not getting it.

Output of above code

enter image description here

https://developer.paypal.com/docs/checkout/integration-features/customize-button/#layout

question from:https://stackoverflow.com/questions/65883894/how-to-customize-paypal-button-using-script

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In their document, there is a PayPal icon before texting in the button which I am not getting so can you please guide me why I am not getting it.

The document is out of date. The first button (PayPal) no longer includes a logo as of several months ago.

You are seeing the current and correct behavior.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...