I have an application written in R. I need to integrate it into the following payment method inside the application. https://github.com/ZarinPal-Lab/
I don’t know how to change the above codes and make a plugin so that I can integrate my Shiny application with this payment method.
I previously integrate my app with PayPal using the following codes:
actionButton("goButton", label= ui <- fluidPage(tags$script(src = "https://www.paypalobjects.com/api/checkout.js"), tags$script("paypal.Button.render({
// Configure environment
env: 'sandbox',
client: {
sandbox: 'demo_sandbox_client_id',
production: 'demo_production_client_id'
},
// Customize button (optional)
locale: 'en_US',
style: {
size: 'small',
color: 'gold',
shape: 'pill',
},
// Set up a payment
payment: function (data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '0.01',
currency: 'USD'
}
}]
});
},
// Execute the payment
onAuthorize: function (data, actions) {
return actions.payment.execute()
.then(function () {
// Show a confirmation message to the buyer
window.alert('Thank you for your purchase!');
});
}
}, '#goButton');"),
tags$div(id = "goButton"))),
Would you please help me on how to integrate my Shiny app with ZarinPal payment processing?