ERROR ReferenceError: RazorpayCheckout is not defined

Discussão em 'Angular' iniciado por chethan, Setembro 10, 2024.

  1. chethan

    chethan Guest

    Hi I am using razor pay to pay online through web in my project but I am getting error as RazorpayCheckout is not defined

    [​IMG]

    declare var RazorpayCheckout:any;

    payWithRazorpay() {
    var options = {
    description: 'Credits towards consultation',
    image: 'https://i.imgur.com/3g7nmJC.png',
    currency: "INR", // your 3 letter currency code
    key: "rzp_test_1DP5mmOlF5G5ag", // your Key Id from Razorpay dashboard
    amount: 100, // Payment amount in smallest denomiation e.g. cents for USD
    name: 'Razorpay',
    prefill: {
    email: 'test@razorpay.com',
    contact: '9990009991',
    name: 'Razorpay'
    },
    theme: {
    color: '#F37254'
    },
    modal: {
    ondismiss: function () {
    alert('dismissed')
    }
    }
    };

    var successCallback = function (payment_id) {
    alert('payment_id: ' + payment_id);
    };

    var cancelCallback = function (error) {
    alert(error.description + ' (Error ' + error.code + ')');
    };

    RazorpayCheckout.open(options, successCallback, cancelCallback);


    }

    I have tried this method as referred by some website but most of them are ionic cordova plugin but I need to work in web pages

    Continue reading...

Compartilhe esta Página