Esempio n. 1
0
 /**
  * @see com.jdroid.android.billing.BillingManager#purchaseStateChanged(java.lang.String,
  *     java.lang.String)
  */
 @Override
 public void purchaseStateChanged(String signedData, String signature) {
   List<PurchaseOrder> orders = Security.verifyPurchase(signedData, signature);
   if ((orders != null) && !orders.isEmpty()) {
     BillingResponseHandler.notifyPurchaseStateChanged(orders);
   }
 }
Esempio n. 2
0
    /** @see com.splatt.android.common.billing.BillingService.BillingRequest#doExecute() */
    @Override
    protected long doExecute() throws RemoteException {

      Log.d(TAG, "Checking if billing is supported");

      Bundle requestBundle = makeRequestBundle(CHECK_BILLING_SUPPORTED);
      Bundle responseBundle = service.sendBillingRequest(requestBundle);
      BillingResponseCode responseCode = BillingResponseCode.valueOf(responseBundle);
      Log.i(TAG, "CheckBillingSupported response code: " + responseCode);
      BillingResponseHandler.checkBillingSupportedResponse(responseCode);
      return BILLING_RESPONSE_INVALID_REQUEST_ID;
    }
Esempio n. 3
0
    @Override
    protected long doExecute() throws RemoteException {

      Log.d(TAG, "Requesting purchase for product id: " + purchasable.getProductId());

      Bundle request = makeRequestBundle(REQUEST_PURCHASE);
      request.putString(BILLING_REQUEST_ITEM_ID, purchasable.getProductId());
      // Note that the developer payload is optional.
      if (developerPayload != null) {
        request.putString(BILLING_REQUEST_DEVELOPER_PAYLOAD, developerPayload);
      }
      Bundle response = service.sendBillingRequest(request);
      PendingIntent pendingIntent = response.getParcelable(BILLING_RESPONSE_PURCHASE_INTENT);
      if (pendingIntent == null) {
        Log.e(TAG, "Error with requestPurchase for product id: " + purchasable.getProductId());
        return BILLING_RESPONSE_INVALID_REQUEST_ID;
      }

      BillingResponseHandler.startMarketCheckoutActivity(pendingIntent, new Intent());
      return response.getLong(BILLING_RESPONSE_REQUEST_ID, BILLING_RESPONSE_INVALID_REQUEST_ID);
    }
Esempio n. 4
0
 /**
  * @see
  *     com.jdroid.android.billing.BillingManager#unregister(com.jdroid.android.billing.PurchaseObserver)
  */
 @Override
 public synchronized void unregister(PurchaseObserver purchaseObserver) {
   BillingResponseHandler.unregister(purchaseObserver);
 }
Esempio n. 5
0
 /**
  * @see
  *     com.jdroid.android.billing.BillingManager#unregister(com.jdroid.android.billing.BillingListener)
  */
 @Override
 public synchronized void unregister(BillingListener billingListener) {
   BillingResponseHandler.unregister(billingListener);
 }
Esempio n. 6
0
 @Override
 protected void responseCodeReceived(BillingResponseCode responseCode) {
   BillingResponseHandler.responseCodeReceived(this, responseCode);
 }