Class RemotePurchase

java.lang.Object
sg.dex.starfish.impl.remote.RemotePurchase
All Implemented Interfaces:
Purchase

public class RemotePurchase
extends Object
implements Purchase
This class representing an purchase managed via a remote agent.

This class included methods for create , get listing, get status and metadata of the purchase The instance of this class can be referred by using the purchase ID.

Version:
0.5
Author:
Ayush
  • Method Details

    • create

      public static RemotePurchase create​(RemoteAgent agent, String id)
      To get the Reference of Existing Listing
      Parameters:
      agent - agent on which the purchase instance need to be created
      id - id
      Returns:
      RemotePurchase instance
    • getListing

      public Listing getListing()
      Description copied from interface: Purchase
      Returns the Listing associated with this Purchase.

      The listing may not be available in some circumstances (e.g. lack of access permission) in which case an exception will be thrown.

      Specified by:
      getListing in interface Purchase
      Returns:
      The listing for this Purchase
    • status

      public String status()
      Description copied from interface: Purchase
      API to get the status of Purchase. Possible status can be : "wishlist", "ordered", "delivered"
      Specified by:
      status in interface Purchase
      Returns:
      The status of the purchase
    • getMetaData

      public Map<String,​Object> getMetaData()
      Description copied from interface: Purchase
      Get the metadata for this Purchase as a nested Map
      Specified by:
      getMetaData in interface Purchase
      Returns:
      The metadata for this purchase