本文整理汇总了Java中org.solovyev.android.checkout.BillingRequests类的典型用法代码示例。如果您正苦于以下问题:Java BillingRequests类的具体用法?Java BillingRequests怎么用?Java BillingRequests使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BillingRequests类属于org.solovyev.android.checkout包,在下文中一共展示了BillingRequests类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: consume
import org.solovyev.android.checkout.BillingRequests; //导入依赖的package包/类
private void consume(final Purchase purchase) {
mCheckout.whenReady(new Checkout.EmptyListener() {
@Override
public void onReady(@Nonnull BillingRequests requests) {
requests.consume(purchase.token, makeRequestListener());
}
});
}
示例2: purchase
import org.solovyev.android.checkout.BillingRequests; //导入依赖的package包/类
private void purchase(@NonNull final Sku sku) {
if (DEBUG) Log.d(TAG, "Purchasing " + sku.toString() + "...");
mCheckout.whenReady(new Checkout.ListenerAdapter() {
@Override
public void onReady(@NonNull BillingRequests requests) {
requests.purchase(sku, null, mCheckout.getPurchaseFlow());
}
});
}
示例3: onOptionsItemSelected
import org.solovyev.android.checkout.BillingRequests; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final int itemId = item.getItemId();
if (itemId == R.id.action_info) {
Intent intent = new Intent(this, InfoActivity.class);
intent.putExtra(IssueActivity.MODAL_URL, getString(R.string.asset_url_info));
startActivity(intent);
return true;
} else if (itemId == R.id.action_settings) {
Intent settingsIntent = new Intent(this, SettingsActivity.class);
startActivity(settingsIntent);
return true;
} else if (itemId == R.id.action_refresh) {
swipeRefreshLayout.setRefreshing(true);
if(!issueCollection.isLoading()) {
issueCollection.reload();
}
return true;
} else if (itemId == R.id.action_subscribe) {
if(issueCollection.getSubscriptionSku() != null) {
final ActivityCheckout checkout = this.getCheckout();
checkout.whenReady(new Checkout.ListenerAdapter() {
@Override
public void onReady(@NonNull BillingRequests requests) {
requests.purchase(issueCollection.getSubscriptionSku(), null, checkout.getPurchaseFlow());
}
});
return true;
}else{
Toast.makeText(this, "Subscriptions are currently not available!", Toast.LENGTH_LONG).show();
return false;
}
} else {
return super.onContextItemSelected(item);
}
}
示例4: onSubscriptionClicked
import org.solovyev.android.checkout.BillingRequests; //导入依赖的package包/类
private void onSubscriptionClicked(BillingRequests requests, Sku subscriptionSku) {
requests.purchase(subscriptionSku, Configuration.getUserId(), shelfCheckout.getPurchaseFlow());
BakerApplication.getInstance().getPluginManager().onSubscribeClicked(subscriptionSku);
}