Skip to content

Commit 7ba1d9c

Browse files
authored
Merge pull request #125 from Southern-Exposure-Seed-Exchange/develop
Propagate switch to Stripe to master
2 parents 6cd1392 + c05be9c commit 7ba1d9c

File tree

8 files changed

+779
-321
lines changed

8 files changed

+779
-321
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ jobs:
122122
- name: Prepare env
123123
run: |
124124
echo "HELCIM_ENV=${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}" >> $GITHUB_ENV
125+
echo "STRIPE_ENV=${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}" >> $GITHUB_ENV
125126
echo "POSTGRID_ENV=${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}" >> $GITHUB_ENV
126127
echo "GA_MEASUREMENT_ID='UA-5070189-1'" >> $GITHUB_ENV
127128
@@ -148,5 +149,6 @@ jobs:
148149
cache-to: type=gha,mode=max
149150
build-args: |
150151
HELCIM_ENV
152+
STRIPE_ENV
151153
GA_MEASUREMENT_ID
152154
POSTGRID_ENV

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ RUN npm --prefix client install
3030
COPY client ./client
3131
ARG HELCIM_ENV
3232
ENV HELCIM_ENV=$HELCIM_ENV
33+
ARG STRIPE_ENV
34+
ENV STRIPE_ENV=$STRIPE_ENV
3335
ARG POSTGRID_ENV
3436
ENV POSTGRID_ENV=$POSTGRID_ENV
3537
ARG GA_MEASUREMENT_ID

client/src/Data/Api.elm

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ module Data.Api exposing
22
( Endpoint(..), get, post, put, patch, delete
33
, withJsonBody, withStringResponse, withJsonResponse, withStringErrorHandler, withErrorHandler
44
, sendRequest
5-
, FormErrors, initialErrors, addError, addErrors, prefixedArrayErrors
5+
, FormErrors, initialErrors, addError, prefixedArrayErrors
66
, apiFailureToError, formErrorsDecoder
77
, errorHtml, generalFormErrors, getErrorHtml
8+
, addErrors
89
)
910

1011
{-|
@@ -79,8 +80,10 @@ type Endpoint
7980
| CheckoutPlaceOrderAnonymous
8081
| CheckoutSuccess
8182
| GuestCheckoutSuccess
82-
| CheckoutHelcimToken
83-
| CheckoutHelcimTokenAnonymous
83+
| HelcimValidateCheckout
84+
| HelcimValidateCheckoutAnonymous
85+
| StripeValidateCheckout
86+
| StripeValidateCheckoutAnonymous
8487
| AdminCategoryList
8588
| AdminNewCategory
8689
| AdminEditCategoryData CategoryId
@@ -244,12 +247,18 @@ toUrl endpoint =
244247
GuestCheckoutSuccess ->
245248
joinPath [ "checkout", "anonymous-success" ]
246249

247-
CheckoutHelcimToken ->
250+
HelcimValidateCheckout ->
248251
joinPath [ "checkout", "helcim-checkout-token" ]
249252

250-
CheckoutHelcimTokenAnonymous ->
253+
HelcimValidateCheckoutAnonymous ->
251254
joinPath [ "checkout", "anonymous-helcim-checkout-token" ]
252255

256+
StripeValidateCheckout ->
257+
joinPath [ "checkout", "validate-customer-details" ]
258+
259+
StripeValidateCheckoutAnonymous ->
260+
joinPath [ "checkout", "validate-anonymous-customer-details" ]
261+
253262
AdminCategoryList ->
254263
joinPath [ "admin", "categories", "list" ]
255264

@@ -582,6 +591,7 @@ addError : Field -> ErrorMessage -> FormErrors -> FormErrors
582591
addError field message errors =
583592
addErrors field [ message ] errors
584593

594+
585595
addErrors : Field -> List ErrorMessage -> FormErrors -> FormErrors
586596
addErrors field messages errors =
587597
(\a -> Dict.update field a errors) <|

0 commit comments

Comments
 (0)