<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=AaH0kgzipwHCQmtT7y8q8BPNkHLlgnUMv7bbsRZM-TO84CtviF1V1ID47f6DU67ipcaHKhbiyZI0mZVU&vault=true" 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({
          'plan_id': 'P-6KS94010R7119352UL5ZEGNY'
        });
      },
      onApprove: function(data, actions) {
        alert(data.subscriptionID);
      }
  }).render('#paypal-button-container');
</script>