public static class PureMetrics.Revenue.Builder
extends java.lang.Object
PureMetrics.Revenue Object. Provides a convenient way to set
the various fields of a PureMetrics.Revenue and
generate associated payload which PureMetrics SDK can process| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
PureMetrics.Revenue.Builder |
addMeta(java.util.HashMap<java.lang.String,java.lang.Object> meta)
Add any additional information which you want to pass.
|
PureMetrics.Revenue.Builder |
addPayment(java.lang.String mode,
long convertedAmount,
long fees)
Add the Payment Details.
|
PureMetrics.Revenue |
build()
Combine all of the options that have been set and return a new
PureMetrics.Revenue object |
PureMetrics.Revenue.Builder |
setCurrency(java.lang.String currency)
Set the Transaction Currency.
|
PureMetrics.Revenue.Builder |
setDiscount(java.lang.String discountCode,
long discountValue)
Add the discount which is applied to the transaction.
|
PureMetrics.Revenue.Builder |
setPaymentProviderTransactionId(java.lang.String transactionId)
The ID using which the transaction can be identified in the payment provider's system.
|
PureMetrics.Revenue.Builder |
setTransactionId(java.lang.String transactionId)
Set The transaction Id for the current transaction
|
public PureMetrics.Revenue.Builder setTransactionId(java.lang.String transactionId)
transactionId - The transaction id to which the transaction belongsPureMetrics.Revenue.Builderpublic PureMetrics.Revenue.Builder setPaymentProviderTransactionId(java.lang.String transactionId)
transactionId - id generated by the payment providerPureMetrics.FailedTransaction.Builderpublic PureMetrics.Revenue.Builder setCurrency(java.lang.String currency)
currency - Currency value has to comply with
ISO4217,PureMetrics.Revenue.Builderpublic PureMetrics.Revenue.Builder setDiscount(java.lang.String discountCode, long discountValue)
discountCode - Discount code useddiscountValue - Discount amount if anyPureMetrics.Revenue.Builderpublic PureMetrics.Revenue.Builder addMeta(java.util.HashMap<java.lang.String,java.lang.Object> meta)
meta - Metadata associated with the revenue event.
Example: name, product, category, location etcPureMetrics.Revenue.Builderpublic PureMetrics.Revenue.Builder addPayment(java.lang.String mode, long convertedAmount, long fees)
mode - Payment ModeconvertedAmount - Payment amount converted in the transaction currencyfees - fess charged by the payment gateway if anyPureMetrics.Revenue.Builderpublic PureMetrics.Revenue build()
PureMetrics.Revenue objectPureMetrics.Revenue