Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript" charset="utf-8">
- function testInapp(){
- console.log("Inside in app");
- inAppPurchase.getProducts(['myapp.xyz']).then(function(products){
- console.log(products);
- }).catch(function(error){
- console.log(error);
- });
- var restorePurchases = function(){
- inAppPurchase.restorePurchases().then(function(data){
- if(data.productId === 'myapp.xyz'){
- }else if(data.productId === 'myapp.xyze'){
- }
- }).catch(function(error){
- console.log(error);
- });
- };
- var purchase = function(productId){
- inAppPurchase.buy(productId).then(function(data){
- if(data.productId=== 'myapp.xyz'){
- }else if(data.productId === 'myapp.xyzs'){
- }
- purchases
- return inAppPurchase.consume(data.type, data.receipt, data.signature);
- }).catch(function(error){
- console.log(error);
- });
- };
- }
- </script>
- </head>
- <body>
- <input type="button" value="IN-APP" onclick="testInapp()"/>
- </body>
- </html>
Add Comment
Please, Sign In to add comment