示例#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);
   }
 }
示例#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;
    }
示例#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);
    }
示例#4
0
 /**
  * @see
  *     com.jdroid.android.billing.BillingManager#unregister(com.jdroid.android.billing.PurchaseObserver)
  */
 @Override
 public synchronized void unregister(PurchaseObserver purchaseObserver) {
   BillingResponseHandler.unregister(purchaseObserver);
 }
示例#5
0
 /**
  * @see
  *     com.jdroid.android.billing.BillingManager#unregister(com.jdroid.android.billing.BillingListener)
  */
 @Override
 public synchronized void unregister(BillingListener billingListener) {
   BillingResponseHandler.unregister(billingListener);
 }
示例#6
0
 @Override
 protected void responseCodeReceived(BillingResponseCode responseCode) {
   BillingResponseHandler.responseCodeReceived(this, responseCode);
 }