Popup integration
Sub2 offers easy checkout integration with a popup window. It works by opening a URL starting with www.sub2protocol.com/popup
followed by URL arguments. This makes it possible to create a custom button or other HTML elements on your website while still preserving all functionality in a separate window. The list of arguments can be seen here:
Parameter | Details |
---|---|
| Address of the recipient of the subscription payments. |
| Number of seconds between payments. For example, 30 days is |
| Address of ERC-20 token that is paid with. |
| Amount of tokens paid each time. This is the actual decimal number e.g. |
| Address of the ERC-20 token used for processing fee. |
| Amount of maximum processing fee. This is the actual decimal number e.g. |
| Duration of the auction period in seconds. This has to be less than or equal to |
| Delay in seconds before the first payment is due. |
| Number of initial payments with the creation of the subscription. If |
| Address of sponsor of the subscription. |
| EIP-712 signature of sponsor permit. The permit has to contain the same parameters as given in the URL. |
| Nonce of the sponsor permit used for the signature. |
| UNIX time in seconds for when the provided sponsor signature will expire. |
The parameters sponsor
, sponsor_signature
, permit_nonce
and permit_deadline
should only be provided if there is an intention to sponsor the processing fee of the subscription. However, if there is an intention of making a sponsorship, all of these parameters should be provided.
Note that there is no field for sender/subscriber. This is because the user should be able to chose which account they want to pay the subscription with.
Last updated