Skip to content

fix(samples/kotlin): send customer email for USDB embedded wallets#590

Open
pengying wants to merge 1 commit into
06-16-feat_samples_kotlin_support_grid_api_base_url_overridefrom
06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets
Open

fix(samples/kotlin): send customer email for USDB embedded wallets#590
pengying wants to merge 1 commit into
06-16-feat_samples_kotlin_support_grid_api_base_url_overridefrom
06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets

Conversation

@pengying

Copy link
Copy Markdown
Contributor

The platform requires a customer email when it supports USDB embedded
wallets. Wire email through the customer create builder and add it to
the sample's default request body. The Grid API validates domain
deliverability, so the default uses a real domain (gmail.com).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 18, 2026 6:13pm
grid-wallet-demo Ignored Ignored Preview Jun 18, 2026 6:13pm

Request Review

pengying commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds email support to the customer-creation flow for platforms that require it when USDB embedded wallets are enabled. The Grid API validates the domain's MX records, so the default sample value uses a real domain with a random +suffix to keep each run distinct.

  • Frontend (CreateCustomer.tsx): Appends a jack.doe+<random>@gmail.com email to the default JSON body, with a comment explaining the MX-validation requirement.
  • Kotlin sample (Customers.kt): Reads email from the incoming JSON and forwards it to the CreateCustomerRequest builder using the same optional-chaining pattern already used for all other fields.

Confidence Score: 5/5

Safe to merge — small, additive changes that follow existing patterns in both files.

Both changes are minimal and correct: the frontend adds a well-formed sample email with a clear explanatory comment, and the Kotlin server forwards the field through the builder using the same optional-chaining idiom already used for every other field. No existing behaviour is modified.

No files require special attention.

Important Files Changed

Filename Overview
samples/frontend/src/steps/CreateCustomer.tsx Adds a randomly-suffixed gmail.com email to the default request body, with a comment explaining the MX-validation requirement; pattern is consistent with the existing platformCustomerId random suffix.
samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt Wires the optional email field from the incoming JSON body to the customer builder, matching the style of every other optional field in the builder block.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Browser as Frontend (React)
    participant Kotlin as Kotlin Sample Server
    participant Grid as Grid API

    Browser->>Kotlin: "POST /api/customers { platformCustomerId, email, fullName, ... }"
    Kotlin->>Kotlin: "optText("email")?.let { email(it) }"
    Kotlin->>Grid: customers.create(CustomerCreateParams)
    Grid->>Grid: Validate email domain MX records
    Grid-->>Kotlin: Customer response (JSON)
    Kotlin-->>Browser: 201 Created (JSON)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Browser as Frontend (React)
    participant Kotlin as Kotlin Sample Server
    participant Grid as Grid API

    Browser->>Kotlin: "POST /api/customers { platformCustomerId, email, fullName, ... }"
    Kotlin->>Kotlin: "optText("email")?.let { email(it) }"
    Kotlin->>Grid: customers.create(CustomerCreateParams)
    Grid->>Grid: Validate email domain MX records
    Grid-->>Kotlin: Customer response (JSON)
    Kotlin-->>Browser: 201 Created (JSON)
Loading

Reviews (2): Last reviewed commit: "fix(samples/kotlin): send customer email..." | Re-trigger Greptile

The platform requires a customer email when it supports USDB embedded
wallets. Wire `email` through the customer create builder and add it to
the sample's default request body. The Grid API validates domain
deliverability, so the default uses a real domain (gmail.com).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pengying pengying force-pushed the 06-16-feat_samples_kotlin_support_grid_api_base_url_override branch from cc1024a to f206e35 Compare June 18, 2026 18:13
@pengying pengying force-pushed the 06-16-fix_samples_kotlin_send_customer_email_for_usdb_embedded_wallets branch from a565834 to 4019a29 Compare June 18, 2026 18:13

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4019a29 is a pure rebase onto f206e35. Approving based on @jklein24's previous approval of a565834.

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4019a29 is a pure rebase onto f206e35. Approving based on @jklein24's previous approval of a565834.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants