<div id="paypal-button-container-P-28F10240LP572950BMGEYR4I"></div>
<script src="https://www.paypal.com/sdk/js?client-id=ATkraGvH6y4L5FiovDR6Evi0ixX0Go7JalGcQgCmoTVT1tv82CaSuoL7Lpe6grNGkLb7aynCjUONX87r&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-28F10240LP572950BMGEYR4I'
        });
      },
      onApprove: function(data, actions) {
        alert(data.subscriptionID); // You can add optional success message for the subscriber here
      }
  }).render('#paypal-button-container-P-28F10240LP572950BMGEYR4I'); // Renders the PayPal button
</script>