impress-org / donation-block-for-stripe Goto Github PK
View Code? Open in Web Editor NEWA beautiful donation form block for WordPress. Accept donations in minutes using Stripe.
A beautiful donation form block for WordPress. Accept donations in minutes using Stripe.
Right now they are charging an incorrect amount.
Right now there's no way to edit a donation after moving to the payment step. We should make this process easier than having the donor refresh the page (which many likely won't know how to do).
This plugin should be able to create releases and pre-releases like our GiveWP and it's add-ons.
See: https://github.com/impress-org/givewp-github-actions
When you have more than one donation form on a page and the user starts a donation in one form and then moves to the next the payment element cannot be attached to the DOM due to duplicate selectors.
From Stripe:
The selector you specified (.donation-form-payment-intent) applies to 2 DOM elements that are currently on the page.
The Stripe Element will be mounted to the first one.
This will prefix the SDK so that it doesn't conflict with other plugins using the SDK without autoloading, etc.
Right now any editor can connect and disconnect from Stripe which isn't secure. We should lock it down to only admins.
Stripe supports several zero decimal currencies, and with the plugin soon to support additional currencies in #15 we should also ensure our logic supports zero-decimal currencies.
Add ability to accept recurring donations with 2% fee for:
When first using the block, and not connected to Stripe, the frontend form or notice never displays. It's simply blank and can leave a new user confused. It's easy to miss the notice above the form in the backend.
Video describing the issue:
https://www.loom.com/share/41cdd2be2ade4c6faed0918060d940b3
First time users should be clear that the first step to accepting donations is to connect to Stripe. They can preview the form on the frontend and backend but not make it past step 1.
There is now a native way to format numbers to currency and locale.
It appears pretty well supported now cross-browser.
See docs here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/format#browser_compatibility
Right now the amount buttons do not support currency formatting. This will be particularly useful.
This is related to #15
Currently the US dollar is hard coded into the plugin code. We should provide admins the ability to change this currency to the one of their choosing.
Note: This is not a donor-facing currency switching capability.
There is an extra space between the currency symbol and the amount that needs to be removed. I believe it got there due to a code reformatting (prettier).
One of Gutenberg's key features is editing content directly in a block. Justin from WP-Tavern pointed that out in his review of the plugin and I think it's a valid criticism.
It wouldn't be too difficult to add the ability to adjust the content directly in the block using inner blocks rather than the sidebar.
According to @JasonTheAdams, Stripe no longer a
We should refactor the Stripe code to no longer create the PaymentIntent until Step 2 (payment) is completed.
@jonwaldstein can you add context here or any relevant links?
When you make a donation through the form and return from Stripe you will see the donation form's first step before it flashes to the receipt. The time varies depending on the server.
As well, the dollar amount changes from the default $25 to whatever the amount of the donation actually was.
This is hardly an ideal UX and can be improved.
The best way to improve this as I see now is to use a loading screen that displays before actually displaying the receipt.
This is the perfect time to get started with end to end testing the block.
It looks like Gutenberg is in the process of migrating from Puppeteer to Playwright: WordPress/gutenberg#38851
There's tons of resources above, but it's going to take a bit of digging to fully understand how we can utilize this correctly.
A few helpful resources I found while doing research...
Migrating WordPress e2e tests to Playwright
https://make.wordpress.org/core/2022/03/23/migrating-wordpress-e2e-tests-to-playwright/
@wordpress/e2e-test-utils: It is a utility package with basic tests that are reused by other E2E test packages and suites in Gutenberg, in WordPress Core and by third parties. This package is now deprecated and a new package @wordpress/e2e-test-utils-playwright was introduced internally for the migration process.
E2E Tests Utils Playwright Package:
https://github.com/WordPress/gutenberg/tree/HEAD/packages/e2e-test-utils-playwright
Currently the plugin uses a few PHP 7.4 specific syntaxes that should be fixed to resolve any issue with PHP below 7.4 and above 7.2.
This plugin is free and requires no license, yet GiveWP wants one to be activated and shows a notice.
No notice displays.
I believe adding a Plugin URI
in the header with a non-GiveWP link should prevent the notice from displaying. This is what our other WP.org add-ons do.
When GiveWP is installed, we should create donors and donations when a payment is processed.
This will encourage folks to install the core plugin when they want this data on their site and to do more with it.
I'm not sure what's needed to ensure this plugin can be easily translated but WordPress' block checker is complaining about:
This plugin was create using WP's create-block script here: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/
I believe there are some out of the box toolage for i18n when using this package.
... more updates to come as I begin learning more.
There are two PHP notices that display when installing the plugin for the first time:
[05-Apr-2022 21:20:41 UTC] PHP Notice: Trying to get property 'livePublishableKey' of non-object in /Users/devinwalker/Local Sites/frost/app/public/wp-content/plugins/donation-block-for-stripe-by-givewp/src/DonationBlock.php on line 54
[05-Apr-2022 21:20:41 UTC] PHP Notice: Trying to get property 'testPublishableKey' of non-object in /Users/devinwalker/Local Sites/frost/app/public/wp-content/plugins/donation-block-for-stripe-by-givewp/src/DonationBlock.php on line 56
As a [type of user], I want [some goal] so that [some reason].
Stripe has a new service called "Link" that allows people to enter their phone number and
Since this is a newer API with Stripe there are a few unknowns. This is what I have gathered from Stripe:
Technical Documentation: https:/stripe.com/docs/payments/payment-methods/link {Note - these are gated, so please ensure you are logged into your Stripe account before accessing}
Demo: https://link-in-elements.glitch.me/checkout/ {Note - other users have found it helpful to click “Highlight the elements”}
Link fees - Link is priced as its own payment method (with default rates of 2.9% & $0.30).
Documentation here: https://givewp.com/documentation/resources/donation-form-block-for-stripe/
We need to find a good place to add it. It should also be a shortlink
When GiveWP Core and Stripe is installed (or a license activated) then the 2% fee should be removed.
Protect the innerwebs from destruction!
... and add a nonce.\
Currently the plugin violates the PHP maximum allowed when running it through the validator. There are also a few other recommendations that we should apply.
Block Plugin Checker: https://wordpress.org/plugins/developers/block-plugin-validator/
Block Directory Guidelines:
Release 1.0.0 recommendations:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.