Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pro#622] Add Pro sign up ban check #1788

Merged
merged 1 commit into from
Sep 29, 2023
Merged

[pro#622] Add Pro sign up ban check #1788

merged 1 commit into from
Sep 29, 2023

Conversation

gbp
Copy link
Member

@gbp gbp commented Sep 28, 2023

Relevant issue(s)

Connected to https://github.com/mysociety/alaveteli-professional/issues/622

What does this do?

Add Pro sign up ban check

Why was this needed?

When a YAML config file is present, check the payment card before the pro subscription is created.

Implementation notes

With the YAML:

- fingerprint: 123abc456DEF789gh
  address_zip: AB11AB
- address_zip: CD11CD

This would add two bans. Prevent sign up if the payment card entered matches:

  1. the fingerprint and postcode AB1 1AB, or
  2. the postcode cd11cd

For fingerprint, these come from the Stripe dashboard and are unique for a given card. See: https://stripe.com/docs/api/cards/object#card_object-fingerprint

For postcodes/address zip we upcase and strip all white space from what is provided on the payment form.

When a YAML config file is present, check the payment card before the
pro subscription is created.

With the YAML:

```yaml
- fingerprint: 123abc456DEF789gh
  address_zip: AB11AB
- address_zip: CD11CD
```

This would add two bans. Prevent sign up if the payment card entered
matches:
1. the fingerprint and postcode `AB1 1AB`,
or
2. the postcode `cd11cd`

For fingerprint, these come from the Stripe dashboard and are unique for
a given card. See: https://stripe.com/docs/api/cards/object#card_object-fingerprint

For postcodes/address zip we upcase and strip all white space from what
is provided on the payment form.
@gbp gbp merged commit f57fd45 into master Sep 29, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant