impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
340 stars 191 forks source link

Stripe should account for multiple Stripe accounts when saving the donor customer ID #6686

Closed jonwaldstein closed 1 year ago

jonwaldstein commented 1 year ago

User Story

As an admin, I want my donor's Stripe customer ID to be specific to the account they were created in so that they can be a customer in multiple stripe accounts.

Details

Multiple Stipe account GiveWP has the ability to use different Stripe accounts. From what I can tell, our donor meta does not account for this - meaning anytime a donor uses stripe for a donation, the customer ID for that account is saved to their meta - overwriting the previous value. We should really have an identifier for that customer ID that connects back to the specific stripe account it's for. That could be something like a key / value pair with the stripe account as the key and customer ID as the value:

_give_stripe_customer_id{_test} = [
'acc_12345' => 'cus_12345',
'acc_54321' => 'cus_54321'
];

Another option we have discussed, is not saving the customer ID at all. That would depend on if we are using the ID elsewhere, but since we have to hit the Stripe api to retrieve the customer anyway, we can just run a search instead (more on this next).

Stripe API & searching Newer versions of the Stripe api feature a search functionality. This would be a much better use case for us when try to retrieve a customer record. As pointed out earlier, the only way to know if a customer does not exist is by catching a _resourcemissing exception. Searching for a customer based on ID and/or email appears to be a more appropriate way of looking up a customer.

This does require updating our stripe sdk and api version.

Additional Context

Related: https://github.com/impress-org/givewp-next-gen/pull/122

Acceptance Criteria

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

jonwaldstein commented 1 year ago

This issue still needs to be addressed.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for an additional 14 days with no activity.