rsnext/examples/with-stripe-typescript/components
Tom a59c1f0d58
Fix with typescript stripe example fixes #50541 (#50574)
### What?

The TypeScript Stripe example has been fixed to address various issues. One of the issues was related to calling a function, which has now been resolved. Additionally, the Stripe API used in the example was outdated, causing an error during the build process. This issue has also been fixed.

By making these fixes, the TypeScript Stripe example should now work correctly without any function calling issues or errors related to the outdated Stripe API during the build.

### Why?

There's an issue regarding this problem `Fix with typescript stripe example fixes #50541`

```console
$ next build
- info Linting and checking validity of types ..- error ESLint must be installed in order to run during builds: yarn add --dev eslint
- info Linting and checking validity of types ...Failed to compile.

./components/CartSummary.tsx:41:24
Type error: Argument of type '{ sessionId: any; }' is not assignable to parameter of type 'string'.

  39 |     }
  40 |
> 41 |     redirectToCheckout({ sessionId: response.id })
     |                        ^
  42 |   }
  43 |
  44 |   return (
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

### How?

- Calling the `redirectToCheckout` function the right way 275cb65f3d/use-shopping-cart/react/index.d.ts (L65)
- Updating Stripe API
- Fix some changed / depcrated code since the API has changed a little
- Fix a TS error since the used library does not has a correct TS defintion file


![image](https://github.com/vercel/next.js/assets/987947/dd21dbb0-e949-4b3e-a26c-6a6d720c6e37)



Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-14 04:41:56 +00:00
..
Cart.tsx chore(examples): upgrade Stripe example (#41550) 2022-10-19 11:22:50 +02:00
CartSummary.tsx Fix with typescript stripe example fixes #50541 (#50574) 2023-06-14 04:41:56 +00:00
CheckoutForm.tsx Thor/stripe/add use shopping cart example (#14239) 2020-06-18 22:49:31 +00:00
ClearCart.tsx chore(examples): Fix for destroy is not a function error (#47469) 2023-03-24 15:02:39 +00:00
CustomDonationInput.tsx [Examples] Remove React.FC from with-stripe-typescript (#13803) 2020-06-05 16:17:36 +00:00
ElementsForm.tsx [example] Upgrade the with-stripe-typescript example app (#33761) 2022-01-28 23:20:43 +00:00
Layout.tsx Run next/link codemod for Next.js 13 on examples (#41913) 2022-10-30 21:00:45 +01:00
PrintObject.tsx [Examples] Remove React.FC from with-stripe-typescript (#13803) 2020-06-05 16:17:36 +00:00
Products.tsx chore(examples): upgrade Stripe example (#41550) 2022-10-19 11:22:50 +02:00
StripeTestCards.tsx Thor/stripe/add use shopping cart example (#14239) 2020-06-18 22:49:31 +00:00