⭐ If you find QWED helpful, consider giving us a star on GitHub!
Integrate QWED-Finance with Universal Commerce Protocol for e-commerce payment verification. Includes capability discovery and .well-known/ucp.json configuration.
from qwed_finance import UCPIntegration ucp = UCPIntegration( max_transaction_amount=100000, allowed_currencies=["USD", "EUR"], require_kyc=True ) # Verify payment token result = ucp.verify_payment_token({ "amount": 15000, "currency": "USD", "customer_country": "US", "kyc_verified": True }) print(result.can_proceed) # True ✅ print(result.status) # PaymentStatus.APPROVED
capability = UCPIntegration.get_capability_definition()
.well-known/ucp.json
{ "business": { "name": "Your Bank", "verification": { "qwed-finance": { "enabled": true, "endpoint": "/api/qwed/verify", "version": "1.0.0", "operations": [ "verify_payment_token", "verify_iso20022_payment", "verify_loan_terms" ] } } } }
# Create middleware middleware = ucp.create_ucp_middleware() # Use in your payment handler @app.post("/ucp/checkout") def checkout(request: UCPRequest): # QWED intercepts verification = middleware({ "action": "payment", "payload": request.payment_token }) if not verification["allowed"]: raise HTTPException(400, verification["violations"]) # Proceed with payment return process_payment(request)
result = ucp.verify_iso20022_payment( xml_message=pacs008_xml, sanctions_list=["ACME Corp", "Bad Bank"] ) if result.can_proceed: send_to_swift(pacs008_xml) else: flag_for_compliance(result.violations)
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Checkout │────▶│ QWED │────▶│ Payment │ │ Request │ │ Verify │ │ Gateway │ └─────────────┘ └─────────────┘ └─────────────┘ │ ┌──────┴──────┐ │ Checks: │ │ • Amount │ │ • Currency │ │ • AML │ │ • KYC │ │ • Sanctions │ └─────────────┘
result = ucp.verify_payment_token(token_data) for receipt in result.receipts: print(f"Receipt: {receipt.receipt_id}") print(f" Guard: {receipt.guard_name}") print(f" Hash: {receipt.input_hash}")
Contact support