feat: pro setting#1013
Conversation
Klakurka
left a comment
There was a problem hiding this comment.
- The paybutton doesn't seem to have amount + op_return set when clicking on the QR code.
| <h3>PayButton Pro</h3> | ||
| <div className={style.pro_ctn}> | ||
| <span>{text}</span> | ||
| {isPro === false && <ProPurchase/>} | ||
| </div> |
There was a problem hiding this comment.
Somewhere in the div we should add a 'What is this?' button like we have on the Public Key section above it.
| const ProPurchase = (): JSX.Element => { | ||
| return <div className="WIP"> | ||
| <button> | ||
| <Link href='/pro'>Buy Pro</Link> |
|
|
||
| const ProPurchase = (): JSX.Element => { | ||
| return <div className="WIP"> | ||
| <button> |
There was a problem hiding this comment.
Somehow the "Buy Pro" button is using different styling to our other buttons (eg. "Org Create"). It should be the same.
|
Addressed issues, except for
Should I leave them in
Server i using version the out-of-date 2.0.0 version of PayButton. |
| {isPro === false && <ProPurchase/>} | ||
| {infoModal && ( | ||
| <div className={stylep.public_key_info_ctn}> | ||
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tincidunt risus libero, venenatis commodo nibh commodo eget. Aenean turpis tellus, consectetur vel consequat nec, vehicula quis odio. Sed vitae venenatis orci. Vestibulum a facilisis tellus. Nunc at hendrerit |
There was a problem hiding this comment.
Let's display an HTML table here with what each tier offers.
| Standard | Pro
Emails | 5 / day | 100 / day
Addresses Per Button | 20 | Unlimited
Etc.
There was a problem hiding this comment.
Let's display an HTML table here with what each tier offers.
| Standard | Pro Emails | 5 / day | 100 / day Addresses Per Button | 20 | Unlimited
Etc.
Addressed, for that I rewrote the config files (and updated the README accordingly). This new paradigm will let us keep adding pro features more easily.
To test it out, remember to update paybutton-config.json (use config/example-config.json as reference)
|
I changed this PR to Draft because right now it contains TypeScript errors that will only be solved once PayButton/paybutton#509 is approved, merged and released. |
4e85ad0 to
8a91569
Compare
Gotta update the |
|
Checks failing? |
For some reason it was saying "Could not import X from Prisma" to everything. Couldn't understand from the changes, ran it again, worked. |
Can you paste here the |
|
Missing some stuff. From example-config.json: also this |
Klakurka
left a comment
There was a problem hiding this comment.
OK - still had some config issues that I managed to fix.
Let's cut the "What is this?" button and just display the info all the time.
| type: { | ||
| enabled: boolean, | ||
| monthsCost: { | ||
| [key: string]: number | ||
| }, | ||
| payoutAddress: string, | ||
| standardDailyEmailLimit: number | "Inf", | ||
| proDailyEmailLimit: number | "Inf", | ||
| standardAddressesPerButtonLimit: number | "Inf", | ||
| proAddressesPerButtonLimit: number | "Inf" | ||
| } | ||
| default: { | ||
| "enabled": true, | ||
| "monthsCost": { | ||
| "1": 10, | ||
| "3": 20, | ||
| "6": 30, | ||
| "12": 50 | ||
| }, | ||
| "payoutAddress": "ecash:qrf4zh4vgrdal8d8gu905d90w5u2y60djcd2d5h6un" | ||
| "standardDailyEmailLimit": 5, | ||
| "proDailyEmailLimit": 100, | ||
| "standardAddressesPerButtonLimit": 20, | ||
| "proAddressesPerButtonLimit": "Inf" | ||
| } |
There was a problem hiding this comment.
I don't think we need this in the readme.
There was a problem hiding this comment.
which part? the whole setting?
There was a problem hiding this comment.
Yeah at least defining actual values in the readme here where we would have to update it twice (here and where it actually matters) is just making more work for nothing.
| ``` | ||
| > General configuration for PayButton Pro. Each parameter is described below. | ||
|
|
||
| ##### proSettings.enabled | ||
| ``` | ||
| type: boolean | ||
| default: true | ||
| ``` | ||
| > If the Pro feature should be enabled or hidden. | ||
|
|
||
| ##### proSettings.monthsCost | ||
| ``` | ||
| type: { | ||
| [key: string]: number | ||
| } | ||
| default: { | ||
| "1": 10, | ||
| "3": 20, | ||
| "6": 30, | ||
| "12": 50 | ||
| } | ||
| ``` | ||
| > The pricing model for PayButton Pro subscription — [value] USD for [key] months. | ||
|
|
||
| ##### proSettings.payoutAddress | ||
| ``` | ||
| type: string | ||
| default: "ecash:qrf4zh4vgrdal8d8gu905d90w5u2y60djcd2d5h6un" | ||
| ``` | ||
| > The payout address for PayButton Pro subscriptions. | ||
|
|
||
| ##### proSettings.standardDailyEmailLimit | ||
| ``` | ||
| type: number | "Inf" | ||
| default: 5 | ||
| ``` | ||
| > How many emails can a standard user send daily. | ||
|
|
||
| ##### proSettings.proDailyEmailLimit | ||
| ``` | ||
| type: number | "Inf" | ||
| default: 20 | ||
| ``` | ||
| > How many emails can a PayButton Pro user send daily. | ||
|
|
||
| ##### proSettings.standardAddressesPerButtonLimit | ||
| ``` | ||
| type: number | "Inf" | ||
| default: 5 | ||
| ``` | ||
| > How many addresses can a standard Pro user add for a single button. | ||
|
|
||
| ##### proSettings.proAddressesPerButtonLimit | ||
| ``` | ||
| type: number | "Inf" | ||
| default: "Inf" | ||
| ``` | ||
| > How many addresses can a PayButton Pro user add for a single button. | ||
|
|
There was a problem hiding this comment.
We don't really get any benefit out of putting this stuff into the readme as:
- Defaults now need to be updated in two places (here and in the config).
- Example config has all of it.
Pro pricing is TBD.
There was a problem hiding this comment.
But this 1. and 2. applies to all config settings, no?
| {isPro === false && <ProPurchase/>} | ||
| {infoModal && ( | ||
| <div className={stylep.public_key_info_ctn}> | ||
| <p>PayButton Pro users get higher limits:</p> |
There was a problem hiding this comment.
We can drop this for now - IMO we can improve the style/layout/etc of the Standard/Pro breakdown a lot in a follow-up.
There was a problem hiding this comment.
Removed the <p> tag.
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td>Daily Emails</td> |
There was a problem hiding this comment.
Change to 'Outgoing Emails On Payment'.
| <td>{showLimit(config.proSettings.standardDailyEmailLimit)}</td> | ||
| <td>{showLimit(config.proSettings.proDailyEmailLimit)}</td> |
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> |
There was a problem hiding this comment.
Add a new line for 'Outgoing Server-to-Server Messages On Payment' (daily limit will be the same as emails).
Done. |
Klakurka
left a comment
There was a problem hiding this comment.
We can iterate on this over time.





Related to #983
Description
Adds new config parameters (check
config/example-config.json)Adds the basics for the PayButton Pro feature.
To be implemented in subsequent PRs:
Test plan
After adding the new parameters to
paybutton-config.json, make sure the front-end is functional and good enough as a ground for the later implementation of the aforementioned features.