Skip to content

API: Accept money and send postcards #8

Description

@conorgil

Goal: After successfully charing the user's CC for $X, send postcards to Y randomly chosen registered voters who have not previously received a postcard, where Y is the number of postcards possible to purchase for $X (minus all service fees).

If we embed Stripe into our site directly:

  1. API request includes Stripe token. Charge the user's CC. Wait for successful response from Stripe.

If we use Square or something and they handle charging the user's CC on Stripe:

  1. API request is a webhook from Stripe confirming that the CC was charged.

After payment is resolved:

  1. Calculate how many postcards can be purchased after subtracting the Stripe service fees. Let that by Y.
  2. Choose Y voters at random from the database who have not received a post card previously.
  3. Make request to ClickSend API to send postcard

If we embed Stripe into our site directly:

  1. Send response to our website so that we can show the user a confirmation message that the postcards were sent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions