diff --git a/.github/workflows/ci_dotnet.yaml b/.github/workflows/ci_dotnet.yaml index 5a7ac7b496..daa7d88940 100644 --- a/.github/workflows/ci_dotnet.yaml +++ b/.github/workflows/ci_dotnet.yaml @@ -26,9 +26,7 @@ jobs: matrix: runtime: - server_type: dotnet - server_image: mcr.microsoft.com/dotnet/sdk:6.0 - - server_type: dotnet - server_image: mcr.microsoft.com/dotnet/sdk:9.0 + server_image: mcr.microsoft.com/dotnet/sdk:latest uses: ./.github/workflows/wf_server_test.yaml secrets: inherit with: diff --git a/.github/workflows/ci_go.yaml b/.github/workflows/ci_go.yaml index e1e5945a81..43f4486cf8 100644 --- a/.github/workflows/ci_go.yaml +++ b/.github/workflows/ci_go.yaml @@ -27,8 +27,6 @@ jobs: runtime: - server_type: go server_image: golang:latest - - server_type: go - server_image: golang:1.17 uses: ./.github/workflows/wf_server_test.yaml secrets: inherit with: diff --git a/.gitignore b/.gitignore index 75b608df6f..abe5e98786 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,4 @@ playwright/test-results/ # Terraform files .terraform* -terraform.tfstate* \ No newline at end of file +terraform.tfstate*.playwright-mcp/ diff --git a/custom-payment-flow/client/react-cra/vite.config.mjs b/custom-payment-flow/client/react-cra/vite.config.mjs index deb2d09919..2492b418e6 100644 --- a/custom-payment-flow/client/react-cra/vite.config.mjs +++ b/custom-payment-flow/client/react-cra/vite.config.mjs @@ -8,9 +8,10 @@ export default defineConfig({ server: { port: 3000, host: "0.0.0.0", + allowedHosts: ["frontend", "localhost", "web"], proxy: { '/api': { - target: 'http://127.0.0.1:4242', + target: 'http://localhost:4242', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } diff --git a/custom-payment-flow/server/dotnet/global.json b/custom-payment-flow/server/dotnet/global.json index b85421ec81..ba7fbf0aa1 100644 --- a/custom-payment-flow/server/dotnet/global.json +++ b/custom-payment-flow/server/dotnet/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.101", + "version": "8.0.200", "rollForward": "latestMajor" } } \ No newline at end of file diff --git a/custom-payment-flow/server/dotnet/server.csproj b/custom-payment-flow/server/dotnet/server.csproj index 95775bf73f..5559fe3f13 100644 --- a/custom-payment-flow/server/dotnet/server.csproj +++ b/custom-payment-flow/server/dotnet/server.csproj @@ -1,11 +1,11 @@ - net10.0 + net9.0 enable - + diff --git a/custom-payment-flow/server/node/package-lock.json b/custom-payment-flow/server/node/package-lock.json index c6869eb026..f751428371 100644 --- a/custom-payment-flow/server/node/package-lock.json +++ b/custom-payment-flow/server/node/package-lock.json @@ -16,16 +16,6 @@ "stripe": "^20.2.0" } }, - "node_modules/@types/node": { - "version": "20.11.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.28.tgz", - "integrity": "sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==", - "optional": true, - "peer": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -878,13 +868,6 @@ "node": ">= 0.6" } }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "optional": true, - "peer": true - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/custom-payment-flow/server/ruby/Gemfile b/custom-payment-flow/server/ruby/Gemfile index 579029ebe4..4e02ee0699 100644 --- a/custom-payment-flow/server/ruby/Gemfile +++ b/custom-payment-flow/server/ruby/Gemfile @@ -5,6 +5,8 @@ gem 'json' gem 'rackup' gem 'sinatra' gem 'sinatra-contrib' +gem 'logger' +gem 'ostruct' gem 'stripe', '~> 18.2' gem 'toml-rb' gem 'webrick' diff --git a/custom-payment-flow/server/ruby/server.rb b/custom-payment-flow/server/ruby/server.rb index 12dbcd3712..f30420eea9 100644 --- a/custom-payment-flow/server/ruby/server.rb +++ b/custom-payment-flow/server/ruby/server.rb @@ -27,6 +27,7 @@ set :port, 4242 set :bind, '0.0.0.0' set :protection, except: [:json_csrf] +set :host_authorization, permitted_hosts: [] get '/' do content_type 'text/html' diff --git a/elements-with-checkout-sessions/.env.example b/elements-with-checkout-sessions/.env.example index 9830177ef2..5256848d49 100644 --- a/elements-with-checkout-sessions/.env.example +++ b/elements-with-checkout-sessions/.env.example @@ -2,5 +2,6 @@ STRIPE_PUBLISHABLE_KEY= STRIPE_SECRET_KEY= STRIPE_WEBHOOK_SECRET= STATIC_DIR=../../client/html +# For React/Vue clients, set to the dev server URL (e.g. http://localhost:3000) DOMAIN=http://localhost:4242 PORT=4242 diff --git a/elements-with-checkout-sessions/README.md b/elements-with-checkout-sessions/README.md index 5b0fc317d8..e03fe8d053 100644 --- a/elements-with-checkout-sessions/README.md +++ b/elements-with-checkout-sessions/README.md @@ -158,3 +158,11 @@ The dev server starts on port 3000 and proxies `/api` requests to `http://127.0.0.1:4242`. Navigate to [http://localhost:3000](http://localhost:3000) to see the payment form. Make sure a backend server is running on port 4242 first. + +**Important:** Set `DOMAIN` to your Vite dev server URL so Stripe +redirects back to the React app after payment: + +```bash +# In your server's .env +DOMAIN=http://localhost:3000 +``` diff --git a/elements-with-checkout-sessions/client/html/index.css b/elements-with-checkout-sessions/client/html/index.css index 656fa1e5d2..f80ce74245 100644 --- a/elements-with-checkout-sessions/client/html/index.css +++ b/elements-with-checkout-sessions/client/html/index.css @@ -9,7 +9,9 @@ body { display: flex; flex-direction: column; justify-content: center; - align-content: center; + align-items: center; + height: 100vh; + width: 100vw; } form { @@ -42,6 +44,11 @@ form { margin-top: 16px; } +#address-element { + margin-bottom: 24px; + margin-top: 16px; +} + #email { border-radius: 5px; box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02); diff --git a/elements-with-checkout-sessions/client/html/index.html b/elements-with-checkout-sessions/client/html/index.html index 499357daf3..d63a75ce4f 100644 --- a/elements-with-checkout-sessions/client/html/index.html +++ b/elements-with-checkout-sessions/client/html/index.html @@ -17,6 +17,10 @@
+

Billing address

+
+ +

Payment

diff --git a/elements-with-checkout-sessions/client/html/index.js b/elements-with-checkout-sessions/client/html/index.js index 0cab486d71..e7bfc50e33 100644 --- a/elements-with-checkout-sessions/client/html/index.js +++ b/elements-with-checkout-sessions/client/html/index.js @@ -72,6 +72,9 @@ async function initialize() { } }); + const addressElement = checkout.createBillingAddressElement(); + addressElement.mount("#address-element"); + const paymentElement = checkout.createPaymentElement(); paymentElement.mount("#payment-element"); } diff --git a/elements-with-checkout-sessions/client/react-cra/src/App.css b/elements-with-checkout-sessions/client/react-cra/src/App.css index 78c44af6b1..78d629cb06 100644 --- a/elements-with-checkout-sessions/client/react-cra/src/App.css +++ b/elements-with-checkout-sessions/client/react-cra/src/App.css @@ -40,6 +40,11 @@ form { margin-top: 16px; } +#address-element { + margin-bottom: 24px; + margin-top: 16px; +} + #email { border-radius: 5px; box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02); diff --git a/elements-with-checkout-sessions/client/react-cra/src/CheckoutForm.jsx b/elements-with-checkout-sessions/client/react-cra/src/CheckoutForm.jsx index b2374e8ede..6fcde821bd 100644 --- a/elements-with-checkout-sessions/client/react-cra/src/CheckoutForm.jsx +++ b/elements-with-checkout-sessions/client/react-cra/src/CheckoutForm.jsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; import { PaymentElement, + BillingAddressElement, useCheckout } from '@stripe/react-stripe-js/checkout'; @@ -104,6 +105,8 @@ const CheckoutForm = () => { error={emailError} setError={setEmailError} /> +

Billing address

+

Payment