Skip to content

Commit

Permalink
Merge pull request dotnet#98 from madewithkoji/changelog-updates
Browse files Browse the repository at this point in the history
Remove showModal, add receiptId to purchase handler
  • Loading branch information
rasienko authored Nov 2, 2020
2 parents 0fb8e57 + 447bbdb commit 82ce2c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
24 changes: 0 additions & 24 deletions src/asciidoc/reference/packages/withkojiCustomVccSdk.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,6 @@ Saves the JSON customization file in the consumer application.
customVcc.save();
----

[.hcode, id=".showModal", reftext="showModal"]
=== .showModal(type, currentValue, onComplete)

Opens the specified modal type, and invokes a callback function when the user selects a value in the modal.
The available modal types correspond to the built-in VCCs of the same name.
When a value is chosen in the modal it invokes the onComplete handler passing the new value to it.

==== Parameters

* `type` – _String_, modal type to display. Possible values are `image`, `sound`, `obj`, and `file`.
* `currentValue` – _Any_, current value of the custom VCC.
* `onComplete` – _Function_, called when modal has been resolved.
Receives the following property as input:
** `newValue` – _Any_, the value set within the modal by the user.

==== Example

[source,javascript]
----
customVcc.showModal('image', myImageUrl, (newUrl) => {
// change and save VCC to use the new URL value
});
----

[.hcode, id=".uploadFile", reftext="uploadFile"]
=== .uploadFile(file, fileName, onComplete)

Expand Down
7 changes: 4 additions & 3 deletions src/asciidoc/reference/packages/withkojiIAP.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Or, if the user hasn't purchased the image, display a *Purchase* button and use

Install the package in the frontend and backend services of your Koji project.

IMPORTANT: To support instant remixes of your template, you must also install the <<withkoji-vcc-package#>> package and implement the `VccMiddleware` on your backend server.
This middleware maintains the process variables for instant remixes, ensuring that purchases are applied to the correct remix version.

[source,bash]
----
npm install --save @withkoji/iap
----

IMPORTANT: To support instant remixes of your template, you must also install the <<withkoji-vcc-package#>> package and implement the `VccMiddleware` on your backend server.
This middleware maintains the environment variables for instant remixes, ensuring that purchases are applied to the correct remix version.

== Iap

To enable in-app purchases for your Koji template, you must implement the `Iap` class and define the `InAppPurchases` object in the `.koji/project/entitlements.json` file.
Expand Down Expand Up @@ -213,6 +213,7 @@ Receives the following properties as input:
** `success` – _Boolean_, indicates whether the purchase was successful.
** `userToken` – _String_, temporary token for the current user's session.
See <<.getToken>>.
** `receiptId` – _String_, unique identifier for the receipt, if the purchase was successful, or `undefined`, if not.
* `purchaseOptions`– _Object_, custom information to add to the transaction receipt.
Contains the following properties:
** `price` – _Number_, (Optional) amount of the purchase.
Expand Down

0 comments on commit 82ce2c7

Please sign in to comment.