Skip to content

Commit 08de799

Browse files
committed
.
1 parent bb493c0 commit 08de799

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs/02_concepts/12_pay_per_event.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Pay-per-event monetization
44
description: Monetize your Actors using the pay-per-event pricing model
55
---
66

7-
import ActorChargeSource from '!!raw-loader!roa-loader!./code/actor_charge.py';
8-
import ConditionalActorChargeSource from '!!raw-loader!roa-loader!./code/conditional_actor_charge.py';
7+
import ActorChargeSource from '!!raw-loader!roa-loader!./code/12_actor_charge.py';
8+
import ConditionalActorChargeSource from '!!raw-loader!roa-loader!./code/12_conditional_actor_charge.py';
99
import ApiLink from '@site/src/components/ApiLink';
1010
import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock';
1111

@@ -23,9 +23,9 @@ If you want more details about PPE pricing, please refer to our [PPE documentati
2323

2424
After monetization is set in the Apify console, you can add <ApiLink to="class/Actor#charge">`Actor.charge`</ApiLink> calls to your code and start monetizing!
2525

26-
<CodeBlock language="python">
27-
{ActorChargeSource}
28-
</CodeBlock>
26+
<RunnableCodeBlock className="language-python" language="python">
27+
{ActorChargeSource}
28+
</RunnableCodeBlock>
2929

3030
Then you just push your code to Apify and that's it! The SDK will even keep track of the max total charge setting for you, so you will not provide more value than what the user chose to pay for.
3131

@@ -35,9 +35,9 @@ If you need finer control over charging, you can access call <ApiLink to="class/
3535

3636
When you plan to start using the pay-per-event pricing model for an Actor that is already monetized with a different pricing model, your source code will need support both pricing models during the transition period enforced by the Apify platform. Arguably the most frequent case is the transition from the pay-per-result model which utilizes the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable to prevent returning unpaid dataset items. The following is an example how to handle such scenarios. The key part is the <ApiLink to="class/ChargingManager#get_pricing_info">`ChargingManager.get_pricing_info()`</ApiLink> method which returns information about the current pricing model.
3737

38-
<CodeBlock language="python">
39-
{ConditionalActorChargeSource}
40-
</CodeBlock>
38+
<RunnableCodeBlock className="language-python" language="python">
39+
{ConditionalActorChargeSource}
40+
</RunnableCodeBlock>
4141

4242
## Local development
4343

File renamed without changes.

0 commit comments

Comments
 (0)