Skip to content

Commit

Permalink
Merge pull request #71 from clover/r228.3
Browse files Browse the repository at this point in the history
Release 228.3
  • Loading branch information
Dusty Gutzmann authored Aug 9, 2019
2 parents 34e3087 + ed3630f commit 24fadb6
Show file tree
Hide file tree
Showing 257 changed files with 8,668 additions and 36,358 deletions.
90 changes: 90 additions & 0 deletions app.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
apply plugin: 'com.android.application'

apply from: file("${project.rootDir}/common.gradle")
//apply from: file("${project.rootDir}/signing.gradle")
apply from: file("${project.rootDir}/versions.gradle")

/**
* Gets the full path of the proguard file specified by `name`.
*
* The current options are:
* proguard-clover-apps.txt
*/
ext.getCommonProguardFile = { name ->
def fileName = "${androidBuild}/$name"
if (!new File(fileName).exists()) {
throw new IllegalArgumentException("'$name' is not a valid proguard config file")
}
return fileName
}

def manifestFile = new File(project.projectDir, '/src/main/AndroidManifest.xml')

def getPackage = { ->
def parser = new groovy.util.XmlParser(false, true)
def rootNode = parser.parse(manifestFile)
def attributes = rootNode.attributes()
def pkg = attributes['package']
return pkg
}

def getVersionCode = { ->
def code = project.hasProperty('versionCode') ? versionCode.toInteger() : 32000
return code
}

def getVersionName = { ->
def ns = new groovy.xml.Namespace('http://schemas.android.com/apk/res/android', 'ns')
def parser = new groovy.util.XmlParser(false, true)
def rootNode = parser.parse(manifestFile)
def attributes = rootNode.attributes()
def baseCode = attributes[ns.versionName] ?: '1.0'
def name = baseCode + "-" + getVersionCode()
return name;
}

def releaseBuildTypes = ['release', 'releaseSigned']

android.applicationVariants.all { variant ->
if (releaseBuildTypes.contains(buildType.name)) {
String pkg = getPackage()
if (!variant.productFlavors.empty) {
logger.warn('There are product flavors in the project, going to use package names from their override')
if (variant.productFlavors.get(0).applicationId != null) {
pkg = variant.productFlavors.get(0).applicationId
}
}

String versionName = getVersionName()
variant.outputs.all { output ->
outputFileName = new File(output.outputFile.name.replace(project.archivesBaseName, "${pkg}-${versionName}"))
}
}
}

android {
compileSdkVersion COMPILE_SDK_VERSION
buildToolsVersion BUILD_TOOLS_VERSION
useLibrary HTTP_LIBRARY

defaultConfig {
versionCode getVersionCode()
versionName getVersionName()

minSdkVersion MIN_SDK_VERSION
targetSdkVersion TARGET_SDK_VERSION
}

packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}

lintOptions {
abortOnError false
}

dexOptions {
preDexLibraries = Boolean.valueOf(System.getProperty("androidPreDex", "true"))
}
}
2 changes: 1 addition & 1 deletion clover-android-connector-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
group = 'com.clover.sdk'
version = '221.9'
version = '228.3'


apply from: file("${project.rootDir}/lib.gradle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,10 @@ public PaymentConnector(Context context, Account account, IPaymentConnectorListe
addCloverConnectorListener(paymentConnectorListener);
}

if (remoteApplicationId == null || remoteApplicationId.isEmpty()) {
try {
Toast.makeText(context, "Warning! No remote application ID provided!", Toast.LENGTH_LONG).show();
} catch (Exception e) {
//most likely did not run on UI thread
Log.e(this.getClass().getSimpleName(), "Tried to make a Toast on non UI Thread", e);
}
}
connectToPaymentService(context, account, remoteApplicationId);
}

private void connectToPaymentService(final Context context, Account account, String remoteApplicationId) {
private void connectToPaymentService(final Context context, Account account, final String remoteApplicationId) {
if (paymentV3Connector == null) {
paymentV3Connector = new PaymentV3Connector(context, account, new ServiceConnector.OnServiceConnectedListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Autogenerated by Avro
*
*
* DO NOT EDIT DIRECTLY
*/

Expand Down Expand Up @@ -33,6 +33,8 @@
* <ul>
* <li>{@link #getAmount amount}</li>
* <li>{@link #getPaymentId paymentId}</li>
* <li>{@link #getExternalId externalId}</li>
* <li>{@link #getTipAmount tipAmount}</li>
* </ul>
*/
@SuppressWarnings("all")
Expand All @@ -52,6 +54,20 @@ public java.lang.String getPaymentId() {
return genClient.cacheGet(CacheKey.paymentId);
}

/**
* An id that will be persisted with transactions.
*/
public java.lang.String getExternalId() {
return genClient.cacheGet(CacheKey.externalId);
}

/**
* Included tip
*/
public java.lang.Long getTipAmount() {
return genClient.cacheGet(CacheKey.tipAmount);
}




Expand All @@ -68,14 +84,26 @@ public Object extractValue(PendingPaymentEntry instance) {
return instance.genClient.extractOther("paymentId", java.lang.String.class);
}
},
;
externalId {
@Override
public Object extractValue(PendingPaymentEntry instance) {
return instance.genClient.extractOther("externalId", java.lang.String.class);
}
},
tipAmount {
@Override
public Object extractValue(PendingPaymentEntry instance) {
return instance.genClient.extractOther("tipAmount", java.lang.Long.class);
}
},
;
}

private GenericClient<PendingPaymentEntry> genClient;

/**
* Constructs a new empty instance.
*/
* Constructs a new empty instance.
*/
public PendingPaymentEntry() {
genClient = new GenericClient<PendingPaymentEntry>(this);
}
Expand All @@ -86,8 +114,8 @@ protected GenericClient getGenericClient() {
}

/**
* Constructs a new empty instance.
*/
* Constructs a new empty instance.
*/
protected PendingPaymentEntry(boolean noInit) {
genClient = null;
}
Expand Down Expand Up @@ -147,6 +175,16 @@ public boolean isNotNullPaymentId() {
return genClient.cacheValueIsNotNull(CacheKey.paymentId);
}

/** Checks whether the 'externalId' field is set and is not null */
public boolean isNotNullExternalId() {
return genClient.cacheValueIsNotNull(CacheKey.externalId);
}

/** Checks whether the 'tipAmount' field is set and is not null */
public boolean isNotNullTipAmount() {
return genClient.cacheValueIsNotNull(CacheKey.tipAmount);
}



/** Checks whether the 'amount' field has been set, however the value could be null */
Expand All @@ -159,6 +197,16 @@ public boolean hasPaymentId() {
return genClient.cacheHasKey(CacheKey.paymentId);
}

/** Checks whether the 'externalId' field has been set, however the value could be null */
public boolean hasExternalId() {
return genClient.cacheHasKey(CacheKey.externalId);
}

/** Checks whether the 'tipAmount' field has been set, however the value could be null */
public boolean hasTipAmount() {
return genClient.cacheHasKey(CacheKey.tipAmount);
}


/**
* Sets the field 'amount'.
Expand All @@ -174,6 +222,20 @@ public PendingPaymentEntry setPaymentId(java.lang.String paymentId) {
return genClient.setOther(paymentId, CacheKey.paymentId);
}

/**
* Sets the field 'externalId'.
*/
public PendingPaymentEntry setExternalId(java.lang.String externalId) {
return genClient.setOther(externalId, CacheKey.externalId);
}

/**
* Sets the field 'tipAmount'.
*/
public PendingPaymentEntry setTipAmount(java.lang.Long tipAmount) {
return genClient.setOther(tipAmount, CacheKey.tipAmount);
}


/** Clears the 'amount' field, the 'has' method for this field will now return false */
public void clearAmount() {
Expand All @@ -183,6 +245,14 @@ public void clearAmount() {
public void clearPaymentId() {
genClient.clear(CacheKey.paymentId);
}
/** Clears the 'externalId' field, the 'has' method for this field will now return false */
public void clearExternalId() {
genClient.clear(CacheKey.externalId);
}
/** Clears the 'tipAmount' field, the 'has' method for this field will now return false */
public void clearTipAmount() {
genClient.clear(CacheKey.tipAmount);
}


/**
Expand Down Expand Up @@ -245,6 +315,8 @@ public interface Constraints {
public static final boolean AMOUNT_IS_REQUIRED = false;
public static final boolean PAYMENTID_IS_REQUIRED = false;
public static final long PAYMENTID_MAX_LEN = 13;
public static final boolean EXTERNALID_IS_REQUIRED = false;
public static final boolean TIPAMOUNT_IS_REQUIRED = false;

}

Expand Down
Loading

0 comments on commit 24fadb6

Please sign in to comment.