From db4c803640aaa24b60be30c7f289af013abe59ad Mon Sep 17 00:00:00 2001 From: Filip Stanis Date: Thu, 26 Oct 2017 16:28:39 +0100 Subject: [PATCH] Bump versions, updated README --- README.md | 24 ++++++++++++++++--- app/build.gradle | 19 ++++++++------- .../android/gms/samples/wallet/Constants.java | 21 +++++++++------- build.gradle | 7 +++--- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 5 files changed, 50 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index d318336..bfc4148 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# paymentsapi-quickstart +# Google Payment API sample app ## Overview -This sample demonstrates basic usage of the Google Payment API. For more -information, visit the following link: +This sample demonstrates basic usage of the Google Payment API. + +The Google Payment API can be used to request any credit or debit card stored in +your customer’s Google account, including their Android Pay credentials. + +For more information, visit the following link: https://developers.google.com/payments/overview @@ -11,3 +15,17 @@ https://developers.google.com/payments/overview Make sure you read the comments in Constants.java and PaymentsUtil.java before you continue. These files **must** be modified prior to running the app, as per the instructions provided in the comments. + +## Requirements + +In order to build and run this sample app, make sure you: + +- Have Android Studio 3.0 or newer installed. +- Have a device running Android 4.4 (KitKat) or newer. +- Have Google Play services version 11.4.0 or newer installed on this device. + +To be able to fully test the API, you will also need to: + +- [Add a payment method to your Google Account](https://support.google.com/payments/answer/6220309). +- [Install and add a payment method to Android Pay](https://support.google.com/androidpay/answer/6289372) (optional). +- Consult your payment processor's documentation to learn about whether they support paying with Google. diff --git a/app/build.gradle b/app/build.gradle index 2cbb9dd..f5f5452 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,10 +2,12 @@ apply plugin: 'com.android.application' android { compileSdkVersion 26 - buildToolsVersion "26.0.0" defaultConfig { applicationId "com.google.android.gms.samples.wallet" - minSdkVersion 26 + + // Google Payment API is not supported in SDK versions lower than 19 + minSdkVersion 19 + targetSdkVersion 26 versionCode 1 versionName "1.0" @@ -20,10 +22,11 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:26.0.2' - compile 'com.google.android.gms:play-services-wallet:11.4.0' - compile 'com.google.android.gms:play-services-tasks:11.4.0' - compile 'com.google.android.gms:play-services-base:11.4.0' - compile 'com.google.android.gms:play-services-basement:11.4.0' + implementation fileTree(dir: 'libs', include: ['*.jar']) + + compile 'com.google.android.gms:play-services:11.4.2' + + // "wallet" is the only module needed for the Google Payment API and this sample app. + // Apps that selectively compile Google Play service APIs need only this dependency. + //compile 'com.google.android.gms:play-services-wallet:11.4.2' } diff --git a/app/src/main/java/com/google/android/gms/samples/wallet/Constants.java b/app/src/main/java/com/google/android/gms/samples/wallet/Constants.java index a1567c7..bb88bfb 100644 --- a/app/src/main/java/com/google/android/gms/samples/wallet/Constants.java +++ b/app/src/main/java/com/google/android/gms/samples/wallet/Constants.java @@ -84,18 +84,21 @@ public class Constants { // The name of your payment processor / gateway. Please refer to their documentation for // more information. - public static final String GATEWAY_TOKENIZATION_NAME = "stripe"; + public static final String GATEWAY_TOKENIZATION_NAME = "REPLACE_ME"; - // Custom parameters required by the processor / gateway. Please refer to your processor's - // documentation for more information. The number of parameters required and their names vary - // depending on the processor. - public static final List> GATEWAY_TOKENIZATION_PARAMETERS = Arrays.asList( - Pair.create("stripe:version", "5"), - Pair.create("stripe:publishableKey", "REPLACE_ME") - ); + // Custom parameters required by the processor / gateway. // In many cases, your processor / gateway will only require a gatewayMerchantId. + // Please refer to your processor's documentation for more information. The number of parameters + // required and their names vary depending on the processor. + public static final List> GATEWAY_TOKENIZATION_PARAMETERS = Arrays.asList( + Pair.create("gatewayMerchantId", "REPLACE_ME") + ); + + // Example configuration when using Stripe as processor. + //public static final String GATEWAY_TOKENIZATION_NAME = "stripe"; //public static final List> GATEWAY_TOKENIZATION_PARAMETERS = Arrays.asList( - // Pair.create("gatewayMerchantId", "REPLACE_ME") + // Pair.create("stripe:version", "5.0.0"), + // Pair.create("stripe:publishableKey", "pk_test_yourstripetestkey") //); // Only used for DIRECT tokenization. Can be removed when using GATEWAY tokenization. diff --git a/build.gradle b/build.gradle index e21267c..e43a388 100644 --- a/build.gradle +++ b/build.gradle @@ -2,10 +2,12 @@ buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' + classpath 'com.android.tools.build:gradle:3.0.0' + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -14,9 +16,8 @@ buildscript { allprojects { repositories { + google() jcenter() - mavenLocal() - maven { url 'https://maven.google.com' } } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f867b54..4bc4ec2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Sep 08 11:03:33 BST 2017 +#Thu Oct 26 16:08:18 BST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip