Skip to content

Commit f633383

Browse files
chore(update-plugins): Tue Aug 19 08:06:00 UTC 2025
1 parent 109e115 commit f633383

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

content/plugins/payments.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ This plugin uses a [RxJS Observable](https://rxjs.dev/guide/observable) to emit
3232

3333
## Contents
3434

35-
- [Installation](#installation)
36-
- [Prerequisites](#prerequisites)
37-
- [iOS prerequisites](#ios-prerequisites)
38-
- [Android prerequisites](#android-prerequisites)
39-
- [Important note about Google items](#important-note-about-google-items)
40-
- [Use @nativescript/payments](#use-nativescriptpayments)
41-
- [Standard usage flow](#standard-usage-flow)
42-
- [In-App Purchase example](#in-app-purchase-example)
43-
- [API](#api)
44-
- [License](#license)
35+
- [@nativescript/payments](#nativescriptpayments)
36+
- [Contents](#contents)
37+
- [Installation](#installation)
38+
- [Prerequisites](#prerequisites)
39+
- [iOS prerequisites](#ios-prerequisites)
40+
- [Android prerequisites](#android-prerequisites)
41+
- [Important note about Google items](#important-note-about-google-items)
42+
- [Use @nativescript/payments](#use-nativescriptpayments)
43+
- [Standard usage flow](#standard-usage-flow)
44+
- [In-App Purchase example](#in-app-purchase-example)
45+
- [API](#api)
46+
- [License](#license)
4547

4648
## Installation
4749

@@ -115,7 +117,9 @@ buyItem('item.id');
115117

116118
// finalizeOrder(payload) will complete the purchase flow.
117119
// The payload argument here is provided in the PaymentEvent.Context.PROCESSING_ORDER - SUCCESS event (see below example for detailed usage).
118-
finalizeOrder(payload)
120+
// Pass true to consume the order, or false to leave it as is.
121+
// Example: don't consume the order if you want to restore it later, like if the user buys a one time item to remove ads from the app permanently. Consuming allows him to buy it again
122+
finalizeOrder(payload, true)
119123

120124
// at this point you would process the order with your backend given the receiptToken from the purchase flow
121125
```
@@ -181,7 +185,7 @@ export class SomeViewModel {
181185
console.log('🟢 Payment Success 🟢')
182186
console.log(`Order Date: ${event.payload.orderDate}`)
183187
console.log(`Receipt Token: ${event.payload.receiptToken}`)
184-
finalizeOrder(event.payload)
188+
finalizeOrder(event.payload, true) // Pass true to consume the order
185189
}
186190
break
187191
case PaymentEvent.Context.FINALIZING_ORDER:

0 commit comments

Comments
 (0)