Bump versions, updated README

This commit is contained in:
Filip Stanis 2017-10-26 16:28:39 +01:00
parent 9c15e3eeae
commit db4c803640
5 changed files with 50 additions and 25 deletions

View File

@ -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 customers 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.

View File

@ -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'
}

View File

@ -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<Pair<String, String>> 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<Pair<String, String>> 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<Pair<String, String>> 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.

View File

@ -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' }
}
}

View File

@ -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