Payments Ingest Events
Causal Foundry 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 |
---|---|---|
Deferred Payment | deferred_payment |
Track payments for Buy Now Pay Later method where you purchase on credit. |
Payment Method | payment_method |
Track selection for payment method in the app, which mode the user is selecting to pay and how much. |
Deferred Payment Event
To log events for payments, when they undergo processing and processed completed or canceled. This log is for use cases whe we have Buy Now and Pay Later which means that customers can buy the items now and pay the amount on a later date.
Format
Param | Usability | Format | Enum Values | Description |
---|---|---|---|---|
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 | payment_processed | 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. |
usd_rate | REQUIRED | FLOAT | --- | Conversion value to USD for the currency provided in the payment. (Auto Tracked) |
meta | OPTIONAL | ANY | --- | Any additional value that is sent with the log. |
Auto-Tracked
usd_rate
is auto-tracked, you don't need to add anything for that.
Usage
CfLogDeferredPaymentEvent.Builder()
.setPaymentMethod(PaymentMethod.bank_card)
.setPaymentAction(PaymentAction.payment_processed)
.setPaymentAmount(2000)
.setPaymentId("testPaymentId")
.setCurrency(CurrencyCode.EUR.name)
.setOrderId("testOrderId")
.setAccountBalance(3000)
.isSuccessful(true)
.build()
let deferredPaymentProperties = {
id: "testPaymentId",
order_id: "testOrderId",
type: PaymentMethod.BankTransfer,
action: DeferredPaymentType.PaymentProcessed,
account_balance: 88,
payment_amount: 33,
currency: CurrencyCode.AED,
is_successful: true,
}
CfPayments.logDeferredPaymentEvent(deferredPaymentProperties)
const deferredPaymentProperties = {
id: 'payment-id',
order_id: 'order-id-1234',
type: PaymentsMethodType.BankCard,
action: DeferredPaymentType.PaymentProcessed,
account_balance: 100,
payment_amount: 56,
currency: CurrencyCode.EUR,
is_successful: true,
}
Payments.logDeferredPaymentEvent(deferredPaymentProperties)
Payment Method Event
To log events for payments. Which method of the payment is selected for the order.
Format
Param | Usability | Format | Enum Values | Description |
---|---|---|---|---|
id | REQUIRED | STRING | --- | Id for which the payment is made, if not present then use payment_(user_id). |
order_id | REQUIRED | STRING | --- | Order Id for which the payment is made. |
action | REQUIRED | STRING | view, add, remove, update, select | Action being performed on the payment is made. |
type | REQUIRED | STRING | bank_transfer, cheque, cod, credit, pos, bank_card, other | Type by which payment is being made. |
payment_amount | REQUIRED | FLOAT | --- | Amount for which the payment is made. |
currency | REQUIRED | STRING | --- | Currency of the payment being made (ISO 4217). |
usd_rate | REQUIRED | FLOAT | --- | Conversion value to USD for the currency provided in the payment. (Auto Tracked) |
meta | OPTIONAL | ANY | --- | Any additional value that is sent with the log. |
Auto-Tracked
usd_rate
is auto-tracked, you don't need to add anything for that.