<div id="paypal-button-container"></div>
<script>
    var success_url = "<?php echo e($result['success_url'] ?? ''); ?>";
    // Render the PayPal button
    paypal.Button.render({
        // Set your environment
        env: "<?php echo e($result['payment_mode'] ?? 'sandbox'); ?>",
        style: {
            label: 'buynow',
            fundingicons: true, // optional
            branding: true, // optional
            size: 'small', // small | medium | large | responsive
            shape: 'rect', // pill | rect
            color: 'gold' // gold | blue | silver | black
        },

        // PayPal Client IDs - replace with your own
        // Create a PayPal app: https://developer.paypal.com/developer/applications/create

        client: {
            sandbox: "<?php echo e($result['sandbox_client_id'] ?? ''); ?>",
            production: "<?php echo e($result['production_client_id'] ?? ''); ?>"
        },
        commit: true,
        payment: function(data, actions) {
            return actions.payment.create({
                transactions: [{
                    amount: {
                        total: "<?php echo e($result['amount']); ?>",
                        currency: "<?php echo e($result['currency']); ?>"
                    }
                }]
            });
        },
        onAuthorize: function(data, actions) {
            return actions.payment.execute().then(function() {
                window.location = `${success_url} ?= 'payment_id='${data. payment_id }`;
            });
        }
    }, '#paypal-button-container');
</script>
<?php /**PATH D:\www\edulab\Modules\LMS\resources\views\theme\payment\paypal\form.blade.php ENDPATH**/ ?>