{
  "version": "7.1",
  "data_api_version": "3.0",
  "routing_model": {
    "PAYMENT_CONTACT": [
      "PAYMENT_READY"
    ],
    "PAYMENT_READY": []
  },
  "screens": [
    {
      "id": "PAYMENT_CONTACT",
      "title": "Visa / Mastercard",
      "data": {
        "phone": {
          "type": "string",
          "__example__": "263771234567"
        },
        "message": {
          "type": "string",
          "__example__": "Order ORD-123456\nTotal: USD 25.00"
        }
      },
      "layout": {
        "type": "SingleColumnLayout",
        "children": [
          {
            "type": "Form",
            "name": "contact",
            "init-values": {
              "phone": "${data.phone}"
            },
            "children": [
              {
                "type": "TextHeading",
                "text": "Secure card checkout"
              },
              {
                "type": "TextBody",
                "text": "Pay with Visa or Mastercard. Review your order, then confirm your contact number."
              },
              {
                "type": "TextBody",
                "text": "${data.message}"
              },
              {
                "type": "TextInput",
                "name": "phone",
                "label": "Contact phone number",
                "input-type": "phone",
                "required": true,
                "min-chars": 8,
                "max-chars": 32,
                "helper-text": "Include country code, for example +263771234567."
              },
              {
                "type": "TextCaption",
                "text": "Enter card number, expiry date and CVV only on PesePay\u2019s secure checkout page. Your bank may request payment verification."
              },
              {
                "type": "Footer",
                "label": "Continue to secure pay",
                "on-click-action": {
                  "name": "data_exchange",
                  "payload": {
                    "phone": "${form.phone}"
                  }
                }
              }
            ]
          }
        ]
      }
    },
    {
      "id": "PAYMENT_READY",
      "title": "Ready to pay",
      "terminal": true,
      "success": true,
      "data": {
        "message": {
          "type": "string",
          "__example__": "Your contact number is saved. Return to chat and tap Pay securely to choose Visa or Mastercard on the provider page."
        },
        "completion_value": {
          "type": "string",
          "__example__": "card_flow:example-token"
        }
      },
      "layout": {
        "type": "SingleColumnLayout",
        "children": [
          {
            "type": "TextBody",
            "text": "${data.message}"
          },
          {
            "type": "Footer",
            "label": "Open checkout in chat",
            "on-click-action": {
              "name": "complete",
              "payload": {
                "value": "${data.completion_value}"
              }
            }
          }
        ]
      }
    }
  ]
}
