Class Transaction

java.lang.Object
com.badlogic.gdx.pay.Transaction

public final class Transaction extends Object
An transaction for an item purchased via libGDX In-App payment system (IAP).
  • Field Details

  • Constructor Details

    • Transaction

      public Transaction()
  • Method Details

    • getIdentifier

      public String getIdentifier()
      The item identifier/SKU that matches our item id in the IAP service.
    • setIdentifier

      public void setIdentifier(String identifier)
    • getStoreName

      public String getStoreName()
      Returns one of the store names as defined in PurchaseManagerConfig.
    • setStoreName

      public void setStoreName(String storeName)
    • getOrderId

      public String getOrderId()
      The original transaction identifier which is unique for each purchase (doesn't change). It represents an unique ID for the purchase on the corresponding store.
    • setOrderId

      public void setOrderId(String orderId)
    • getRequestId

      public String getRequestId()
      The original request identifier which is unique for each request (doesn't change). It represents an unique ID for the request on the corresponding store.
    • setRequestId

      public void setRequestId(String requestId)
    • getUserId

      public String getUserId()
      The user identifier which is unique for each request / purchase (doesn't change).
    • setUserId

      public void setUserId(String userId)
    • isPurchased

      public boolean isPurchased()
      Returns true if the order is considered valid, i.e. in purchased state (non-refunded/cancelled).
    • getPurchaseTime

      public Date getPurchaseTime()
      The original purchase time in milliseconds since the epoch (Jan 1, 1970).
    • setPurchaseTime

      public void setPurchaseTime(Date purchaseTime)
    • getPurchaseText

      public String getPurchaseText()
      The title/info for the purchase (or null for unknown). E.g. "Purchased: 100 Coins".
    • setPurchaseText

      public void setPurchaseText(String purchaseText)
    • getPurchaseCost

      public int getPurchaseCost()
      How much was originally charged in the lowest denomination (or 0 for unknown). E.g. if the cost was USD 4.99, then this field contains 499.
      Returns:
      price in cents, or zero if unknown
    • setPurchaseCost

      public void setPurchaseCost(int purchaseCost)
    • getPurchaseCostCurrency

      public String getPurchaseCostCurrency()
      The ISO 4217 currency code for price (or null for unknown). For example, if price is specified in British pounds sterling then this field is "GBP".
    • setPurchaseCostCurrency

      public void setPurchaseCostCurrency(String purchaseCostCurrency)
    • getReversalTime

      public Date getReversalTime()
      The original refund/cancellation time in milliseconds since the epoch (Jan 1, 1970) or null for non-refunded.
    • setReversalTime

      public void setReversalTime(Date reversalTime)
    • getReversalText

      public String getReversalText()
      The title/info for the refund (or null for unknown). E.g. "Refunded" or "Cancelled".
    • setReversalText

      public void setReversalText(String reversalText)
    • getTransactionData

      public String getTransactionData()
    • setTransactionData

      public void setTransactionData(String transactionData)
    • getTransactionDataSignature

      public String getTransactionDataSignature()
      The original data string from the purchase (or null for unknown).
    • setTransactionDataSignature

      public void setTransactionDataSignature(String transactionDataSignature)
      A signature for the purchase data string for validation of the data (or null for unknown).
    • toString

      public String toString()
      Overrides:
      toString in class Object