Faça o download e instale o Android Studio se você ainda não o tem instalado.
Adicionar dependências
A API Google Pay faz parte do Google Play Services. Por isso, você só precisa importar a biblioteca do Google Play Services para ter tudo o que precisa.
Ou você pode escolher as APIs que quer compilar.
Para importar toda a biblioteca do Google Play Services, consulte
este link.
Se você preferir compilar seletivamente somente as APIs necessárias, abra o
arquivo build.gradle no módulo do app e adicione o seguinte ao bloco de dependências:
Cada versão fornecida é a mínima necessária para a versão mais recente da
biblioteca da API Google Pay. Seu aplicativo pode escolher uma dependência maior que o valor acima.
Para informações atuais sobre a versão da API Google Pay, consulte Como configurar o Google Play Services.
Para informações atuais sobre bibliotecas de suporte, consulte Configuração da biblioteca de suporte.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2024-10-16 UTC."],[[["To use the Google Pay API, your Android app must be distributed through the Google Play Store and built with a `minSdkVersion` of 21 or higher and a `compileSdkVersion` of 34 or higher."],["Before integrating, ensure you have the Google Wallet app installed, add a payment method, and comply with the Google Pay API Acceptable Use Policy and Google Play Developer Policy."],["Implement payments using Google Play In-app Billing if Google processes payments for you or if you sell digital goods."],["Integrate the Google Pay API by adding the necessary dependency to your app's Gradle build file and enabling it in your `AndroidManifest.xml` file."],["To go live, consult the publishing guide for essential information after completing the integration process."]]],["To utilize the Google Pay API, ensure your app is on the Google Play store and meets `minSdkVersion` 21 and `compileSdkVersion` 34 or higher. Install the Google Wallet app with a payment method. If Google processes payments or you sell digital goods, use Google Play In-app Billing. Add the `com.google.android.gms:play-services-wallet:19.4.0` dependency to your module's Gradle file. In your `AndroidManifest.xml`, enable the API with the `meta-data` element: `com.google.android.gms.wallet.api.enabled` with a value of `true`.\n"]]