Skip to content

feat: implement 'requires_escalation' triggered by risk signals#25

Open
0x8000-0000 wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
0x8000-0000:task-ucp-3
Open

feat: implement 'requires_escalation' triggered by risk signals#25
0x8000-0000 wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
0x8000-0000:task-ucp-3

Conversation

@0x8000-0000
Copy link
Contributor

Why:

  • To enable conformance testing of the checkout escalation flow according to spec.
  • Provides a deterministic way to trigger 'requires_escalation' via 'risk_signals' payload in 'complete_checkout'.

What:

  • Removed hardcoded buyer name check.
  • Updated 'complete_checkout' to check for 'simulation_trigger': 'escalation_required' in 'risk_signals'.
  • When triggered, returns 200 OK with status 'requires_escalation', 'continue_url', and 'requires_buyer_input' message, instead of completing the order.

Why:
- To enable conformance testing of the checkout escalation flow according to spec.
- To fix AP2 signature verification logic and missing exceptions which caused tests to fail/pass falsely.

What:
- Updated 'complete_checkout' to check for 'simulation_trigger': 'escalation_required'.
- Added '/recover/{checkout_id}' mock endpoint for 'continue_url'.
- Fixed 'Ap2VerificationError' definition and usage.
- Restored '_verify_ap2_mandate' method.
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.

1 participant