Is it possible to create PayPal subscriptons on the fly, basically the same as creating a product item.
From this setup:
return actions.order.create({
application_context: {
shipping_preference: "NO_SHIPPING",
landing_page: "LOGIN", //my preference
user_action: "PAY_NOW", //my preference
payment_method: { payer_selected: "PAYPAL", payee_preferred: "IMMEDIATE_PAYMENT_REQUIRED" }
},
payer: {
name: { given_name: payer_name, surname: payer_last },
address: {
address_line_1: payer_ada,
address_line_2: payer_adb,
admin_area_2: payer_town,
admin_area_1: payer_county,
postal_code: payer_postcode,
country_code: "GB"
},
email_address: payer_email,
payment_method: "PAYPAL",
},
purchase_units: [
{
To:
return actions.subscription.create({
/* Creates the subscription */
plan_id: 'P-9P231956E4189481LNGFGWHQ'
But adding the custom data along the lines of:
"product_id": "PROD-XXCD1234QWER65782",
"name": "Video Streaming Service Plan",
"description": "Video Streaming Service basic plan",
"status": "ACTIVE",
"billing_cycles": [
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "TRIAL",