Blog | Technical

Stripe Workflow

This section identifies the Stripe workflow for payments. There are some steps required for the process.

1. Item Listed on Fifepay or website. This will request the users email, number of items and additional information.

2. Confirm checkout, repeating the input data and asking user to checkout.

3. On confirm, the user session data will be saved prior to the Stipe checkout session.

4. On payment there will be a Card Confirmation page back to FIFEpay, the user will then be directed back to the relevant website.

5. Stripe will then confirm further status and payment details using a WebHook.
It has come to my attention that Stripe does not use the email as identifier. Stripe requires a unique customer ID.

I`ve since found that I can collect this information during the checkout session:

$STRIPE_CUSTOMER = $checkout_session->customer ;
$STRIPE_IDEMPOTENCY = $checkout_session->idempotency_key ;

and I will now store it in the `sessions` table.
$query .= ", customer=`$STRIPE_CUSTOMER`, idempotency=`$STRIPE_IDEMPOTENCY` " ;

(on subsequent transactions I then need to use the Customer_ID in the create checkout session so we know its the same customer.

Files are steps to enter data and then confirm before proceeding:
-- checkout1
-- checkout2
-- checkout2_recur

Normal processing is to use stripe checkout first on list, the sfo one is for recurring subscriptions. while `recur` is used to setup recyrring transactions for other products (different to SFO monthly recurring)

-- create-checkout-session
-- create-checkout-session-sfo
-- create-checkout-session-recur

However, if the category is `subscritpnion` then the stripe checkout is : create-checkout-session-sfo

The need for this was for a recurring subscription with automatic payments.

Card Confirmation

Next step is then on the Card Confirmation to store in Payment and Users table. These parameters copied from sessions and added to the payment table. if there is a customer then save it for the user table. so that this user customer id is available in future.

card-confirmation1.php
card-confirmation-sfo.phpWebhook handling.

After payment confirmation, Stripe has the ability to send responses back to the server, called Webhooks. Live and Test can be different.
General:

Falkikrk: