Skip to content

Commit

Permalink
Update Billing v2 references
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrules44 committed Nov 7, 2022
1 parent ad62d01 commit 771829b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion markdown/api/library/store/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

This library allows you to support <nobr>in-app</nobr> purchasing on iOS, including <nobr>in-game</nobr> currency, upgrades, and more.

For in-app purchasing on other platforms, see the documentation for [Google Billing][plugin.google-iap-billing] or [Amazon IAP][plugin.amazon-iap-v2].
For in-app purchasing on other platforms, see the documentation for [Google Billing][plugin.google-iap-billing-v2] or [Amazon IAP][plugin.amazon-iap-v3].

<div class="guide-notebox">
<div class="notebox-title">Notes</div>
Expand Down
25 changes: 12 additions & 13 deletions markdown/guide/monetization/IAP/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ The following steps pertain to <nobr>in-app</nobr> purchasing on __iOS__.

The following steps pertain to in-app purchasing on __Android__.

1. Start by setting up your Google merchant account and link it to the [Google Play Developer Console](https://play.google.com/apps/publish/). <nobr>In-app</nobr> purchases will __not__ work until these steps are cleared, and you won't get an error message reporting so. Please see [here](https://support.google.com/payments/merchant/answer/7161426) for detailed instructions.
1. Start by setting up your Google merchant account and link it to the [Google Play Developer Console](https://play.google.com/apps/publish/). <nobr>In-app</nobr> purchases will __not__ work until these steps are cleared, and you won't get an error message reporting so. Please see [here](https://support.google.com/payments/merchant/answer/7161426) for detailed instructions.

2. While still in console, create a new app and fill out all of the information needed for publishing the app&nbsp;&mdash; note,&nbsp;however, that some details don't need to be final for simply testing <nobr>in-app</nobr> purchasing.

3. Configure your <nobr>in-app</nobr> purchases (products). This task is beyond the scope of this guide, so please see Google's [Administering In-App Billing](https://developer.android.com/google/play/billing/billing_admin.html) guide for further assistance.

4. On the Solar2D side, integrate the [Google Billing][plugin.google-iap-billing] plugin by adding an entry into the `plugins` table of the project's `build.settings` file:
4. On the Solar2D side, integrate the [Google Billing][plugin.google-iap-billing-v2] plugin by adding an entry into the `plugins` table of the project's `build.settings` file:

<div class="code-indent">

Expand All @@ -168,7 +168,7 @@ settings =
<div class="code-indent">

``````{ brush="lua" gutter="false" first-line="1" highlight="[3,4,5,6,7,8,9]" }
application =
application =
{
license =
{
Expand Down Expand Up @@ -201,7 +201,7 @@ The following steps pertain to in-app purchasing on __Amazon__.

3. Configure your <nobr>in-app</nobr> purchases (products). This task is beyond the scope of this guide, so please see Amazon's [Submitting IAP Items](https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/submitting-iap-items) guide for further assistance.

4. On the Solar2D side, integrate the [Amazon IAP][plugin.amazon-iap-v2] plugin by adding an entry into the `plugins` table of the project's `build.settings` file:
4. On the Solar2D side, integrate the [Amazon IAP][plugin.amazon-iap-v3] plugin by adding an entry into the `plugins` table of the project's `build.settings` file:

<div class="code-indent">

Expand Down Expand Up @@ -365,7 +365,7 @@ The `store.init()` call is required and must be executed before you attempt to c
</div>
<div class="docs-tip-inner-right">

For Google IAP, this same transaction listener function also handles initialization ([init][plugin.google-iap-billing.event.init]) events. Thus, if you're using Google&nbsp;IAP, you should differentiate store transaction events from initialization events by conditionally checking the value of [event.name][plugin.google-iap-billing.event.storeTransaction.name]. Please see the Google&nbsp;IAP [store.init()][plugin.google-iap-billing.init] documentation for an example of doing so.
For Google IAP, this same transaction listener function also handles initialization ([init][plugin.google-iap-billing-v2.event.init]) events. Thus, if you're using Google&nbsp;IAP, you should differentiate store transaction events from initialization events by conditionally checking the value of [event.name][plugin.google-iap-billing-v2.event.storeTransaction.name]. Please see the Google&nbsp;IAP [store.init()][plugin.google-iap-billing-v2.init] documentation for an example of doing so.

</div>
</div>
Expand All @@ -376,7 +376,7 @@ For Google IAP, this same transaction listener function also handles initializat
</div>
<div class="docs-tip-inner-right">

Sometime after calling `store.init()`, you may check the `store.isActive` property to confirm that the store has successfully initialized (value&nbsp;of&nbsp;`true`).
Sometime after calling `store.init()`, you may check the `store.isActive` property to confirm that the store has successfully initialized (value&nbsp;of&nbsp;`true`).

</div>
</div>
Expand Down Expand Up @@ -483,7 +483,7 @@ For each instance within `event.products`, various properties will be available
</div>
<div class="docs-tip-inner-right">

Together, the above properties should be sufficient to display an informative product listing to the user/player, but you may want to consult the documentation for [iOS][api.library.store.event.productList.products], [Android][plugin.google-iap-billing.event.productList.products], and [Amazon][plugin.amazon-iap-v2.event.productList.products] to inspect additional properties.
Together, the above properties should be sufficient to display an informative product listing to the user/player, but you may want to consult the documentation for [iOS][api.library.store.event.productList.products], [Android][plugin.google-iap-billing-v2.event.productList.products], and [Amazon][plugin.amazon-iap-v3.event.productList.products] to inspect additional properties.

</div>
</div>
Expand Down Expand Up @@ -560,7 +560,7 @@ store.init( transactionListener )
</div>
<div class="docs-tip-inner-right">

For Google IAP, this same transaction listener function also handles initialization ([init][plugin.google-iap-billing.event.init]) events. Thus, if you're using Google&nbsp;IAP, you should differentiate store transaction events from initialization events by conditionally checking the value of [event.name][plugin.google-iap-billing.event.storeTransaction.name]. Please see the Google&nbsp;IAP [store.init()][plugin.google-iap-billing.init] documentation for an example of doing so.
For Google IAP, this same transaction listener function also handles initialization ([init][plugin.google-iap-billing-v2.event.init]) events. Thus, if you're using Google&nbsp;IAP, you should differentiate store transaction events from initialization events by conditionally checking the value of [event.name][plugin.google-iap-billing-v2.event.storeTransaction.name]. Please see the Google&nbsp;IAP [store.init()][plugin.google-iap-billing-v2.init] documentation for an example of doing so.

</div>
</div>
Expand Down Expand Up @@ -592,7 +592,7 @@ end
</div>
<div class="docs-tip-inner-right">

As noted above, the properties and values returned will vary slightly because of core variances in store functionality. For example, Apple will return `"restored"` for the `state` property of restored purchases, but Google&nbsp;Play and Amazon will group normal purchases and restored purchases collectively under the `"purchased"` state. In&nbsp;addition, each store returns an assortment of unique properties which you may need to inspect, so please consult the documentation for [iOS][api.library.store.event.storeTransaction.transaction], [Android][plugin.google-iap-billing.event.storeTransaction.transaction], and [Amazon][plugin.amazon-iap-v2.event.storeTransaction.transaction] respectively.
As noted above, the properties and values returned will vary slightly because of core variances in store functionality. For example, Apple will return `"restored"` for the `state` property of restored purchases, but Google&nbsp;Play and Amazon will group normal purchases and restored purchases collectively under the `"purchased"` state. In&nbsp;addition, each store returns an assortment of unique properties which you may need to inspect, so please consult the documentation for [iOS][api.library.store.event.storeTransaction.transaction], [Android][plugin.google-iap-billing-v2.event.storeTransaction.transaction], and [Amazon][plugin.amazon-iap-v3.event.storeTransaction.transaction] respectively.

</div>
</div>
Expand Down Expand Up @@ -652,7 +652,7 @@ if ( transaction.state == "purchased" or transaction.state == "restored" ) then

## Store-Specific Functionality

Each marketplace offers some unique and potentially critical functionality which you must be aware of. The following list summarizes these, but you should always consult the documentation for [iOS][api.library.store], [Android][plugin.google-iap-billing], and [Amazon][plugin.amazon-iap-v2] to inspect <nobr>platform-specific</nobr> functionality in detail.
Each marketplace offers some unique and potentially critical functionality which you must be aware of. The following list summarizes these, but you should always consult the documentation for [iOS][api.library.store], [Android][plugin.google-iap-billing-v2], and [Amazon][plugin.amazon-iap-v3] to inspect <nobr>platform-specific</nobr> functionality in detail.

### Purchasing Disabled (Apple)

Expand All @@ -662,7 +662,7 @@ iOS devices have a setting which can disable <nobr>in-app</nobr> purchasing enti

Google IAP requires that you __consume__ purchases to make item(s) available for purchase again. Essentially, once a product is purchased, it is considered "owned" and it cannot be purchased again. However, since you'll almost certainly want to encourage players to buy certain items again&nbsp;&mdash; gem/coin&nbsp;packs, extra&nbsp;lives,&nbsp;etc.&nbsp;&mdash; you must send a consumption request to revert "owned" products to "unowned" products so that they become available for purchase again. Consuming products also discards their previous purchase data.

To consume items, call [store.consumePurchase()][plugin.google-iap-billing.consumePurchase] with the associated product identifier:
To consume items, call [store.consumePurchase()][plugin.google-iap-billing-v2.consumePurchase] with the associated product identifier:

``````lua
store.consumePurchase( productIdentifier )
Expand All @@ -687,5 +687,4 @@ Google IAP allows for transactions to be refunded ([instructions](https://suppor

### Sandbox Mode (Amazon)

Amazon lets you test <nobr>in-app</nobr> purchasing via a "sandbox" mode in which no real purchases are made. If you want to implement some form of debugging in your Solar2D app, you can use the [store.isSandboxMode()][plugin.amazon-iap-v2.isSandboxMode] API to check if the app is currently in testing mode.

Amazon lets you test <nobr>in-app</nobr> purchasing via a "sandbox" mode in which no real purchases are made. If you want to implement some form of debugging in your Solar2D app, you can use the [store.isSandboxMode()][plugin.amazon-iap-v3.isSandboxMode] API to check if the app is currently in testing mode.
2 changes: 1 addition & 1 deletion markdown/plugin/amazon-iap-v3/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The Amazon IAP plugin lets you sell digital content and subscriptions from withi
</div>
<div class="docs-tip-inner-right">

For in-app purchasing on other platforms, see the documentation for [Google IAP][plugin.google-iap-billing], [Apple IAP][plugin.apple-iap], [Samsung IAP][plugin.samsung-iap], or [Store API][api.library.store].
For in-app purchasing on other platforms, see the documentation for [Google IAP][plugin.google-iap-billing-v2], [Apple IAP][plugin.apple-iap], [Samsung IAP][plugin.samsung-iap], or [Store API][api.library.store].

</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions markdown/plugin/google-iap-billing-v2/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

The [Google IAP](https://plugins.solar2d.com/?search=plugin.google.iap.billing.v2) plugin allows you to support <nobr>in-app</nobr> purchasing on Android, including <nobr>in-game</nobr> currency, upgrades, and more.

For in-app purchasing on other platforms, see the documentation for [Apple IAP][api.library.store] or [Amazon IAP][plugin.amazon-iap-v3].
For in-app purchasing on other platforms, see the documentation for [Apple IAP][api.library.store], [Samsung IAP][plugin.samsung-iap] or [Amazon IAP][plugin.amazon-iap-v3].

<div class="guide-notebox">
<div class="notebox-title">Notes</div>

* The only code change between Google API Billing v2 and [Billing v1][plugin.google-iap-billing] is removal [event.productList.products.originalJson][plugin.google-iap-billing-v2.event.productList.products] and new publisherId in `build.settings`
* The only code change between Google API Billing v2 and [Billing v1][plugin.google-iap-billing] is changing to a publisherId in `build.settings`

* To use Google IAP, begin by setting up your [Google Payments Merchant Center](https://support.google.com/wallet/business/answer/1619772) account and linking it to the [Google Play Developer Console](https://play.google.com/apps/publish).

Expand Down
9 changes: 8 additions & 1 deletion markdown/plugin/google-iap-billing/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
> __Platforms__ Android
> --------------------- ------------------------------------------------------------------------------------------
<div class="guide-notebox-imp">
<div class="notebox-title-imp">Important</div>

This plugin is deprecated. Please migrate to [Google Billing v2][plugin.google-iap-billing-v2].

</div>

## Overview

The Google Play Billing plugin allows you to support <nobr>in-app</nobr> purchasing on Android, including <nobr>in-game</nobr> currency, upgrades, and more.
Expand Down Expand Up @@ -112,7 +119,7 @@ This will add mandatory `com.android.vending.BILLING` permission to your app.
Finally, the `license` table may be added to the project `config.lua` file if you want your purchases to be verified. Inside this table, the `key` value should be set to the corresponding key obtained from the [Google Play Developer Console](https://play.google.com/apps/publish). In the Console, select your app, then click on "Monetization setup" section. Copy key from the "Licensing" section.

``````{ brush="lua" gutter="false" first-line="1" highlight="[3,4,5,6,7,8,9]" }
application =
application =
{
license =
{
Expand Down
2 changes: 1 addition & 1 deletion markdown/plugin/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Interested in [creating a plugin][native.plugin]? Please see our [Plugins][nativ

#### [Amazon IAP][plugin.amazon-iap-v2]
#### [Apple IAP][plugin.apple-iap]
#### [Google IAP][plugin.google-iap-billing]
#### [Google IAP][plugin.google-iap-billing-v2]
#### [Samsung IAP][plugin.samsung-iap]

## Security
Expand Down

0 comments on commit 771829b

Please sign in to comment.