Payments Ingest Events
Kenkai Android SDK Payment module consists of events for in-app payment activities. Payments module consists of events for rewarding platforms. You need to implement this module if your app offers users some rewards, points on completing certain actions or achieving a certain milestone by using your app.
List of Events
| Event Name | Type | Description |
|---|---|---|
| Payment | payment | Track payments for all types |
Payment Event
To log events for payments, when they undergo processing and processed completed or canceled.
Format
| Param | Usability | Format | Enum Values | Description |
|---|---|---|---|---|
| payment_id | REQUIRED | STRING | --- | Id the payment in question. |
| order_id | REQUIRED | STRING | --- | Order Id for which the payment is made. |
| type | REQUIRED | STRING | bank_transfer, cheque, cod, credit, pos, bank_card, other | Type by which payment is being made. |
| action | REQUIRED | STRING | processed, view, add, remove, update, select, initiated, other | Action performed on the payment under question. |
| account_balance | REQUIRED | FLOAT | --- | Current account balance for user after payment amount is added.. |
| payment_amount | REQUIRED | FLOAT | --- | Amount for which the payment is made. |
| currency | REQUIRED | STRING | --- | Currency of the payment being made (ISO 4217). |
| is_successful | REQUIRED | BOOLEAN | --- | Boolean to represent if the payment is successful or not. |
| meta | OPTIONAL | ANY | --- | Any additional value that is sent with the log. |
Usage
- Android (Java/Kotlin)
- iOS (Swift)
- React Native (JS/TS)
- Web Application (JS/TS)
- JSON
val paymentObject = PaymentObject(
paymentId = "testPaymentId",
orderId = "testOrderId",
method = PaymentMethod.BankCard,
action = PaymentAction.Processed,
accountBalance = 3000.0,
paymentAmount = 2000.0,
currency = CurrencyCode.EUR,
isSuccessful = true
)
CFPaymentsEvent.logIngest(
eventType = PaymentsEventType.Payment,
logObject = paymentObject
)
let paymentsObject = PaymentObject(paymentId: "testPaymentId", orderId: "testOrderId", method: .BankCard, action: .View, currency: .EUR, accountBalance: 300, paymentAmount: 100, isSuccessful: true)
CFPaymentsEvent.shared.logIngest(eventType: .Payment, logObject: paymentsObject)
const deferredPaymentProperties = {
payment_id: 'testID',
order_id: 'order_id',
type: PaymentMethod.BankCard,
action: PaymentAction.PaymentProcessed,
account_balance: 3333,
payment_amount: 2222,
currency: CurrencyCode.EUR,
is_successful: true,
} as PaymentProperties;
CFPayment.logIngestEvent(
PaymentsEventType.Payment,
deferredPaymentProperties,
);
const paymentProperties = {
payment_id: 'testID',
order_id: 'order_id',
type: PaymentMethod.BankCard,
action: PaymentAction.PaymentProcessed,
account_balance: 3333,
payment_amount: 2222,
currency: CurrencyCode.EUR,
is_successful: true,
};
Payments.logIngestEvent(
PaymentsEventTypes.Payment,
paymentProperties,
);
{
"name": "payment",
"property": "processed",
"ctx": {
"__ol": true,
"account_balance": "3000.0",
"action": "processed",
"currency": "EUR",
"is_successful": "true",
"order_id": "testOrderId",
"payment_amount": "2000.0",
"payment_id": "testPaymentId",
"type": "bank_card"
},
}