Guest User

Untitled

a guest
Nov 18th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <script type="text/javascript" charset="utf-8">
  5. function testInapp(){
  6. console.log("Inside in app");
  7.  
  8. inAppPurchase.getProducts(['myapp.xyz']).then(function(products){
  9. console.log(products);
  10. }).catch(function(error){
  11. console.log(error);
  12. });
  13.  
  14. var restorePurchases = function(){
  15. inAppPurchase.restorePurchases().then(function(data){
  16. if(data.productId === 'myapp.xyz'){
  17.  
  18. }else if(data.productId === 'myapp.xyze'){
  19.  
  20. }
  21. }).catch(function(error){
  22. console.log(error);
  23. });
  24. };
  25.  
  26. var purchase = function(productId){
  27. inAppPurchase.buy(productId).then(function(data){
  28. if(data.productId=== 'myapp.xyz'){
  29.  
  30.  
  31. }else if(data.productId === 'myapp.xyzs'){
  32.  
  33. }
  34.  
  35. purchases
  36. return inAppPurchase.consume(data.type, data.receipt, data.signature);
  37. }).catch(function(error){
  38. console.log(error);
  39. });
  40. };
  41.  
  42.  
  43. }
  44.  
  45.  
  46. </script>
  47. </head>
  48. <body>
  49. <input type="button" value="IN-APP" onclick="testInapp()"/>
  50. </body>
  51. </html>
Add Comment
Please, Sign In to add comment