sub

<div id="paypal-button-container-P-5MK67978VM771811AM5CFB6Y"></div>
<script src="https://www.paypal.com/sdk/js?client-id=ASBxQxeoHBoJTDc0vG9ZV2CaIavnyJRwLoQmUtBCxrNp82MFAKl0Word4wsnGavOsSESZXsdEl50CNNx&vault=true&intent=subscription" data-sdk-integration-source="button-factory"></script>
<script>
  paypal.Buttons({
      style: {
          shape: 'rect',
          color: 'gold',
          layout: 'vertical',
          label: 'subscribe'
      },
      createSubscription: function(data, actions) {
        return actions.subscription.create({
          /* Creates the subscription */
          plan_id: 'P-5MK67978VM771811AM5CFB6Y'
        });
      },
      onApprove: function(data, actions) {
        alert(data.subscriptionID); // You can add optional success message for the subscriber here
      }
  }).render('#paypal-button-container-P-5MK67978VM771811AM5CFB6Y'); // Renders the PayPal button
</script>