Beamable SDK
Public Member Functions | List of all members
Beamable.Api.Payments.PaymentService Class Reference

Payments service. This service provides an API to communicate with the Platform. More...

Public Member Functions

 PaymentService (PlatformService platform, PlatformRequester requester)
 
Promise< EmptyResponseTrack (TrackPurchaseRequest trackPurchaseRequest)
 Handles starting the coroutine to track a purchase request client-authoritatively Note: This is disabled by default, and requires the developer to enable it via the Portal. More...
 
Promise< PurchaseResponseBeginPurchase (string purchaseId)
 Handles starting the coroutine to make the begin purchase request. More...
 
Promise< EmptyResponseCompletePurchase (CompletedTransaction transaction)
 This request is made after the provider has charged the player. It is used to verify the legitimacy of the purchase by verifying the receipt as well as completing the item fulfillment process. More...
 
Promise< EmptyResponseCancelPurchase (long txid)
 Handles starting the coroutine to make the cancel purchase request. More...
 
Promise< EmptyResponseFailPurchase (long txid, string reason)
 Handles starting the coroutine to make the fail purchase request. More...
 
Promise< PurchaseResponseRedeemCoupon (string purchaseId)
 Attempts to consume a coupon to redeem an offer More...
 
Promise< GetSKUsResponseGetSKUs ()
 Get commerce SKUs from platform More...
 
Promise< GetOffersResponseGetOffers (string[] stores=null)
 Get catalog from platform More...
 
Promise< CouponsCountResponseGetCouponsCount ()
 Get the count of coupons More...
 
void RefreshCoupons ()
 
void SubscribeCoupons (Action< int > callback)
 

Detailed Description

Payments service. This service provides an API to communicate with the Platform.

Member Function Documentation

◆ BeginPurchase()

Promise<PurchaseResponse> Beamable.Api.Payments.PaymentService.BeginPurchase ( string  purchaseId)
inline

Handles starting the coroutine to make the begin purchase request.

Parameters
purchaseIdThe id of the item the player wishes to purchase.

◆ CancelPurchase()

Promise<EmptyResponse> Beamable.Api.Payments.PaymentService.CancelPurchase ( long  txid)
inline

Handles starting the coroutine to make the cancel purchase request.

Parameters
txidThe id of the transaction the player wishes to cancel.

◆ CompletePurchase()

Promise<EmptyResponse> Beamable.Api.Payments.PaymentService.CompletePurchase ( CompletedTransaction  transaction)
inline

This request is made after the provider has charged the player. It is used to verify the legitimacy of the purchase by verifying the receipt as well as completing the item fulfillment process.

Parameters
transactionThe completed transaction.

◆ FailPurchase()

Promise<EmptyResponse> Beamable.Api.Payments.PaymentService.FailPurchase ( long  txid,
string  reason 
)
inline

Handles starting the coroutine to make the fail purchase request.

Parameters
txidThe id of the transaction the player wishes to mark failed.
reasonThe reason the transaction failed

◆ GetCouponsCount()

Promise<CouponsCountResponse> Beamable.Api.Payments.PaymentService.GetCouponsCount ( )
inline

Get the count of coupons

◆ GetOffers()

Promise<GetOffersResponse> Beamable.Api.Payments.PaymentService.GetOffers ( string[]  stores = null)
inline

Get catalog from platform

◆ GetSKUs()

Promise<GetSKUsResponse> Beamable.Api.Payments.PaymentService.GetSKUs ( )
inline

Get commerce SKUs from platform

◆ RedeemCoupon()

Promise<PurchaseResponse> Beamable.Api.Payments.PaymentService.RedeemCoupon ( string  purchaseId)
inline

Attempts to consume a coupon to redeem an offer

Parameters
purchaseIdThe id of the item the player wishes to purchase.

◆ Track()

Promise<EmptyResponse> Beamable.Api.Payments.PaymentService.Track ( TrackPurchaseRequest  trackPurchaseRequest)
inline

Handles starting the coroutine to track a purchase request client-authoritatively Note: This is disabled by default, and requires the developer to enable it via the Portal.

Parameters
trackPurchaseRequestThe request structure for tracking the purchase.

The documentation for this class was generated from the following file: