> For the complete documentation index, see [llms.txt](https://ftcoders.first-tech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/area-do-desenvolvedor/setup-do-sdk.md).

# Setup do SDK

### Implementando o uso do SDK

Após realizar o download do SDK(passo anterior),vamos realizar o setup do Sdk.

Na classe de inicialização do seu projeto (Application), você deve "estender" Application.

Nesta classe, é necessário substituir a variável terminalConfig, que é instanciada a partir da entidade TerminalConfigEntity, considerando os parâmetros fornecidos durante a integração com a First Tech, que são:

```
import android.app.Application

class Application : Application() {

    override fun onCreate() {
        super.onCreate()

        if (!TapOnPhoneInitializer.isApplicationInitAllowed(this)) return

        TapOnPhoneInitializer.initializeTerminal(this)

        TapOnPhoneInitializer.setTerminalConfig(
            TerminalConfigEntity(
                companyDocument = BuildConfig.COMPANY_DOCUMENT,
                companyName = BuildConfig.COMPANY_NAME,
                merchantId = UUID.fromString(BuildConfig.MERCHANT_ID),
                terminalNumber = BuildConfig.TERMINAL_NUMBER,
                clientId = BuildConfig.CLIENT_ID,
                clientSecret = BuildConfig.CLIENT_SECRET,
                sdkScope = BuildConfig.SDK_SCOPE,
                sdkClientId = BuildConfig.SKD_CLIENT_ID,
                sdkClientSecret = BuildConfig.SDK_CLIENT_SECRET,
                appVersion = "1.0.0", //Versão que está o aplicativo atualmente
                packageName = applicationContext.packageName,
                sdkOrganization = "Organization 123", 
                versionCode = (if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
                    packageManager.getPackageInfo(packageName, 0).longVersionCode
                } else {
                    packageManager.getPackageInfo(packageName, 0).versionCode.toLong()
                }).toString()
            )
        )
    }
}
```

* `companyDocument` → CNPJ da sua empresa sem caracteres especiais.
* `companyName` → Nome comercial da sua empresa.
* `merchantId` → UUID fornecido pela First Tech durante o processo de integração. (Nota: Este campo é o objeto UUID do Java.)
* `terminalNumber` → Número do terminal fornecido pela First Tech durante o processo de integração.
* `clientId` → ID do cliente fornecido pela First Tech durante o processo de integração.
* `clientSecret` → Chave do cliente fornecida pela First Tech durante o processo de integração.
* `sdkScope`  -> Client Secret para autenticação, fornecido pela equipe da FirstTech.&#x20;
* `sdkClientId`  ->  Client ID para o SDK, fornecido pela equipe da FirstTech.
* `sdkClientSecret`  -> Client Secret para o SDK, fornecido pela equipe da FirstTech. &#x20;
* `appVersion`   → Número da versão do aplicativo do cliente.
* `packageName`   → Nome do pacote onde o aplicativo do cliente está sendo executado
* `sdkOrganization`   → Este valor é fornecido pela First Tech.
* `versionCode`   → Valor do versionCode da aplicação.<br>

### Valores dos parametros para homologação

`merchantId`   → "1fd50a7b-4eed-4bf4-ba9a-13a2ac353987".  Obs: Esse valor deve ser envolvido para ser convertido em um valo do tipo UUID.  Ex: UUID.fromString("1fd50a7b-4eed-4bf4-ba9a-13a2ac353987")&#x20;

`clientId`   →  "Mqp8O7SyBdwhXT1M4GW6WF26yFimF1Bd"

`clientSecret`   →    "FYM0otn\_8cZczXIOgz4oWKEGuDja2SQqvlNjCdkBsaTw4ylRryebd2xsI\_j6k4Fc"

`sdkScope`   →  "<https://mpptestce.onmicrosoft.com/9c64e445-d90c-4438-91cf-9fe1468ab905/.default>"

`sdkClientId`   →  "f8f999c1-8ba0-48d3-8fc3-1231067125a0"

`sdkClientSecret`   →  "odD8Q\~Msg6agVunBaKQv4etBIIwwDUdtXaYjVbAv"

{% hint style="info" %} <mark style="color:$warning;">Para solicitar valores de credenciais de produção, visite esse tópico.</mark>\
\
[<mark style="color:$warning;">https://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/area-do-desenvolvedor/instrucoes-para-implantacao-do-app-em-producao</mark>](https://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/area-do-desenvolvedor/instrucoes-para-implantacao-do-app-em-producao)\ <br>
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/area-do-desenvolvedor/setup-do-sdk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
