requestPurchase
Request Purchasing Item registered in the console with the gamebaseProductId.
Example Usage:
Gamebase.Purchase.requestPurchase(activity, "productId", new GamebaseDataCallback<PurchasableReceipt>() {
@Override
public void onCallback(PurchasableReceipt data, GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
// Purchase flow is succeeded.
// Call Gamebase.Purchase.requestItemListOfNotConsumed() API and process 'Consume Flow'
// <a href="https://docs.toast.com/ko/Game/Gamebase/ko/aos-purchase/#purchase-flow">...</a>
Gamebase.Purchase.requestItemListOfNotConsumed(...);
} else {
// Purchase flow is failed.
}
}
});
Since
Added 2.11.0.
Parameters
current Activity.
registered in the Gamebase console.
callback pass to API result.
See also
Request Purchasing Item registered in the console with the gamebaseProductId. The value entered in the payload can be checked again in the PurchasableReceipt.payload, so it can be used as a method of classifying item payment according to the game server channel and character.
Example Usage:
String payload = "{\"gameServer\":\"Server01\",\"characterId\":\"abcd001\"}";
Gamebase.Purchase.requestPurchase(activity, "productId", payload, new GamebaseDataCallback<PurchasableReceipt>() {
@Override
public void onCallback(PurchasableReceipt data, GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
// Purchase flow is succeeded.
// Call Gamebase.Purchase.requestItemListOfNotConsumed() API and process 'Consume Flow'
// <a href="https://docs.toast.com/ko/Game/Gamebase/ko/aos-purchase/#purchase-flow">...</a>
// Specify item with payload what you input
String payloadResponse = data.payload;
Gamebase.Purchase.requestItemListOfNotConsumed(...);
} else {
// Purchase flow is failed.
}
}
});
Since
Added 2.11.0.
Parameters
current Activity.
registered in the Gamebase console.
used to enter the information you want to check again on the receipt.
callback pass to API result.
See also
Request Purchasing Item that has itemSeq.
This is legacy purchase API. We recommend to use the new API requestPurchase.
Since
Added 1.4.0.
Parameters
current Activity.
represent to item ID.
callback pass to API result.