Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iap.config({
- googlePublicKeyStrSandBox: googlePublicKeyStrSandBox,
- googlePublicKeyStrLive: googlePublicKeyStrLive,
- googleAccToken: googleAccToken,
- googleRefToken: googleRefToken,
- googleClientID: googleClientID,
- googleClientSecret: googleClientSecret
- });
- iap.setup((err) => {
- if (err) {
- full = { messageText: 'Failed: Invalid In-app purchase set up', category:'ProcessSubscriptionGoogle'}
- callback(null, full);
- } else {
- // refresh token before validating the receipt
- iap.refreshGoogleToken( function (err, response) {
- if (err) {
- full = { messageText: 'Failed: Cannot Refresh Token', category:'ProcessSubscriptionGoogle'}
- callback(null, full);
- } else {
- iap.validate(validationType, googleReceipt, (err, response) => {
- if (err) {
- full = { messageText: 'Failed: Invalid Receipt', category:'ProcessSubscriptionGoogle'}
- callback(null, full);
- } else {
- console.log(response);
- }
- });
- }
- })
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement