Skip to content

Commit f925e44

Browse files
author
Evan Greer
committed
adds additional track purchase function
1 parent e3173f1 commit f925e44

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,20 @@ public void trackPurchase(double total, @NonNull List<CommerceItem> items) {
10291029
trackPurchase(total, items, null, null);
10301030
}
10311031

1032+
/**
1033+
* Tracks a purchase.
1034+
* @param total total purchase amount
1035+
* @param items list of purchased items
1036+
* @param dataFields a `JSONObject` containing any additional information to save along with the event
1037+
*/
1038+
public void trackPurchase(double total, @NonNull List<CommerceItem> items, @Nullable JSONObject dataFields) {
1039+
if (!checkSDKInitialization()) {
1040+
return;
1041+
}
1042+
1043+
apiClient.trackPurchase(total, items, dataFields, null);
1044+
}
1045+
10321046
/**
10331047
* Tracks a purchase.
10341048
* @param total total purchase amount

0 commit comments

Comments
 (0)