'How to implement paypal buttons for recurring payment without subscription plan

As my website will allow coupon also so my subscription plan amount can be vary with respect to coupon and each time creating new plan is not ideal way

is there any way to pass duration here

// Sets up the transaction when a payment button is clicked
        createOrder: function(data, actions) {
          return actions.order.create({
            purchase_units: [{
              amount: {
                value: '77.44' // Can reference variables or functions. Example: `value: document.getElementById('...').value`
              }
            }],
            stored_payment_source: [{payment_type:'RECURRING'}]
          });
        },

?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source