当前位置: 首页>>代码示例>>Java>>正文


Java TransactionDetails类代码示例

本文整理汇总了Java中com.anjlab.android.iab.v3.TransactionDetails的典型用法代码示例。如果您正苦于以下问题:Java TransactionDetails类的具体用法?Java TransactionDetails怎么用?Java TransactionDetails使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TransactionDetails类属于com.anjlab.android.iab.v3包,在下文中一共展示了TransactionDetails类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mapTransactionDetails

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
private WritableMap mapTransactionDetails(TransactionDetails details) {
    WritableMap map = Arguments.createMap();

    map.putString("receiptData", details.purchaseInfo.responseData.toString());

    if (details.purchaseInfo.signature != null)
        map.putString("receiptSignature", details.purchaseInfo.signature.toString());

    PurchaseData purchaseData = details.purchaseInfo.purchaseData;

    map.putString("productId", purchaseData.productId);
    map.putString("orderId", purchaseData.orderId);
    map.putString("purchaseToken", purchaseData.purchaseToken);
    map.putString("purchaseTime", purchaseData.purchaseTime == null
      ? "" : purchaseData.purchaseTime.toString());
    map.putString("purchaseState", purchaseData.purchaseState == null
      ? "" : purchaseData.purchaseState.toString());


    if (purchaseData.developerPayload != null)
        map.putString("developerPayload", purchaseData.developerPayload);

    return map;
}
 
开发者ID:idehub,项目名称:react-native-billing,代码行数:25,代码来源:InAppBillingBridge.java

示例2: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
    /*
     * Called when requested PRODUCT ID was successfully purchased
     */
    ProductPurchasedCallback callback = mProductPurchaseCallbacks.get(productId);
    if (callback != null) {
        Log.d("Billing", "Product purchased " + productId + " details: " + details);
        int result = callback.onProductPurchased(productId, details);
        mProductPurchaseCallbacks.remove(productId);
        if (result == ProductPurchasedCallback.CONSUME_PRODUCT) {
            if (!mBP.consumePurchase(productId)) {
                Log.e("Billing", "Product consuming failed!");
            }
        }
    }
}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:18,代码来源:StoreActivity.java

示例3: onCreate

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ShowBackButton();

    setContentView(R.layout.activity_donate);

    bp = new BillingProcessor(DonateActivity.this, LICENSE_KEY, new BillingProcessor.IBillingHandler() {
        @Override
        public void onProductPurchased(String productId, TransactionDetails details) {
            //DBHelper.ShowToastT(DonateActivity.this, "onProductPurchased: " + productId, Toast.LENGTH_LONG);
            refreshPurchasesStatus();
        }

        @Override
        public void onBillingError(int errorCode, Throwable error) {
            // DBHelper.ShowToastT(DonateActivity.this, "onBillingError: " + Integer.toString(errorCode), Toast.LENGTH_LONG);
            refreshPurchasesStatus();
        }

        @Override
        public void onBillingInitialized() {
            readyToPurchase = true;
            DonatePriceTextLoadAsyncTask mt = new DonatePriceTextLoadAsyncTask();
            mt.execute();
        }

        @Override
        public void onPurchaseHistoryRestored() {
            //DBHelper.ShowToastT(DonateActivity.this, "onPurchaseHistoryRestored", Toast.LENGTH_LONG);
            refreshPurchasesStatus();
        }
    });

    // ListView on Fragments
    DonateListFragment fragment = new DonateListFragment();
    getSupportFragmentManager().beginTransaction().replace(R.id.frgmCont, fragment).commit();

}
 
开发者ID:tral,项目名称:GPS2SMS,代码行数:41,代码来源:DonateActivity.java

示例4: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
    L.i("onProductPurchased");
    if (productId.equals(SKU_PRO)) {
        afterPayment();
    }
}
 
开发者ID:Rai220,项目名称:Telephoto,代码行数:8,代码来源:BuyActivity.java

示例5: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
    /*
     * Called when requested PRODUCT ID was successfully purchased
     */
    bp.consumePurchase(productId);
}
 
开发者ID:aricneto,项目名称:TwistyTimer,代码行数:8,代码来源:MainActivity.java

示例6: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
    // Called when requested PRODUCT ID was successfully purchased
    Analytics.newEvent("in-app purchase").put("product_id", productId).log();
    if (productId.equals(Monetize.decrypt(Monetize.ENCRYPTED_REMOVE_ADS_PRODUCT_ID))) {
        Monetize.removeAds();
        EventBus.getDefault().post(new Monetize.Event.OnAdsRemovedEvent());
    }
}
 
开发者ID:jrummyapps,项目名称:BusyBox,代码行数:10,代码来源:MainActivity.java

示例7: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
    if (details != null && productId.equals(details.purchaseInfo.purchaseData.productId))
    {
        try {
            WritableMap map = mapTransactionDetails(details);
            resolvePromise(PromiseConstants.PURCHASE_OR_SUBSCRIBE, map);
        } catch (Exception ex) {
            rejectPromise(PromiseConstants.PURCHASE_OR_SUBSCRIBE, "Failure on purchase or subscribe callback: " + ex.getMessage());
        }
    } else {
        rejectPromise(PromiseConstants.PURCHASE_OR_SUBSCRIBE, "Failure on purchase or subscribe callback. Details were empty.");
    }
}
 
开发者ID:idehub,项目名称:react-native-billing,代码行数:15,代码来源:InAppBillingBridge.java

示例8: getPurchaseTransactionDetails

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@ReactMethod
public void getPurchaseTransactionDetails(final String productId, final Promise promise) {
    if (bp != null) {
        TransactionDetails details = bp.getPurchaseTransactionDetails(productId);
        if (details != null && productId.equals(details.purchaseInfo.purchaseData.productId))
        {
              WritableMap map = mapTransactionDetails(details);
              promise.resolve(map);
        } else {
            promise.reject("EUNSPECIFIED", "Could not find transaction details for productId.");
        }
    } else {
        promise.reject("EUNSPECIFIED", "Channel is not opened. Call open() on InAppBilling.");
    }
}
 
开发者ID:idehub,项目名称:react-native-billing,代码行数:16,代码来源:InAppBillingBridge.java

示例9: getSubscriptionTransactionDetails

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@ReactMethod
public void getSubscriptionTransactionDetails(final String productId, final Promise promise) {
    if (bp != null) {
        TransactionDetails details = bp.getSubscriptionTransactionDetails(productId);
        if (details != null && productId.equals(details.purchaseInfo.purchaseData.productId))
        {
              WritableMap map = mapTransactionDetails(details);
              promise.resolve(map);
        } else {
            promise.reject("EUNSPECIFIED", "Could not find transaction details for productId.");
        }
    } else {
        promise.reject("EUNSPECIFIED", "Channel is not opened. Call open() on InAppBilling.");
    }
}
 
开发者ID:idehub,项目名称:react-native-billing,代码行数:16,代码来源:InAppBillingBridge.java

示例10: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
  Toast.makeText(this, R.string.thank_you_donation, Toast.LENGTH_SHORT).show();
  if (bp != null) {
    bp.consumePurchase(productId);
  }
}
 
开发者ID:afollestad,项目名称:polar-dashboard,代码行数:8,代码来源:BaseDonateActivity.java

示例11: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(@NonNull String productId, @Nullable TransactionDetails details) {
    Toast.makeText(this, R.string.thank_you, Toast.LENGTH_SHORT).show();
    setResult(RESULT_OK);

    if (!BuildConfig.DEBUG) {
        Answers.getInstance().logPurchase(new PurchaseEvent()
                .putCurrency(Currency.getInstance("EUR"))
                .putItemPrice(BigDecimal.valueOf(3))
                .putItemId("pro_version")
                .putSuccess(true)
                .putItemName("Phonograph Pro"));
    }
}
 
开发者ID:kabouzeid,项目名称:Phonograph,代码行数:15,代码来源:PurchaseActivity.java

示例12: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public int onProductPurchased(String productId, TransactionDetails details) {
    if (!TextUtils.isEmpty(productId) && productId.equals(mGoogleProductId)) {
        mPurse.purchaseCurrency(mKey, mGainedCurrency);
        if (mListener != null) {
            mListener.onArticleChanged(PurchaseCurrencyArticle.this);
        }
        return StoreActivity.ProductPurchasedCallback.CONSUME_PRODUCT;
    }
    return StoreActivity.ProductPurchasedCallback.DO_NOTHING;
}
 
开发者ID:DanDits,项目名称:WhatsThat,代码行数:12,代码来源:PurchaseCurrencyArticle.java

示例13: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String s, TransactionDetails transactionDetails) {

    Gdx.app.log(TAG, "onProductPurchased : " + transactionDetails.orderId + ", " + transactionDetails.purchaseInfo.responseData);

    for (StoreListener storeListener : storeListeners) {
        storeListener.transactionCompleted(transactionDetails.productId);
    }
}
 
开发者ID:UnderwaterApps,项目名称:submarine,代码行数:10,代码来源:AndroidStore.java

示例14: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
    Timber.v("%s purchased.", productId);
    SnackbarHandler.showInfoSnackbar(this, coordinatorLayout, "Thanks for helping keep the gears turning!");
    animatePurchase();
    Products product = SupporterHelper.getProduct(productId);
    getRealm().beginTransaction();
    getRealm().copyToRealmOrUpdate(product);
    getRealm().commitTransaction();
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor editor = preferences.edit();
    editor.putBoolean("weather", true);
    editor.apply();
    Analytics.from(this).sendPurchaseEvent(product, productId);
}
 
开发者ID:ItsCalebJones,项目名称:SpaceLaunchNow-Android,代码行数:16,代码来源:SupporterActivity.java

示例15: onProductPurchased

import com.anjlab.android.iab.v3.TransactionDetails; //导入依赖的package包/类
@Override public void onProductPurchased(String productId, TransactionDetails details) {
    if (details != null && details.productId.contains("donation_sub_")) {
        // we can not consume subscriptions
        return;
    }
    // Consume asap purchased to allow multiple donations
    mBillingProcessor.consumePurchase(productId);
}
 
开发者ID:amartinz,项目名称:DeviceControl,代码行数:9,代码来源:DonationActivity.java


注:本文中的com.anjlab.android.iab.v3.TransactionDetails类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。