payments.canPurchaseStore
Checks whether a purchase is possible. Must be called before in-store purchase, official apps only.
func (c *Client) PaymentsCanPurchaseStore(ctx context.Context, purpose InputStorePaymentPurposeClass) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.PaymentsCanPurchaseStore(ctx, purpose)
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Purpose | InputStorePaymentPurposeClass | yes | Payment purpose. |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | INPUT_PURPOSE_INVALID | The specified payment purpose is invalid. |
| 406 | PREMIUM_CURRENTLY_UNAVAILABLE | You cannot currently purchase a Premium subscription. |
References
- Official documentation
- Generated Go reference
- TL definition:
payments.canPurchaseStore#4fdc5ea7