本文整理汇总了Java中org.solovyev.android.checkout.RequestListener类的典型用法代码示例。如果您正苦于以下问题:Java RequestListener类的具体用法?Java RequestListener怎么用?Java RequestListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestListener类属于org.solovyev.android.checkout包,在下文中一共展示了RequestListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doVerify
import org.solovyev.android.checkout.RequestListener; //导入依赖的package包/类
@Override
protected void doVerify(@NonNull final List<Purchase> purchases, @NonNull final RequestListener<List<Purchase>> listener) {
// Prepare params
Purchase purchase = purchases.get(0);
boolean isSubscription = Configuration.getSubscriptionProductIds().contains(purchase.sku);
String purchaseType = isSubscription ? "subscription" : "product";
// Post purchase verification request
ApiRequestHandler apiRequestHandler = new ApiRequestHandler(Configuration.getPurchaseConfirmationUrl(purchaseType));
PurchasesVerificationPayload purchasesVerificationPayload = new PurchasesVerificationPayload(purchase);
boolean result = apiRequestHandler.post(purchasesVerificationPayload);
// Trigger success
if(result) {
listener.onSuccess(purchases);
}else{
listener.onError(apiRequestHandler.getStatusCode(), new PurchaseVerificationException(apiRequestHandler.getResponseText()));
}
}
开发者ID:bakerframework,项目名称:baker-android-refactor,代码行数:22,代码来源:ApiPurchaseVerifier.java
示例2: makeRequestListener
import org.solovyev.android.checkout.RequestListener; //导入依赖的package包/类
private <T> RequestListener<T> makeRequestListener() {
return new RequestListener<T>() {
@Override
public void onSuccess(@Nonnull T result) {
reloadInventory();
}
@Override
public void onError(int response, @Nonnull Exception e) {
reloadInventory();
e.printStackTrace();
}
};
}
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:15,代码来源:DonationActivity.java
示例3: purchase
import org.solovyev.android.checkout.RequestListener; //导入依赖的package包/类
private void purchase(Sku sku) {
final RequestListener<Purchase> listener = makeRequestListener();
mCheckout.startPurchaseFlow(sku, null, listener);
}
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:5,代码来源:DonationActivity.java
注:本文中的org.solovyev.android.checkout.RequestListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论