Comment on page
Upzelo Configuration Object
Parameters available for configuring Upzelo
Upzelo requires a configuration object to be passed into it to initialise.
It can be passed into
window.upzelo.init
and/or window.upzelo.open
.Parameters in red are required. Yellow is required conditionally.
Type:
String
Options:
full
, minimal
Default:
full
if hash
supplied, otherwise minimal
Usage: This determines if you want Upzelo to action things on your behalf with your payment provider. If set to minimal, offboarding requests will appear in the Requests section of the dashboard for you to action yourself.
type: 'minimal',
There are some available callbacks that you can use to further extend the functionality of Upzelo. They run alongside what Upzelo does and do not replace that functionality, therefore they are optional.
Where a callback has the
responses
argument, it will be an array of Actions that the user saw (not all of the actions in the Flow), and whether an Action was accepted or not.You should always check if it is defined before using it as there are a small number of cases where it might not be.
Type:
Function
Default:
null
Arguments:
{ customerId, subscriptionId, responses }
Usage: A function that runs at the end of a flow when the customer confirms that they wish to cancel.
onCancel: ({ customerId, subscriptionId, responses }) => {
window.location.replace(`https://www.example.com/goodbye?customer=${customerId}`);
}
Type:
Function
Default:
null
Arguments:
{ customerId, subscriptionId, responses, couponId, offerType, externalCouponId, planId, externalPlanId, offerDuration, offerDurationType }
Usage: A function that runs when a customer accepts an offer.
You can use
offerType
to change how you respond based on the offer type. Possible values are:discount
pause
trial_extension
free_period
plan_change
onSave: ({ customerId, offerType }) => {
console.log(customerId, offerType);
alert("Thanks for staying with us. Your account has been updated");
},
Last modified 7mo ago