Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
28b7eb1
docs: design merchant-first CLI experience
salismidtrans Jul 26, 2026
74f159d
docs: plan merchant CLI rollout
salismidtrans Jul 26, 2026
0e61627
feat: discover Midtrans projects from nested directories
salismidtrans Jul 26, 2026
14f4a59
feat: resolve project context for CLI commands
salismidtrans Jul 26, 2026
3b68121
fix: limit inspection to merchant source files
salismidtrans Jul 26, 2026
5f27fe9
docs: place agent parity checks in namespace task
salismidtrans Jul 26, 2026
b6920b4
feat: model merchant integration readiness
salismidtrans Jul 26, 2026
3a352a7
fix: keep pack findings opaque in readiness
salismidtrans Jul 26, 2026
27f5b62
feat: render actionable merchant command output
salismidtrans Jul 26, 2026
4700e4f
feat: add merchant project status dashboard
salismidtrans Jul 26, 2026
a137a4b
feat: add safe interactive Sandbox setup
salismidtrans Jul 26, 2026
458a11c
feat: separate merchant and agent command surfaces
salismidtrans Jul 26, 2026
a260422
fix: guide legacy sandbox and pack aliases
salismidtrans Jul 26, 2026
3ea51c2
docs: clarify mapped alias migration guidance
salismidtrans Jul 26, 2026
15bb41f
feat: add merchant Sandbox checkout command
salismidtrans Jul 26, 2026
43ab65e
feat: add merchant webhook verification command
salismidtrans Jul 26, 2026
2d481ff
build: install and verify the merchant CLI locally
salismidtrans Jul 26, 2026
888d4b2
fix: reject unsafe local install targets
salismidtrans Jul 26, 2026
1d7fae3
fix: harden merchant CLI readiness and project errors
salismidtrans Jul 26, 2026
32ce39e
fix: advertise evidence schema in CLI handshake
salismidtrans Jul 26, 2026
d8614ac
docs: design multi-product CLI parity
salismidtrans Jul 26, 2026
6bd2583
docs: assign subscription parity ownership
salismidtrans Jul 26, 2026
ffa0283
docs: plan multi-product CLI implementation
salismidtrans Jul 26, 2026
d7b1601
feat: introduce hybrid Midtrans manifest
salismidtrans Jul 27, 2026
0953dbe
fix: tighten hybrid manifest validation
salismidtrans Jul 27, 2026
fe99fea
feat: resolve typed credential references safely
salismidtrans Jul 27, 2026
870439e
fix: require configured checkout credentials
salismidtrans Jul 27, 2026
c1c777d
feat: add resumable payment journey engine
salismidtrans Jul 27, 2026
7192ca9
fix: tighten journey persistence invariants
salismidtrans Jul 27, 2026
a76b6f5
fix: prevent journey run overwrite on blocked plans
salismidtrans Jul 27, 2026
9f35b80
feat: expose generic merchant payment journeys
salismidtrans Jul 27, 2026
f1171e9
fix: tighten generic journey execution semantics
salismidtrans Jul 27, 2026
17133fa
fix: harden generic journey result envelopes
salismidtrans Jul 27, 2026
d37598f
fix: preserve merchant intent command identities
salismidtrans Jul 27, 2026
76ffb24
feat: deliver Snap web and mobile journeys
salismidtrans Jul 27, 2026
f4123d1
docs: finalize task 5 report
salismidtrans Jul 27, 2026
5e12b84
fix: harden Snap mobile proof gating
salismidtrans Jul 27, 2026
2022bd0
fix: classify App Router Midtrans routes as backend
salismidtrans Jul 27, 2026
17d9d8b
feat: add classic Core API journeys
salismidtrans Jul 27, 2026
1c04fbb
fix: resolve coreapi runtime credentials
salismidtrans Jul 27, 2026
4124a90
feat: add Payment Link journeys
salismidtrans Jul 27, 2026
ca55bde
fix: restore payment link resume and routing
salismidtrans Jul 27, 2026
9188f70
docs: finalize task 7 fix report
salismidtrans Jul 27, 2026
59d5422
docs: correct BI-SNAP status method
salismidtrans Jul 27, 2026
cf7e97f
feat: implement BI-SNAP protocol security
salismidtrans Jul 27, 2026
2ba3673
fix: align BI-SNAP signing and headers
salismidtrans Jul 27, 2026
9d58117
feat: add BI-SNAP payment journeys
salismidtrans Jul 27, 2026
fc00adf
fix: require BI-SNAP evidence for status verification
salismidtrans Jul 27, 2026
de61d25
fix: tighten BI-SNAP evidence bindings
salismidtrans Jul 27, 2026
282af91
feat: add GoPay tokenization journeys
salismidtrans Jul 27, 2026
e56efbc
fix: align GoPay tokenization contracts
salismidtrans Jul 27, 2026
628d497
fix: tighten GoPay auth code contracts
salismidtrans Jul 27, 2026
710d0dc
feat: add subscription lifecycle journeys
salismidtrans Jul 27, 2026
ff9b844
feat: add Core API recurring verification
salismidtrans Jul 27, 2026
e89e209
feat: add BI-SNAP recurring verification
salismidtrans Jul 27, 2026
03668bf
feat: add GoPay recurring verification
salismidtrans Jul 27, 2026
5b7c12d
fix: align subscription lifecycle contracts
salismidtrans Jul 27, 2026
606fd3b
fix: verify subscription mutation targets
salismidtrans Jul 27, 2026
d94b80c
fix: require subscription update amount
salismidtrans Jul 27, 2026
4c5b3b5
feat: aggregate hybrid journey evidence
salismidtrans Jul 27, 2026
e2b795f
feat: enforce sandbox-only journey execution
salismidtrans Jul 27, 2026
2d5cd60
fix: compile journey proof requirements
salismidtrans Jul 27, 2026
ef63f51
fix: block journeys without proof policy
salismidtrans Jul 27, 2026
0f6b529
test: enforce per-product Agent Skill parity
salismidtrans Jul 27, 2026
ee71b54
docs: record Agent Skill parity review
salismidtrans Jul 27, 2026
61acc53
test: add multi-product merchant evaluations
salismidtrans Jul 27, 2026
c5e264e
test: prove multi-product merchant CLI parity
salismidtrans Jul 27, 2026
3c2ed55
style: format payment pack sources
salismidtrans Jul 27, 2026
4bc8680
fix: compile GoPay journey proof policies
salismidtrans Jul 27, 2026
46a7c25
fix: distinguish provider confirmation from proof
salismidtrans Jul 27, 2026
7df1c03
fix: complete compiled verification policies
salismidtrans Jul 27, 2026
cbda770
fix: hash canonical Midtrans Markdown sources
salismidtrans Jul 27, 2026
0ae51e2
fix: require complete proof policy for verified state
salismidtrans Jul 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Task 1 Report

### Scope delivered

- Replaced the old Snap-only experimental manifest with the clean public hybrid schema in Go and JSON schema form.
- Reset `midtrans init` output to a neutral sandbox-only manifest with empty `credential_sets`, `integrations`, `routing`, and `verification.required`.
- Updated `midtrans setup`, readiness/status paths, Snap pack evaluation, and local verification helpers to read the new manifest shape directly without migration compatibility.
- Converted direct fixtures and tests to the clean manifest constructors and updated merchant fixture manifests to the new public shape.

### TDD evidence

1. Added `TestLoadHybridManifest` and `TestCleanManifest` in `internal/manifest/manifest_test.go`.
2. Verified RED with:

```sh
go test ./internal/manifest ./internal/app -run 'TestLoadHybridManifest|TestCleanManifest' -count=1
```

Initial failure: the old `manifest.Manifest` lacked `Routing`, `Integrations`, and `IntegrationFor`.
3. Implemented the clean schema and dependent refactors.
4. Verified GREEN with the same focused command.

### Verification

```sh
go test ./internal/manifest ./internal/app -count=1
go test ./internal/readiness ./packs/snap -count=1
go test ./... -count=1
```

All commands passed on July 27, 2026.

### Notes

- No migration shim was retained for the removed Snap-only manifest shape.
- Remote webhook allowlists were not reintroduced into the clean public manifest; replay remains constrained by the existing policy layer until a later task defines that product-pack surface explicitly.

## Fix Round 1

### Review items addressed

- Tightened `file:./...` credential-reference validation to reject traversal-like and malformed project-relative paths such as `file:./../outside-secret`, absolute paths, and empty path segments, without implementing Task 2 runtime file resolution.
- Required supported non-empty credential-set types and sandbox environment values, and enforced type-appropriate required references for `classic` and `bisnap` consistently in Go validation and JSON schema.
- Required `application.payment_state.paid` and `application.payment_state.terminal` to contain at least one unique non-empty state in both Go validation and JSON schema.

### Added or adjusted tests

- Expanded `TestCleanManifest` with malformed `file:` reference cases.
- Added `TestValidateRejectsInvalidCredentialSetDefinitions`.
- Added `TestValidateRejectsEmptyPaymentStateArrays`.
- Added `TestManifestSchemaRequiresCredentialSetTypeAndPaymentStates`.

### Commands run

```sh
go test ./internal/manifest ./internal/app -count=1
go test ./... -count=1
```

### Results

- `go test ./internal/manifest ./internal/app -count=1` passed on July 27, 2026.
- `go test ./... -count=1` passed on July 27, 2026.
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Task 10 Report

Date: 2026-07-27

## Outcome

Implemented the new `gopay-tokenization` pack and registered it in the CLI.
The pack now covers:

- `gopay-tokenization.account-linking`
- `gopay-tokenization.binding-inquiry`
- `gopay-tokenization.wallet-payment`
- `gopay-tokenization.paylater`
- `gopay-tokenization.unlink`

## What Changed

- Added `packs/gopaytokenization/pack.go` with descriptor, capabilities, journeys, sandbox hosts, sensitive keys, and public-source declarations.
- Added `packs/gopaytokenization/client.go` with BI-SNAP-backed signing/access-token infrastructure and request builders for:
- GET auth code on `merchants-app.sbx.midtrans.com`
- POST `/v1.0/registration-account-binding`
- POST `/v1.0/registration-account-inquiry`
- POST `/v1.0/registration-account-unbinding`
- POST `/v1.0/debit/payment-host-to-host`
- Added `packs/gopaytokenization/journey.go` with:
- account-link planning and resume gating via state hash plus auth-code reference
- binding inquiry
- tokenized wallet and GoPayLater payment flows
- active payment-option selection in memory only
- inquiry immediately before payment with rotated customer token use
- unlink flow with merchant-state-clearing evidence requirement
- Added `packs/gopaytokenization/seamless.go` for `/v1.0/registration-account/notify` route metadata and signature verification wiring.
- Registered the pack in [cmd/midtrans/main.go](/Users/salis/Goto/Code/midtrans/codex/midtrans-cli-merchant-experience/cmd/midtrans/main.go).
- Updated [contracts/capabilities-v1.json](/Users/salis/Goto/Code/midtrans/codex/midtrans-cli-merchant-experience/contracts/capabilities-v1.json), [contracts/public-sources-v1.json](/Users/salis/Goto/Code/midtrans/codex/midtrans-cli-merchant-experience/contracts/public-sources-v1.json), and [internal/sourceprovenance/catalog.go](/Users/salis/Goto/Code/midtrans/codex/midtrans-cli-merchant-experience/internal/sourceprovenance/catalog.go).
- Updated [internal/app/app_test.go](/Users/salis/Goto/Code/midtrans/codex/midtrans-cli-merchant-experience/internal/app/app_test.go) so the runtime capability contract tests include the new pack.

## Validation

RED checkpoint:

