Skip to content

Commit

Permalink
ISSUE-247. Updated README to document how payload is used. (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
autonomousapps authored and serggl committed Apr 6, 2017
1 parent 94d3225 commit 78b57d9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,21 @@ public class SomeActivity extends Activity implements BillingProcessor.IBillingH
```

* Call `purchase` method for a BillingProcessor instance to initiate purchase or `subscribe` to initiate a subscription:

_Without a developer payload:_
```java
bp.purchase(YOUR_ACTIVITY, "YOUR PRODUCT ID FROM GOOGLE PLAY CONSOLE HERE");
bp.subscribe(YOUR_ACTIVITY, "YOUR SUBSCRIPTION ID FROM GOOGLE PLAY CONSOLE HERE");
```
_With a developer payload:_
```java
bp.purchase(YOUR_ACTIVITY, "YOUR PRODUCT ID FROM GOOGLE PLAY CONSOLE HERE", "DEVELOPER PAYLOAD HERE");
bp.subscribe(YOUR_ACTIVITY, "YOUR SUBSCRIPTION ID FROM GOOGLE PLAY CONSOLE HERE", "DEVELOPER PAYLOAD HERE");
```
_IMPORTANT: when you provide a payload, internally the library prepends a string to your payload. For subscriptions, it prepends `"subs:\<productId\>:"`, and for products, it prepends `"inapp:\<productId\>:\<UUID\>:"`. This is important to know if you do any validation on the payload returned from Google Play after a successful purchase._
* **That's it! A super small and fast in-app library ever!**

* **And dont forget**
* **And don't forget**
to release your BillingProcessor instance!
```java
@Override
Expand Down

0 comments on commit 78b57d9

Please sign in to comment.