Android Open Source - gdx-pay Offer






From Project

Back to project page gdx-pay.

License

The source code is released under:

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUC...

If you think the Android project gdx-pay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*******************************************************************************
 * Copyright 2011 See AUTHORS file.//  w w w .  j  a va 2s .c o  m
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.badlogic.gdx.pay;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/** A product offer that can be purchased. */
public class Offer {

  /** The offer type. */
  private OfferType type;

  /** The default identifier that is used to identify purchases and also serves as default for stores where no specific identifier
   * has been set. */
  private String identifier;
  /** Store specific identifiers. For simplicity it's probably best to not set one but use the default identifier instead. */
  private Map<String, String> identifierForStores = new HashMap<String, String>(16);

  public synchronized OfferType getType () {
    return type;
  }

  public synchronized Offer setType (OfferType type) {
    this.type = type;

    // and return this for chaining
    return this;
  }

  public synchronized String getIdentifier () {
    return identifier;
  }

  public synchronized Offer setIdentifier (String identifier) {
    this.identifier = identifier;

    // and return this for chaining
    return this;
  }

  public synchronized String getIdentifierForStore (String storeName) {
    String identifier = identifierForStores.get(storeName);
    if (identifier != null) {
      return identifier;
    } else {
      // we use our default
      return this.identifier;
    }
  }

    public synchronized Set<Map.Entry<String, String>> getIdentifierForStores () {
        return identifierForStores.entrySet();
    }

  public synchronized Offer putIdentifierForStore (String storeName, String identifierForStore) {
    identifierForStores.put(storeName, identifierForStore);

    // and return this for chaining
    return this;
  }
}




Java Source Code List

com.badlogic.gdx.pay.Information.java
com.badlogic.gdx.pay.OfferType.java
com.badlogic.gdx.pay.Offer.java
com.badlogic.gdx.pay.PurchaseManagerConfig.java
com.badlogic.gdx.pay.PurchaseManager.java
com.badlogic.gdx.pay.PurchaseObserver.java
com.badlogic.gdx.pay.PurchaseSystem.java
com.badlogic.gdx.pay.Transaction.java
com.badlogic.gdx.pay.android.IAP.java
com.badlogic.gdx.pay.android.amazon.PurchaseManagerAndroidAmazon.java
com.badlogic.gdx.pay.android.openiab.PurchaseManagerAndroidOpenIAB.java
com.badlogic.gdx.pay.android.ouya.PurchaseManagerAndroidOUYA.java
com.badlogic.gdx.pay.desktop.apple.PurchaseManagerDesktopApple.java
com.badlogic.gdx.pay.gwt.googlewallet.PurchaseManagerGwtGoogleWallet.java
com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple.java
com.badlogic.gdx.pay.server.PurchaseVerifierManager.java
com.badlogic.gdx.pay.server.PurchaseVerifier.java
com.badlogic.gdx.pay.server.impl.PurchaseVerifierAndroidAmazon.java
com.badlogic.gdx.pay.server.impl.PurchaseVerifierAndroidGoogle.java
com.badlogic.gdx.pay.server.impl.PurchaseVerifieriOSApple.java
com.badlogic.gdx.pay.server.util.Base64Util.java