Skip to content

Commit

Permalink
Merge pull request #87 from clover/r288
Browse files Browse the repository at this point in the history
Release 288
  • Loading branch information
mtomko-clover authored May 20, 2022
2 parents 90e9236 + b6b1f95 commit 82f5331
Show file tree
Hide file tree
Showing 66 changed files with 5,077 additions and 388 deletions.
4 changes: 2 additions & 2 deletions JenkinsConfig.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
# See https://github.corp.clover.com/clover/jenkinsfiles/blob/master/templates/Jenkinsfile.oas-v1.0 for all the specifics.
# There are other configuration settings that can be passed if needed
pipeline_template: templates/Jenkinsfile.clover-libraries-v1.0
pipeline_template: templates/Jenkinsfile.clover-libraries-v2.0
# Add app name and add file to associated app's code repo.
LIBRARY_NAME: clover-android-sdk
REPO_IS_MAVE: "false"
REPO_IS_MAVEN: "false"
REPO_IS_GRADLE: "true"
23 changes: 1 addition & 22 deletions app.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.application'
apply from: file("${project.rootDir}/common.gradle")
apply from: file("${project.rootDir}/signing.gradle")

/**
* Gets the full path of the proguard file specified by `name`.
Expand Down Expand Up @@ -61,30 +60,11 @@ android.applicationVariants.all { variant ->
}

android {
signingConfigs {
releaseSigning {
storeFile project.ext.signing.devKeyFile
storePassword project.ext.signing.cloverStorePassword
keyAlias project.ext.signing.cloverKeyAlias
keyPassword project.ext.signing.cloverKeyPassword
v1SigningEnabled true
v2SigningEnabled false
}

debug {
storeFile project.ext.signing.devKeyFile
storePassword project.ext.signing.cloverStorePassword
keyAlias project.ext.signing.cloverKeyAlias
keyPassword project.ext.signing.cloverKeyPassword
v1SigningEnabled true
v2SigningEnabled false
}
}


buildTypes {
debug {
zipAlignEnabled true
signingConfig signingConfigs.debug

minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
Expand All @@ -105,7 +85,6 @@ android {

releaseSigned {
initWith release
signingConfig signingConfigs.releaseSigning

matchingFallbacks = ['release']
}
Expand Down
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
*/

buildscript {
if (!project.hasProperty('androidBuild')) {
def likelyAndroidBuild = file('../android-build')
if (likelyAndroidBuild.exists()) {
ext.androidBuild = likelyAndroidBuild.absolutePath
} else {
throw new GradleException("Couldn't find android-build at " + likelyAndroidBuild.absolutePath)
}
}

apply from: "${project.rootDir}/deps.gradle"
repositories {
mavenLocal()
Expand Down
3 changes: 1 addition & 2 deletions clover-android-connector-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
* limitations under the License.
*/
group = 'com.clover.sdk'
version = '284'
version = '288'


apply from: file("${project.rootDir}/lib.gradle")
apply from: file("${projectDir}/../common_upload.gradle")

dependencies {
implementation project(':clover-android-sdk')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.clover.sdk.v3.remotepay.SaleRequest;
import com.clover.sdk.v3.remotepay.TipAdjustAuthRequest;
import com.clover.sdk.v3.remotepay.VerifySignatureRequest;
import com.clover.sdk.v3.remotepay.VoidPaymentRequest;
import com.clover.sdk.v3.remotepay.VaultCardRequest;
import com.clover.sdk.v1.configuration.UIConfiguration;
import com.clover.sdk.v3.remotepay.VoidPaymentRefundRequest;

Expand Down Expand Up @@ -215,4 +216,6 @@ interface IPaymentServiceV3 {
* needs to be used cautiously as a last resort
*/
void resetDevice();

void vaultCardWithRequest(in VaultCardRequest request);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.clover.sdk.v3.remotepay;

parcelable VaultCardRequest;
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.clover.sdk.v3.remotepay.TipAdded;
import com.clover.sdk.v3.remotepay.TipAdjustAuthRequest;
import com.clover.sdk.v3.remotepay.TipAdjustAuthResponse;
import com.clover.sdk.v3.remotepay.VaultCardRequest;
import com.clover.sdk.v3.remotepay.VaultCardResponse;
import com.clover.sdk.v3.remotepay.VerifySignatureRequest;
import com.clover.sdk.v3.remotepay.VoidPaymentRefundRequest;
Expand Down Expand Up @@ -783,19 +784,45 @@ protected Object doInBackground(Object[] params) {
*
* @param cardEntryMethods - The card entry methods allowed to capture the payment token. null will provide default values
**/
public void vaultCard(final VaultCardRequest request) {
try {
if (paymentV3Connector != null) {
if (paymentV3Connector.isConnected()) {
paymentV3Connector.getService().vaultCardWithRequest(request);
} else {
this.paymentV3Connector.connect();
waitingTask = new AsyncTask() {
@Override
protected Object doInBackground(Object[] params) {
try {
paymentV3Connector.getService().vaultCardWithRequest(request);
} catch (RemoteException e) {
Log.e(this.getClass().getSimpleName(), " vaultCardWithRequest", e);
}
return null;
}
};
}
}
} catch (IllegalArgumentException e) {
Log.e(this.getClass().getSimpleName(), " vaultCard", e);
} catch (RemoteException e) {
Log.e(this.getClass().getSimpleName(), " vaultCard", e);
}
}
@Override
public void vaultCard(final Integer cardEntryMethods) {
public void vaultCard(final int cem) {
try {
if (paymentV3Connector != null) {
if (paymentV3Connector.isConnected()) {
paymentV3Connector.getService().vaultCard(cardEntryMethods);
paymentV3Connector.getService().vaultCard(cem);
} else {
this.paymentV3Connector.connect();
waitingTask = new AsyncTask() {
@Override
protected Object doInBackground(Object[] params) {
try {
paymentV3Connector.getService().vaultCard(cardEntryMethods);
paymentV3Connector.getService().vaultCard(cem);
} catch (RemoteException e) {
Log.e(this.getClass().getSimpleName(), " vaultCard", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.clover.sdk.v3.remotepay.RetrievePaymentRequest;
import com.clover.sdk.v3.remotepay.SaleRequest;
import com.clover.sdk.v3.remotepay.TipAdjustAuthRequest;
import com.clover.sdk.v3.remotepay.VaultCardRequest;
import com.clover.sdk.v3.remotepay.VerifySignatureRequest;
import com.clover.sdk.v3.remotepay.VoidPaymentRefundRequest;
import com.clover.sdk.v3.remotepay.VoidPaymentRequest;
Expand Down Expand Up @@ -110,7 +111,8 @@ public interface IPaymentConnector extends IDeviceConnector{
*
* @param cardEntryMethods - The card entry methods allowed to capture the payment token. null will provide default values
**/
void vaultCard(Integer cardEntryMethods);
void vaultCard(int vaultCardRequest);
void vaultCard(VaultCardRequest vaultCardRequest);

/**
* Used to request a list of pending payments that have been taken offline, but
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public java.lang.Integer getCardEntryMethods() {
return genClient.cacheGet(CacheKey.cardEntryMethods);
}

public java.lang.String getReadCardMode() {
return genClient.cacheGet(CacheKey.readCardMode);
}

/**
* Identifier for the request
*/
Expand All @@ -76,6 +80,8 @@ private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
requestId
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
readCardMode
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
version
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
;
Expand Down Expand Up @@ -177,6 +183,10 @@ public boolean isNotNullVersion() {
return genClient.cacheValueIsNotNull(CacheKey.version);
}

public boolean isNotNullReadCardMode() {
return genClient.cacheValueIsNotNull(CacheKey.readCardMode);
}



/** Checks whether the 'isForceSwipePinEntry' field has been set, however the value could be null */
Expand All @@ -201,6 +211,9 @@ public boolean hasVersion() {
return genClient.cacheHasKey(CacheKey.version);
}

public boolean hasReadCardMode() {
return genClient.cacheHasKey(CacheKey.readCardMode);
}

/**
* Sets the field 'isForceSwipePinEntry'.
Expand Down Expand Up @@ -232,6 +245,10 @@ public BaseRequest setVersion(java.lang.Integer version) {
return genClient.setOther(version, CacheKey.version);
}

public ReadCardDataRequest setReadCardMode(java.lang.String readCardMode) {
return genClient.setOther(readCardMode, CacheKey.readCardMode);
}


/** Clears the 'isForceSwipePinEntry' field, the 'has' method for this field will now return false */
public void clearIsForceSwipePinEntry() {
Expand All @@ -252,6 +269,10 @@ public void clearVersion() {
genClient.clear(CacheKey.version);
}

public void clearReadCardMode() {
genClient.clear(CacheKey.readCardMode);
}


/**
* Returns true if this instance has any changes.
Expand Down Expand Up @@ -318,6 +339,7 @@ public interface Constraints {
public static final boolean REQUESTID_IS_REQUIRED = false;
public static final long REQUESTID_MAX_LEN = 13;
public static final boolean VERSION_IS_REQUIRED = false;
public static final boolean READ_CARD_MODE_REQUIRED = false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,39 @@
* <h3>Fields</h3>
* <ul>
* <li>{@link #getCardEntryMethods cardEntryMethods}</li>
* <li>{@link #getDataReadMode dataReadMode}</li>
* </ul>
*/
@SuppressWarnings("all")
public class VaultCardRequest extends com.clover.sdk.v3.remotepay.BaseRequest {
public class VaultCardRequest extends BaseRequest {

/**
* Allowed entry methods
*/
public java.lang.Integer getCardEntryMethods() {
public Integer getCardEntryMethods() {
return genClient.cacheGet(CacheKey.cardEntryMethods);
}

/**
* A mode for card details
*/
public String getDataReadMode() {
return genClient.cacheGet(CacheKey.dataReadMode);
}

/**
* Identifier for the request
*/
@Override
public java.lang.String getRequestId() {
public String getRequestId() {
return genClient.cacheGet(CacheKey.requestId);
}

/**
* Identifier for the version
*/
@Override
public java.lang.Integer getVersion() {
public Integer getVersion() {
return genClient.cacheGet(CacheKey.version);
}

Expand All @@ -63,11 +71,13 @@ public java.lang.Integer getVersion() {

private enum CacheKey implements com.clover.sdk.ExtractionStrategyEnum {
cardEntryMethods
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(Integer.class)),
dataReadMode
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
requestId
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.String.class)),
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(String.class)),
version
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(java.lang.Integer.class)),
(com.clover.sdk.extractors.BasicExtractionStrategy.instance(Integer.class)),
;

private final com.clover.sdk.extractors.ExtractionStrategy extractionStrategy;
Expand Down Expand Up @@ -150,6 +160,11 @@ public boolean isNotNullCardEntryMethods() {
return genClient.cacheValueIsNotNull(CacheKey.cardEntryMethods);
}

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

/** Checks whether the 'requestId' field is set and is not null */
@Override
public boolean isNotNullRequestId() {
Expand All @@ -169,6 +184,11 @@ public boolean hasCardEntryMethods() {
return genClient.cacheHasKey(CacheKey.cardEntryMethods);
}

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

/** Checks whether the 'requestId' field has been set, however the value could be null */
@Override
public boolean hasRequestId() {
Expand All @@ -185,23 +205,30 @@ public boolean hasVersion() {
/**
* Sets the field 'cardEntryMethods'.
*/
public VaultCardRequest setCardEntryMethods(java.lang.Integer cardEntryMethods) {
public VaultCardRequest setCardEntryMethods(Integer cardEntryMethods) {
return genClient.setOther(cardEntryMethods, CacheKey.cardEntryMethods);
}

/**
* Sets the field 'dataReadMode'.
*/
public VaultCardRequest setDataReadMode(String dataReadMode) {
return genClient.setOther(dataReadMode, CacheKey.dataReadMode);
}

/**
* Sets the field 'requestId'.
*/
@Override
public BaseRequest setRequestId(java.lang.String requestId) {
public BaseRequest setRequestId(String requestId) {
return genClient.setOther(requestId, CacheKey.requestId);
}

/**
* Sets the field 'version'.
*/
@Override
public BaseRequest setVersion(java.lang.Integer version) {
public BaseRequest setVersion(Integer version) {
return genClient.setOther(version, CacheKey.version);
}

Expand All @@ -210,6 +237,10 @@ public BaseRequest setVersion(java.lang.Integer version) {
public void clearCardEntryMethods() {
genClient.clear(CacheKey.cardEntryMethods);
}
/** Clears the 'dataReadMode' field, the 'has' method for this field will now return false */
public void clearDataReadMode() {
genClient.clear(CacheKey.dataReadMode);
}
/** Clears the 'requestId' field, the 'has' method for this field will now return false */
@Override
public void clearRequestId() {
Expand Down Expand Up @@ -283,6 +314,7 @@ public VaultCardRequest create(org.json.JSONObject jsonObject) {

public interface Constraints {
public static final boolean CARDENTRYMETHODS_IS_REQUIRED = false;
public static final boolean DATAREADMODE_IS_REQUIRED = false;
public static final boolean REQUESTID_IS_REQUIRED = false;
public static final long REQUESTID_MAX_LEN = 13;
public static final boolean VERSION_IS_REQUIRED = false;
Expand Down
Loading

0 comments on commit 82f5331

Please sign in to comment.