Skip to content

Commit

Permalink
Merge pull request #99 from clover/r306
Browse files Browse the repository at this point in the history
Release 306
  • Loading branch information
mtomko-clover authored Jan 11, 2024
2 parents 5694017 + a5ae2f9 commit 1925853
Show file tree
Hide file tree
Showing 34 changed files with 2,305 additions and 84 deletions.
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 = '304'
version = '306'


apply from: file("${project.rootDir}/lib.gradle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,14 @@ interface IPaymentServiceV3 {
void resetDevice();

void vaultCardWithRequest(in VaultCardRequest request);

/**
* PreAuth method to obtain a Pre-Auth for a card, with high availability.
* When using preAuthV2, you might not be able to capture immediately by using this method.
* The client will have to wait for the order to sync for the capture to be successful.
* The Authorization request(%s/v3/merchants/%s/authorizations) can be skipped on the client and will be handled by the server.
*
* @param request -
**/
void preAuthV2(in PreAuthRequest request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,42 @@ protected Object doInBackground(Object[] objects) {
}
}

/**
* PreAuth method to obtain a Pre-Auth for a card
*
* @param request -
**/
@Override
public void preAuthV2(final PreAuthRequest request) {
try {
if (request != null) {
request.setVersion(2); // this version supports validation
}
if (paymentV3Connector != null) {
if (paymentV3Connector.isConnected()) {
paymentV3Connector.getService().preAuthV2(request);
} else {
this.paymentV3Connector.connect();
waitingTask = new AsyncTask() {
@Override
protected Object doInBackground(Object[] params) {
try {
paymentV3Connector.getService().preAuthV2(request);
} catch (RemoteException e) {
Log.e(this.getClass().getSimpleName(), " preAuthV2", e);
}
return null;
}
};
}
}
} catch (IllegalArgumentException e) {
Log.e(this.getClass().getSimpleName(), " preAuthV2", e);
} catch (RemoteException e) {
Log.e(this.getClass().getSimpleName(), " preAuthV2", e);
}
}

public static String getAppVersion(Context context) {
String version = "Unknown";
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,13 @@ public interface IPaymentConnector extends IDeviceConnector{
* needs to be used cautiously as a last resort
*/
void resetDevice();
}

/**
* PreAuth method to obtain a Pre-Auth for a card, with high availability.
* When using preAuthV2, you might not be able to capture immediately by using this method.
* The client will have to wait for the order to sync for the capture to be successful.
* The Authorization request(%s/v3/merchants/%s/authorizations) can be skipped on the client and will be handled by the server.
*
* @param request -
**/
void preAuthV2(PreAuthRequest request);}
2 changes: 1 addition & 1 deletion clover-android-loyalty-kit/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 = '304'
version = '306'


apply from: file("${project.rootDir}/lib.gradle")
Expand Down
2 changes: 1 addition & 1 deletion clover-android-sdk-examples/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 = '304'
version = '306'

apply from: file("${project.rootDir}/app.gradle")
apply plugin: 'kotlin-android'
Expand Down
2 changes: 1 addition & 1 deletion clover-android-sdk-retrofit/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 = '304'
version = '306'


apply from: file("${project.rootDir}/lib.gradle")
Expand Down
6 changes: 4 additions & 2 deletions clover-android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/
group = 'com.clover.sdk'
version = '304'
version = '306'

apply from: file("${project.rootDir}/lib.gradle")
apply plugin: 'kotlin-android'

android {
defaultConfig {
Expand Down Expand Up @@ -51,7 +52,8 @@ afterEvaluate {
classpath += project.files(variant.javaCompileProvider.get().classpath.files) // https://stackoverflow.com/a/34572606
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
options.addBooleanOption "Xdoclint:none", true
options.addBooleanOption "-frames", true
options.addBooleanOption "-frames", true // https://bugs.openjdk.org/browse/JDK-8202961
options.addBooleanOption "-no-module-directories", true // https://stackoverflow.com/a/52603413
options.links 'https://developer.android.com/reference/'
options.overview 'overview.html'
destinationDir = file("build/docs/javadoc/${variant.name}/")
Expand Down
Binary file modified clover-android-sdk/lib/calc-jvm.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ interface IOnOrderUpdateListener2 {
void onRefundProcessed(String orderId, String refundId);
void onCreditProcessed(String orderId, String creditId);
void onLineItemModificationsDeleted(String orderId, in List<String> lineItemIds, in List<String> modificationIds);
void onOrderFeeAdded(String orderId, String orderFeeLineItemId);
void onOrderFeeDeleted(String orderId, String orderFeeLineItemId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.clover.sdk.v3.pay.PaymentRequest;
import com.clover.sdk.v3.pay.PaymentRequestCardDetails;
import com.clover.sdk.v3.order.VoidReason;
import com.clover.sdk.v3.payments.Authorization;
import com.clover.sdk.v3.order.LineItem;

/**
* An interface for interacting with the Clover order service. The order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import com.clover.common.payments.TerminalManagementComponent;
import com.clover.common.payments.VoidExtraData;
import com.clover.sdk.v3.payments.AdditionalChargeAmount;
import com.clover.sdk.v3.payments.AuthorizationFdParcelable;
import com.clover.sdk.v3.order.LineItem;

/**
* An interface for interacting with the Clover order service.
Expand Down Expand Up @@ -870,4 +871,36 @@ interface IOrderServiceV3_1 {
*/
OrderFdParcelable queueVoid(String orderId, String paymentId, String iccContainer, in PaymentRequestCardDetails card, in TransactionInfo transactionInfo, in Map passThroughExtras, in VoidReason reason, in VoidExtraData voidExtraData, String source, out ResultStatus resultStatus);

/**
* This method can be used to apply an order fee to the order
* @clover.perm ORDERS_W
*/
OrderFdParcelable addOrderFee(String orderId, in String orderFeeId, out ResultStatus status);

/**
* This method can be used to remove an order fee from the order
* @clover.perm ORDERS_W
*/
OrderFdParcelable deleteOrderFee(String orderId, in String orderFeeLineItemId, out ResultStatus status);


/**
* Send all line items added in the List to the kitchen or order printer. Only prints
* items that have tags (also called labels) associating them with a printer.
*
* Line items will always be sent to prniter even if they are already printed they will be refired.
*
* @param orderId the ID of the order to fire.
* @param lineItemList line items list to be printed.
* @return true if items are printed, returns false line items or printers are empty.
* @clover.perm ORDERS_W
*/
boolean fireLineItems(String sourceOrderid, in List<LineItem> lineItemList, out ResultStatus status);


/**
* Not available to non-Clover apps.
* @y.exclude
*/
OrderFdParcelable capturePreAuthorization(String orderId, in PaymentFdParcelable preAuth, in PaymentFdParcelable closingPayment, in LineItemListFdParcelable fdLineItems, out ResultStatus status);
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public static class Builder {
private String thresholdManagerId;
private String thresholdManagerName;
private String ebtManualCardEntryScreenFlow;
private String paymentType;
private Boolean createAuth;

public Builder intent(Intent intent) {
action = intent.getAction();
Expand Down Expand Up @@ -319,6 +321,15 @@ public Builder intent(Intent intent) {
if (intent.hasExtra(Intents.EXTRA_EBT_MANUAL_CARD_ENTRY_SCREEN_FLOW)){
ebtManualCardEntryScreenFlow = intent.getStringExtra(Intents.EXTRA_EBT_MANUAL_CARD_ENTRY_SCREEN_FLOW);
}

if (intent.hasExtra(Intents.EXTRA_PAYMENT_TYPE)) {
paymentType = intent.getStringExtra(Intents.EXTRA_PAYMENT_TYPE);
}

if (intent.hasExtra(Intents.EXTRA_CREATE_AUTH)) {
createAuth = intent.getBooleanExtra(Intents.EXTRA_CREATE_AUTH, false);
}

// As a general rule, the transactionSettings assignment should always be the last one
// prior to the return statement. This is to ensure any new/added overrides don't get
// reset by follow-on assignments and aids in preventing backward compatibility issues.
Expand Down Expand Up @@ -456,6 +467,8 @@ public Builder payIntent(PayIntent payIntent) {
this.thresholdManagerName = payIntent.thresholdManagerName;
this.thresholdManagerId = payIntent.thresholdManagerId;
this.ebtManualCardEntryScreenFlow = payIntent.ebtManualCardEntryScreenFlow;
this.paymentType = payIntent.paymentType;
this.createAuth = payIntent.createAuth;
// As a general rule, the transactionSettings assignment should always be the last one
// prior to the return statement. This is to ensure any new/added overrides don't get
// reset by follow-on assignments and aids in preventing backward compatibility issues.
Expand Down Expand Up @@ -832,6 +845,16 @@ public Builder ebtManualCardEntryScreenFlow(String ebtManualCardEntryScreenFlow)
return this;
}

public Builder paymentType(String paymentType) {
this.paymentType = paymentType;
return this;
}

public Builder createAuth(Boolean createAuth) {
this.createAuth = createAuth;
return this;
}

@Deprecated
public Builder testing(boolean isTesting) {
this.isTesting = isTesting;
Expand All @@ -848,7 +871,7 @@ public PayIntent build() {
originatingPayment != null ? originatingPayment.getCardTransaction() : originatingTransaction,
themeName, originatingPayment, originatingCredit, passThroughValues, applicationSpecificValues, refund,
customerTender, isDisableCreditSurcharge, isPresentQrcOnly, isManualCardEntryByPassMode,isAllowManualCardEntryOnMFD, quickPaymentTransactionUuid,
authorization,tokenizeCardRequest,tokenizeCardResponse, dataReadMode, refundReason, thresholdManagerName, thresholdManagerId, ebtManualCardEntryScreenFlow);
authorization,tokenizeCardRequest,tokenizeCardResponse, dataReadMode, refundReason, thresholdManagerName, thresholdManagerId, ebtManualCardEntryScreenFlow, paymentType, createAuth);
}
}

Expand Down Expand Up @@ -956,6 +979,8 @@ public PayIntent build() {
public String thresholdManagerName;
public String thresholdManagerId;
public String ebtManualCardEntryScreenFlow;
public String paymentType;
public Boolean createAuth;


private PayIntent(String action, Long amount, Long tippableAmount,
Expand All @@ -973,7 +998,9 @@ private PayIntent(String action, Long amount, Long tippableAmount,
Themes themeName, Payment originatingPayment, Credit originatingCredit, Map<String, String> passThroughValues,
Map<String, String> applicationSpecificValues, Refund refund, Tender customerTender, boolean isDisableCreditSurcharge,
boolean isPresntQrcOnly, boolean isManualCardEntryByPassMode, boolean isAllowManualCardEntryOnMFD, String quickPaymentTransactionUuid,
Authorization authorization,TokenizeCardRequest tokenizeCardRequest, TokenizeCardResponse tokenizeCardResponse, String dataReadMode, String refundReason, String thresholdManagerName, String thresholdManagerId, String ebtManualCardEntryScreenFlow) {
Authorization authorization,TokenizeCardRequest tokenizeCardRequest, TokenizeCardResponse tokenizeCardResponse, String dataReadMode,
String refundReason, String thresholdManagerName, String thresholdManagerId, String ebtManualCardEntryScreenFlow,
String paymentType, Boolean createAuth) {
this.action = action;
this.amount = amount;
this.tippableAmount = tippableAmount;
Expand Down Expand Up @@ -1032,6 +1059,8 @@ private PayIntent(String action, Long amount, Long tippableAmount,
this.thresholdManagerName = thresholdManagerName;
this.thresholdManagerId = thresholdManagerId;
this.ebtManualCardEntryScreenFlow = ebtManualCardEntryScreenFlow;
this.paymentType = paymentType;
this.createAuth = createAuth;
this.vasSettings = vasSettings;
this.passThroughValues = passThroughValues;
this.applicationSpecificValues = applicationSpecificValues;
Expand Down Expand Up @@ -1323,10 +1352,20 @@ public void addTo(Intent intent) {
if (originatingPaymentPackage != null) {
intent.putExtra(Intents.EXTRA_ORIGINATING_PAYMENT_PACKAGE, originatingPaymentPackage);
}

intent.putExtra(Intents.EXTRA_USE_LAST_SWIPE, useLastSwipe);

if (themeName != null) {
intent.putExtra(Intents.EXTRA_THEME_NAME, (Parcelable) themeName);
}

if (createAuth != null) {
intent.putExtra(Intents.EXTRA_CREATE_AUTH, createAuth);
}

if (paymentType != null) {
intent.putExtra(Intents.EXTRA_PAYMENT_TYPE, paymentType);
}
}

@Override
Expand Down Expand Up @@ -1389,6 +1428,8 @@ public String toString() {
", thresholdManagerName=" + thresholdManagerName +
", thresholdManagerId=" + thresholdManagerId +
", ebtManualCardEntryScreenFlow=" + ebtManualCardEntryScreenFlow +
", paymentType=" + paymentType +
", createAuth=" + createAuth +
'}';
}

Expand Down Expand Up @@ -1595,6 +1636,14 @@ public void writeToParcel(Parcel out, int flags) {
bundle.putString(Intents.EXTRA_EBT_MANUAL_CARD_ENTRY_SCREEN_FLOW, ebtManualCardEntryScreenFlow);
}

if (paymentType != null) {
bundle.putString(Intents.EXTRA_PAYMENT_TYPE, paymentType);
}

if (createAuth != null) {
bundle.putBoolean(Intents.EXTRA_CREATE_AUTH, createAuth);
}

// write out
out.writeBundle(bundle);
}
Expand Down Expand Up @@ -1835,6 +1884,12 @@ public PayIntent createFromParcel(Parcel in) {
if (bundle.containsKey(Intents.EXTRA_EBT_MANUAL_CARD_ENTRY_SCREEN_FLOW)) {
builder.ebtManualCardEntryScreenFlow(bundle.getString(Intents.EXTRA_EBT_MANUAL_CARD_ENTRY_SCREEN_FLOW));
}

if (bundle.containsKey(Intents.EXTRA_PAYMENT_TYPE)) {
builder.paymentType(bundle.getString(Intents.EXTRA_PAYMENT_TYPE));
}

builder.createAuth(bundle.getBoolean(Intents.EXTRA_CREATE_AUTH, false));
// build
return builder.build();
}
Expand Down
Loading

0 comments on commit 1925853

Please sign in to comment.