PayPalExpressGateway

In addition to the methods below the class inherits all the methods and properties from the Gateway.

Instance Methods

Method Name Description
renderButton(button: object, callback?: Function): void Render a PayPal Express Checkout button. See documentation for button definition.

Vue example

This example uses Vue but a similar method would need to be employed for other frameworks such as Angular or React.

Vue.component('paypal-button', {
    template: '<div id="paypal-checkout" />',
    mounted: function() {
        Givecloud.Gateway('paypalexpress').renderButton({
            container: 'paypal-checkout',
            type: 'checkout',
            size: 'medium',
            shape: 'pill',
            color: 'gold',
        }, (function(){ this.$emit('click'); }).bind(this));
    }
});

And in the template you would use it something like this.

<paypal-button @click="submitPayForm"></paypal-button>