Skip to content

feat: add Tempo relay support - #16

Merged
bensandler-stripe merged 6 commits into
stripe:mainfrom
parvahuja:parv/tempo-relay-support
Aug 7, 2026
Merged

feat: add Tempo relay support#16
bensandler-stripe merged 6 commits into
stripe:mainfrom
parvahuja:parv/tempo-relay-support

Conversation

@parvahuja

@parvahuja parvahuja commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Why

Java servers need the same non-mutating credential validation and relay-backed Tempo charge flow as mppx.

What

  • Split credential validation from terminal broadcast while retaining legacy verify compatibility.
  • Add Tempo API relay configuration, safe error mapping, and idempotent broadcasts.
  • Preserve spec-format opaque metadata exactly for challenge binding and relay forwarding.
  • Add focused coverage and a runnable route-bound Moderato example.

@cla-assistant

cla-assistant Bot commented Aug 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@parvahuja
parvahuja marked this pull request as ready for review August 5, 2026 21:28
Comment thread examples/tempo-relay/src/main/java/com/stripe/mpp/examples/TempoRelayServer.java Outdated
- share one canonical credential envelope (Credential.toEnvelope) between
  Authorization serialization and the relay body; omit empty source like
  the reference SDKs
- narrow Verify.assertCredential to provenance and expiry; the charge path
  keeps the request/opaque expectation checks, standalone lifecycle calls
  no longer compare the echo against itself
- add MppHandler.challenge(ChargeRequest); the example uses it and the now
  public TempoDefaults token constants instead of a hardcoded address
- relay: build the validate+broadcast body once, fold the success check
  into post(), precompute endpoint URIs, digest idempotency keys with
  BouncyCastle (web3j returns to test scope), forward insufficient_funds
  as a safe details code, and fail malformed challenge requests as a
  PaymentException instead of a raw parse error
- Intent.validate/broadcast defaults throw UnsupportedOperationException:
  calling them on a verify-only intent is a wiring error, not a payer
  failure
@parvahuja
parvahuja force-pushed the parv/tempo-relay-support branch from 66e8684 to 2639669 Compare August 6, 2026 17:29
Comment thread src/main/java/com/stripe/mpp/error/PaymentException.java
Comment thread src/main/java/com/stripe/mpp/methods/tempo/TempoRelay.java
Comment thread src/main/java/com/stripe/mpp/methods/tempo/TempoRelay.java
Comment thread src/main/java/com/stripe/mpp/methods/tempo/TempoRelay.java Outdated
Comment thread src/main/java/com/stripe/mpp/methods/tempo/TempoRelay.java Outdated
Comment thread src/main/java/com/stripe/mpp/methods/tempo/TempoRelay.java Outdated
Comment thread src/main/java/com/stripe/mpp/server/Verify.java
Comment thread src/main/java/com/stripe/mpp/methods/tempo/TempoDefaults.java
Comment thread src/test/java/com/stripe/mpp/IntegrationTest.java Outdated
@brendanjryan

Copy link
Copy Markdown
Contributor

@codex review

@brendanjryan brendanjryan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread README.md
```java
TempoMethod tempo = TempoMethod.of()
.testnet()
.relay(System.getenv("TEMPO_API_KEY"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 I like this

@bensandler-stripe

Copy link
Copy Markdown
Contributor

Looks good to me also!

@bensandler-stripe
bensandler-stripe merged commit 8e403af into stripe:main Aug 7, 2026
7 checks passed
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.

3 participants