<mxfile host="app.diagrams.net" agent="ApiPay Hub docs-portal" type="device" version="24.7.17">
  <diagram id="apipay-contexto-sistema" name="Contexto del sistema">
    <mxGraphModel dx="1400" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="826" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />

        <mxCell id="lay-actores" value="Personas y sistemas del comercio" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#9E9E9E;dashed=1;dashPattern=8 8;verticalAlign=top;align=left;spacingLeft=10;spacingTop=6;fontColor=#1A1A1A;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="280" height="400" as="geometry" />
        </mxCell>
        <mxCell id="lay-hub" value="ApiPay Hub - los cuatro dominios" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#9E9E9E;dashed=1;dashPattern=8 8;verticalAlign=top;align=left;spacingLeft=10;spacingTop=6;fontColor=#1A1A1A;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="420" y="60" width="320" height="520" as="geometry" />
        </mxCell>
        <mxCell id="lay-gw" value="Pasarelas externas" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#9E9E9E;dashed=1;dashPattern=8 8;verticalAlign=top;align=left;spacingLeft=10;spacingTop=6;fontColor=#1A1A1A;fontSize=13;fontStyle=1" vertex="1" parent="1">
          <mxGeometry x="840" y="60" width="280" height="195" as="geometry" />
        </mxCell>

        <mxCell id="buyer" value="Comprador&lt;br&gt;navegador" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#FFF8E1;strokeColor=#F9A825;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="110" width="240" height="60" as="geometry" />
        </mxCell>
        <mxCell id="merchant" value="Comercio&lt;br&gt;frontend propio + backend propio&lt;br&gt;(el tenant)" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#FFF8E1;strokeColor=#F9A825;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="200" width="240" height="90" as="geometry" />
        </mxCell>
        <mxCell id="operator" value="Operador del hub&lt;br&gt;PLATFORM_ADMIN&lt;br&gt;TENANT_ADMIN&lt;br&gt;TENANT_ANALYST" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#FFF8E1;strokeColor=#F9A825;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="60" y="330" width="240" height="100" as="geometry" />
        </mxCell>

        <mxCell id="api" value="api.apipay.io&lt;br&gt;payment-api - REST /v1&lt;br&gt;auth: header X-API-Key con sk_" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="440" y="110" width="280" height="90" as="geometry" />
        </mxCell>
        <mxCell id="checkout" value="checkout.apipay.io&lt;br&gt;checkout-widget en iframe&lt;br&gt;auth: pk_ + header X-Client-Secret" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="440" y="225" width="280" height="90" as="geometry" />
        </mxCell>
        <mxCell id="admin" value="admin.apipay.io&lt;br&gt;backoffice + admin-api&lt;br&gt;auth: JWT de Azure AD B2C" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="440" y="340" width="280" height="90" as="geometry" />
        </mxCell>
        <mxCell id="docs" value="docs.apipay.io&lt;br&gt;docs-portal - estatico&lt;br&gt;sin backend y sin datos de tenants" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#E3F2FD;strokeColor=#1565C0;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="440" y="455" width="280" height="90" as="geometry" />
        </mxCell>

        <mxCell id="webpay" value="Transbank Webpay Plus&lt;br&gt;via Servipag" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#F3E5F5;strokeColor=#6A1B9A;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="860" y="110" width="240" height="60" as="geometry" />
        </mxCell>
        <mxCell id="mercadopago" value="MercadoPago" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#F3E5F5;strokeColor=#6A1B9A;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="860" y="185" width="240" height="50" as="geometry" />
        </mxCell>

        <mxCell id="b2c" value="Azure AD B2C&lt;br&gt;OIDC - authorization code + PKCE" style="rounded=1;arcSize=12;whiteSpace=wrap;html=1;fillColor=#F3E5F5;strokeColor=#6A1B9A;fontColor=#1A1A1A;fontSize=11" vertex="1" parent="1">
          <mxGeometry x="40" y="500" width="280" height="80" as="geometry" />
        </mxCell>

        <mxCell id="nota-pci" value="Frontera PCI DSS SAQ A: el PAN y el CVV se digitan en los hosted fields o en la pagina de la pasarela, y viajan del navegador del comprador directo a ella. Ningun componente de ApiPay los acepta, transporta, guarda ni registra." style="shape=note;size=14;whiteSpace=wrap;html=1;fillColor=#FFFDE7;strokeColor=#F9A825;fontColor=#1A1A1A;fontSize=10;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2" vertex="1" parent="1">
          <mxGeometry x="840" y="380" width="280" height="120" as="geometry" />
        </mxCell>
        <mxCell id="nota-webhooks" value="Los webhooks salientes los entrega webhook-dispatcher, un worker sin HTTP publico que no aparece a este nivel de detalle: se ve en el diagrama de contenedores." style="shape=note;size=14;whiteSpace=wrap;html=1;fillColor=#FFFDE7;strokeColor=#F9A825;fontColor=#1A1A1A;fontSize=10;align=left;verticalAlign=top;spacingLeft=6;spacingTop=2" vertex="1" parent="1">
          <mxGeometry x="840" y="520" width="280" height="100" as="geometry" />
        </mxCell>

        <mxCell id="e-buyer-merchant" value="navega el checkout del comercio" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0" edge="1" parent="1" source="buyer" target="merchant">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-buyer-checkout" value="paga dentro del iframe del widget" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.3;entryDx=0;entryDy=0" edge="1" parent="1" source="buyer" target="checkout">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-merchant-api" value="crea, confirma y consulta intents" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0" edge="1" parent="1" source="merchant" target="api">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-merchant-docs" value="lee guias, referencia y recetas" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=1;exitY=0.85;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0" edge="1" parent="1" source="merchant" target="docs">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-operator-admin" value="configura pasarelas y revisa entregas" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0" edge="1" parent="1" source="operator" target="admin">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-operator-b2c" value="inicia sesion" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0" edge="1" parent="1" source="operator" target="b2c">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-admin-b2c" value="valida el JWT contra JWKS" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=0;exitY=0.85;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0" edge="1" parent="1" source="admin" target="b2c">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="380" y="401" />
              <mxPoint x="380" y="540" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e-checkout-api" value="GET y confirm del intent propio" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=0.75;exitY=0;exitDx=0;exitDy=0;entryX=0.75;entryY=1;entryDx=0;entryDy=0" edge="1" parent="1" source="checkout" target="api">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-api-webpay" value="init y commit de la transaccion" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=1;exitY=0.55;exitDx=0;exitDy=0;entryX=0;entryY=0.4;entryDx=0;entryDy=0" edge="1" parent="1" source="api" target="webpay">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-api-mp" value="pagos y refunds" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=1;exitY=0.85;exitDx=0;exitDy=0;entryX=0;entryY=0.4;entryDx=0;entryDy=0" edge="1" parent="1" source="api" target="mercadopago">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e-mp-api" value="webhook firmado entrante" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#455A64;fontColor=#1A1A1A;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=0;exitY=0.8;exitDx=0;exitDy=0;entryX=1;entryY=0.9;entryDx=0;entryDy=0" edge="1" parent="1" source="mercadopago" target="api">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="790" y="225" />
              <mxPoint x="790" y="191" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e-api-merchant" value="webhooks salientes firmados&lt;br&gt;con ApiPay-Signature" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;strokeColor=#2E7D32;fontColor=#1B5E20;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=0;exitY=0.15;exitDx=0;exitDy=0;entryX=1;entryY=0.25;entryDx=0;entryDy=0" edge="1" parent="1" source="api" target="merchant">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="370" y="124" />
              <mxPoint x="370" y="223" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="e-pci" value="PAN y CVV solo aqui" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;dashed=1;strokeColor=#C62828;fontColor=#B71C1C;fontSize=10;labelBackgroundColor=#FFFFFF;endArrow=block;endFill=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0" edge="1" parent="1" source="buyer" target="lay-gw">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="180" y="20" />
              <mxPoint x="980" y="20" />
            </Array>
          </mxGeometry>
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
