Skip to content

Commit

Permalink
Update stripeController.ts and Checkout.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed May 7, 2024
1 parent 63db648 commit 2968fcd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions api/src/controllers/stripeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const createCheckoutSession = async (req: Request, res: Response) => {
name,
},
unit_amount: Math.floor(amount * 100),
currency,
currency: currency.toLowerCase(),
},
quantity: 1,
},
Expand Down Expand Up @@ -183,7 +183,7 @@ export const createPaymentIntent = async (req: Request, res: Response) => {
// For example, to charge 10 USD, provide an amount value of 1000 (that is, 1000 cents).
//
amount: Math.floor(amount * 100),
currency,
currency: currency.toLowerCase(),
receipt_email: receiptEmail,
description,
customer: customer.id,
Expand Down
4 changes: 2 additions & 2 deletions mobile/config/env.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ export const STRIPE_MERCHANT_IDENTIFIER: string = MI_STRIPE_MERCHANT_IDENTIFIER
*
* @type {string}
*/
export const STRIPE_COUNTRY_CODE: string = MI_STRIPE_COUNTRY_CODE.toUpperCase()
export const STRIPE_COUNTRY_CODE: string = MI_STRIPE_COUNTRY_CODE

/**
* The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required for Stripe payments.
* Must be a supported currency: https://docs.stripe.com/currencies
*
* @type {string}
*/
export const STRIPE_CURRENCY_CODE: string = MI_STRIPE_CURRENCY_CODE.toUpperCase()
export const STRIPE_CURRENCY_CODE: string = MI_STRIPE_CURRENCY_CODE
6 changes: 3 additions & 3 deletions mobile/screens/Checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,12 @@ const CheckoutScreen = ({ navigation, route }: NativeStackScreenProps<StackParam
paymentIntentClientSecret: clientSecret,
merchantDisplayName: "Movin' In",
googlePay: {
merchantCountryCode: env.STRIPE_COUNTRY_CODE,
merchantCountryCode: env.STRIPE_COUNTRY_CODE.toUpperCase(),
testEnv: env.STRIPE_PUBLISHABLE_KEY.includes('_test_'),
currencyCode: env.STRIPE_CURRENCY_CODE,
currencyCode: env.STRIPE_CURRENCY_CODE.toUpperCase(),
},
applePay: {
merchantCountryCode: env.STRIPE_COUNTRY_CODE,
merchantCountryCode: env.STRIPE_COUNTRY_CODE.toUpperCase(),
},
})
if (initPaymentSheetError) {
Expand Down

0 comments on commit 2968fcd

Please sign in to comment.