Thank you, it worked for me very well! I use Ruby, here is the part of my code for PayPal subscribe button that also includes other useful parts I collected from few places to make business flow work (mix ruby and js): createSubscription: function(data, actions) {
return actions.subscription.create({
plan_id: "<%= .paypal_id %>",
<% if and > 0 %>
start_time: "<%= (@time_to_charge).strftime("%FT%TZ") %>",
<% end %>
application_context: {
brand_name: "My Brand name",
shipping_preference: 'NO_SHIPPING'
},
plan: {
taxes: {
percentage: $("#total_costs")[0].dataset.tax,
inclusive: false
}
},
});
},
... View more