Use the below functions to pass hashed(SHA-256) data(email addresses and phone numbers) to the Wunderkind SDK.
💬 Pass hashed data into these functions
💬 Please pass phone
in the following format +(country code)(phone number)
Example: +13305851212
iOS
TrackHashedLoggedIn
Wunderkind.shared.trackHashedLoggedIn(email:String phone:String)
Purchase event
💬 Pass hashed data to the Customer object.
final class CheckoutViewController: BaseViewController {
...
func purchaseWasSuccessful() {
let invoice = Invoice(amount: 40.0,
tax: 2.5,
shipping: 4.5,
totalDiscount: nil,
currency: .USD)
let customer = Customer(hashedEmail: HASHED_EMAIL,
hashedPhone: HASHED_PHONE)
let product = Product(productId: "TestProductId",
skuId: "TestSKUId",
price: 10.0,
quantity: 2)
let order = Order(orderId: "TestOrderId",
invoice: invoice,
paymentMethod: "Credit Card",
products: [product],
customer: customer,
coupons: ["TestCoupon"],
goal: "purchase")
Wunderkind.shared.trackPurchase(order: order)
}
}
Android
TrackHashedLoggedIn
Wunderkind.getInstance().trackHashedLoggedIn(hashedEmail, hashedPhone)
Purchase event
💬Pass hashed data to the Customer object.
public class CheckoutActivity extends AppCompatActivity {
protected void onSuccessfulPurchase() {
List<String> couponList = new ArrayList<>();
couponList.add("TestCoupon");
List<Product> products = new ArrayList<>();
Double price = 10.0;
Long quantity = 1L;
products.add(new Product("PRODUCT-ID", "SKU-ID", price, quantity));
Double amount = 100.0;
Double tax = 10.0;
Double shipping = 10.0;
Double totalDiscount = 10.0;
String paymentMethod = "Visa Card";
String customerEmail = "test@java.com";
String customerPhone = "+12223334445";
String goal = "purchase";
Order order = new Order("TestOrderId",
new Invoice(amount, tax, shipping, totalDiscount, Currency.USD),
paymentMethod,
products,
new Customer.createHashedCustomer(hashedCustomerEmail, hashedCustomerPhone)
couponList,
goal
);
Wunderkind.getInstance().trackPurchase(order);
}
}
ReactNative
TrackHashedLoggedIn
Wunderkind.getInstance().trackLoggedInEventWithPhone('MYHASHEM1NOP', "13305558888");
Purchase event
let customer = Customer.createHashedCustomerWithPhone('myEmail@gmail.com', "+13305889999");
💬Pass hashed data to the Customer object.
export class CheckoutScreen extends React.Component {
// ...
purchaseWasSuccessful() {
let couponList: string[] = ["TestCoupon"];
var purchasedProducts: Product[] = [];
let price = 10.0;
let quantity = 1L;
purchasedProducts.push(new Product("PRODUCT-ID", "SKU-ID", price, quantity));
let amount = 100.0;
let tax = 10.0;
let shipping = 10.0;
let totalDiscount = 10.0;
let paymentMethod = "Visa Card";
let customerEmail = "test@reactnative.com";
let customerPhone = 12223334445;
let goal = "purchase";
Order order = new Order(
"TestOrderId",
new Invoice(amount, tax, shipping, totalDiscount, Currency.USD),
paymentMethod,
purchasedProducts,
Customer.createHashedCustomerWithPhone(customerEmail, customerPhone),
couponList,
goal
);
Wunderkind.trackPurchaseEvent(order);
};
}