GithubHelp home page GithubHelp logo

impress-org / donation-block-for-stripe Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 5.2 MB

A beautiful donation form block for WordPress. Accept donations in minutes using Stripe.

PHP 9.06% JavaScript 87.73% SCSS 3.21%

donation-block-for-stripe's People

Contributors

dependabot[bot] avatar devinwalker avatar jasontheadams avatar mathetos avatar taylorfromteamgive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

donation-block-for-stripe's Issues

Add ability to edit donation in Step 2

Details

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).

Ensure two donation forms on a page have unique selectors for Stripe's Payment Element

Details

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.

2022-04-06_14-37-36
2022-04-06_14-37-44

Improve UX when first using the block and not connected to Stripe

Details

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

Expected Behavior

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.

Add ability for admins to switch currency from dollars

Details

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.

Acceptance Criteria

  • New currency option is added to Gutenberg listing Stripe supported currencies
  • Currency displays on the frontend properly
  • Currency is formatted correctly
  • The donation is processed in the correct currency
  • Multiple donation forms on a page respect the chosen currency for the particular form

Use inner blocks to allow content updates directly in block

Details

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.

Prevent flash of donation form first step when waiting for receipt to load from Stripe

Details

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.

Additional Context

The best way to improve this as I see now is to use a loading screen that displays before actually displaying the receipt.

Acceptance Criteria

  • No flash happens
  • Confetti cannon still blasts properly spreading joy throughout all of time
  • Loading looks nice and isn't clumsy

Block should have basic e2e tests written

Details

This is the perfect time to get started with end to end testing the block.

E2E w/ Gutenberg Info

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.

📑 Good Resources:

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


Plugin should work on PHP 7.2+

Details

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.

Set default amount

I'd like to be able to change the multi-level amount options and choose which one of them is the default. Currently, the default amount is always $25 regardless whether that's a button option or not.

image

Prevent GiveWP from asking for a license when activated

Details

This plugin is free and requires no license, yet GiveWP wants one to be activated and shows a notice.

Expected Behavior

No notice displays.

Additional Context

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.

Acceptance Criteria

  • No license notice displays when GiveWP is active

Fix PHP notices on fresh install

Details

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

Add option to enabled Stripe "Link" for faster processing

User Story

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

Details

Since this is a newer API with Stripe there are a few unknowns. This is what I have gathered from Stripe:

Link documentation

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).

Acceptance Criteria

  • Link is enabled when toggling
  • Link works hassle free

Fix currency symbol CSS issues cross-theme

Details

Oh, WordPress themes... why do you do such things?

There's issues with some themes adding padding, margin, line-heights, and other craziness to the next currency symbol.

Visuals

See this hot mess:
2022-04-14_20-50-14

Add nonce to endpoint

Details

Protect the innerwebs from destruction!

Additional Context

... and add a nonce.\

Plugin should adhere to the block directory guidelines to be included

Additional Context

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:

2022-03-09_09-08-02

Acceptance Criteria

  • PHP is reduced to guideline's recommendations
  • Translation scripts work as expected
  • "block" is added as a tag

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.