```sh
go test ./packs/gopaytokenization -count=1
```

Initial result: failed because the package had only tests and no production Go files.

Focused validation:

```sh
go test ./packs/gopaytokenization ./packs/bisnap ./internal/app -count=1
go test ./internal/sourceprovenance ./internal/app ./packs/gopaytokenization -count=1
```

Result: passed.

## Fix Round 2

Addressed the remaining critical Get Auth Code and source-provenance corrections:

- Added mandatory `state` query binding equal to the generated state hash.
- Switched `seamlessData` from compact JSON to deterministic URL-form encoding:
- `mobileNumber=<resolved number>&paymentType=gopay`
- Switched `seamlessSign` from client-secret HMAC to Base64 `SHA256withRSA` over the exact raw `seamlessData` string using the configured merchant private key.
- Added GoPay signature helper coverage with a fixed vector for PKCS#8 private-key signing.
- Added typed `journey.Input.MobileNumberReference` and CLI `--mobile-number-reference` on merchant and agent journey surfaces.
- Required `mobile_number_reference` for GoPay account-link planning and execution.
- Ensured the mobile number reference and resolved mobile number never enter SafeData, operation storage, or evidence.
- Corrected GoPay source URLs to the exact working official slugs:
- `get-auth-code-api`
- `binding-api`
- `binding-inquiry-api`
- `direct-debit-api-gopay-tokenization`
- `unbind-api`
- `account-linking-unlinking-notification`
- Regenerated the public-source baseline so the GoPay entries now carry non-empty valid SHA-256 digests.

Fix-round validation:

```sh
go test ./packs/gopaytokenization ./internal/app ./internal/manifest ./internal/sourceprovenance -count=1
go test ./... -count=1
```

Result: passed.

Full validation:

```sh
go test ./... -count=1
```

Result: passed.

## Behavioral Guarantees Now Covered

- Auth-code flow uses the merchant-app sandbox host.
- Binding, inquiry, unbinding, and tokenized payment hit the required BI-SNAP paths.
- Tokenized payment sends `Authorization-Customer`; one-time access-token exchange does not.
- Inquiry runs immediately before payment.
- Rotated active option/customer token data is used in-memory for payment only.
- GoPayLater requires an active `PAY_LATER` option.
- Account-link persistence stores only safe state references.
- Auth code, customer authorization token, payment-option token, and authorization references are not persisted or rendered in safe data.

## Commit

Planned commit message: `feat: add GoPay tokenization journeys`

## Fix Round 1

Addressed the official-contract corrections from reviewer follow-up:

- Corrected Get Auth Code to `GET https://merchants-app.sbx.midtrans.com/v1.0/get-auth-code`.
- Switched binding, inquiry, unbind, and payment to `https://merchants.sbx.midtrans.com`.
- Added a distinct manifest credential reference `merchant_id` for GoPay tokenization credential sets.
- Bound account-link state through deterministic compact `seamlessData` JSON plus `seamlessSign`.
- Corrected binding body to include `merchantId`, `authCode`, and `grantType: AUTHORIZATION_CODE`.
- Corrected binding response parsing to `accessTokenInfo.accessToken`.
- Corrected inquiry response parsing to `additionalInfo.accessToken` and `additionalInfo.paymentOptions[] {name, active, token}`.
- Corrected tokenized payment body to include `chargeToken`, `urlParams`, and `payOptionDetails[]` with nested `additionalInfo.paymentOptionToken`.
- Removed credential references from GoPay SafeData and persisted operation records.
- Required exact `auth_code_reference_hash` plus `state_hash` proof binding for account-link resume.
- Added unlink fallback inquiry handling for ambiguous unbind attempts.
- Replaced GoPay public-source URLs with the reviewer-specified official page set.

Fix-round validation:

```sh
go test ./packs/gopaytokenization ./packs/bisnap ./internal/app ./internal/manifest ./internal/sourceprovenance -count=1
go test ./... -count=1
```

Result: passed.
Loading