Fields Summary |
---|
public static final int | ENTEREDA predefined transaction state. |
public static final int | UPDATEA predefined transaction state. |
public static final int | ASSIGNEDA predefined transaction state. |
public static final int | SUCCESSFULA predefined transaction state. |
public static final int | FAILEDA predefined transaction state. |
public static final int | REJECTEDA predefined transaction state. |
public static final int | DISCARDEDA predefined transaction state. |
protected static final int | ADAPTER_SPECIFICThe starting value of adapter specific states. |
private int | transactionID |
private int | featureID |
private String | featureTitle |
private String | featureDescription |
private byte[] | payload |
private TransactionModuleImpl | transactionModule |
private String | providerName |
private String | currency |
private double | price |
private String | specificPriceInfo |
private int | state |
private boolean | waiting |
private boolean | needsUI |
private TransactionProcessor | processor |
Methods Summary |
---|
public final java.lang.String | getCurrency()Returns the currency of the payment.
return currency;
|
public final java.lang.String | getFeatureDescription()Returns the description of the feature, which is paid for by this
transaction.
return featureDescription;
|
public final int | getFeatureID()Returns the id of the paid feature.
return featureID;
|
public final java.lang.String | getFeatureTitle()Returns the title of the feature, which is paid for by this transaction.
return featureTitle;
|
public final byte[] | getPayload()Returns the payload which is a part of the payment or null
if it's undefined.
return payload;
|
public final double | getPrice()Returns the price of the feature, which is paid.
return price;
|
public final java.lang.String | getProviderName()Returns the payload which is a part of the payment or null
if it's undefined.
return providerName;
|
public final java.lang.String | getSpecificPriceInfo()Returns the provider specific price information associated with
the paid feature.
return specificPriceInfo;
|
public final int | getState()Returns the current state of the transaction.
return state;
|
public final int | getTransactionID()Returns the transaction ID value.
return transactionID;
|
public final TransactionModuleImpl | getTransactionModule()Returns the associated transaction module.
return transactionModule;
|
public final boolean | isWaiting()Indicates if the transaction is waiting for some event.
return waiting;
|
public final boolean | needsUI()Indicates if the transaction needs or will need an user response to be
finished.
return needsUI;
|
final com.sun.j2me.payment.Transaction | process()Processes the transaction. Delegates the call to the associated
transaction processor.
return processor.process(this);
|
final void | setCurrency(java.lang.String value)Sets the currency of the payment.
currency = value;
|
public final void | setNeedsUI(boolean value)Sets the value which indicates if the transaction needs or will need
some user response to be finished. Setting this value to
true can block this or other transactions that also need
user response from processing (only one such transaction can be
processed at a time). Initialy this value is set to true
and is an adapter responsibility to set it to false at the
right time.
needsUI = value;
|
final void | setPrice(double value)Sets the price of the paid feature.
price = value;
|
final void | setProviderName(java.lang.String value)Sets the name of the selected provider.
providerName = value;
|
final void | setSpecificPriceInfo(java.lang.String value)Sets the provider specific price information.
specificPriceInfo = value;
|
public final void | setState(int newState)Sets the state of the transaction to the new value.
state = newState;
|
final void | setTransactionID(int value)Sets the transaction ID for the transaction.
transactionID = value;
|
public void | setTransactionProcessor(TransactionProcessor processor)Sets the transaction processor of the transaction.
this.processor = processor;
|
public final void | setWaiting(boolean value)Puts the transaction into or resumes it from the waiting. A transaction
which is waiting is not processed by the transaction processing thread
of the payment module (its state doesn't change). A transaction can wait
for some user response or the end of some adapter specific thread.
// should be synchronized?
if (waiting == value) {
return;
}
if (waiting) {
waiting = false;
// notify the payment module
PaymentModule.getInstance().continueProcessing();
return;
}
waiting = true;
|