Available Functions
Example Use-cases
Let's assume you initialize the Payform as hidden, so it is loading on the background while the customer is browsing the page.
everypay.payform({
hidden: true,
...
})
Now once we are ready to present the Payform to the user, because of certain action (e.g user selected pay by card on a selector), the form that is already preloaded on the background will show immediately like this:
everypay.showForm();
Let's say that this user has changed his mind and selects another payment method, we can easily hide the form by using the hideForm function.
everypay.hideForm();
Now let's assume that the user has just added another item on his basket or a promotion which is on the same page as the form. We can easily recalculate and change the amount using the changeAmount function.
everypay.changeAmount(50000);
Similarly, we can update the frequency type to recurring or set it back to default.
// set to recurring
everypay.changeFrequencyType('recurring');
// set to default
everypay.changeFrequencyType(null);
We can specify a particular number of installments or set it to the default value of 0.
// set installments
everypay.changeInstallment(4);
// set to default
everypay.changeInstallment(null);
Available Functions
Name | Type | Description |
---|---|---|
showForm | func | You can use the everypay.showForm() to display the form if you have the 'hidden' option as true. |
hideForm | func | You can use the everypay.hideForm() to hide the form. |
changeAmount | func | You can use the everypay.changeAmount(number) function in order to programmatically change the amount after the form has been loaded. |
changeFrequencyType | func | You can use the everypay.changeFrequencyType(string|null) function in order to programmatically change the frequencyType after the form has been loaded. |
onClick | func | You can use the everypay.onClick() function to programmatically initiate a payment action within the form. This is used in combination of using your own payment button that lives outside the form and hidding the Payform button. |
changeInstallment | func | You can use the everypay.changeInstallment(int|null) function to programmatically adjust the number of installments after the form has been loaded. |