voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.05k stars 289 forks source link

Error validation fail #272

Closed Namoow closed 5 years ago

Namoow commented 5 years ago

Hi, when I validate my receipt and secret key on your site it works. But when I try to validate my ionic IOS app with same parameters it returns this error :

[VERBOSE] https://sandbox.itunes.apple.com/verifyReceipt validation response: [VERBOSE] https://sandbox.itunes.apple.com/verifyReceipt failed: TypeError: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin. [object Object] @error1: {"error":{"__zone_symbol__currentTask":null,"validatedData":{"sandbox":true,"status":1,"message":"Unknown"}},"status":1,"message":"Unknown"}

--- CODE ---

In_App.config({ requestDefaults: {}, appleExcludeOldTransactions: true, applePassword: '[XXX]', test: true, verbose: true }); In_App.setup().then(() => { In_App.validate(this.receiptData).then((response) => { console.log('@response: ', response);
var options = { ignoreCanceled: false, ignoreExpired: false }; var purchaseData = In_App.getPurchaseData(response, options); console.log('@purchaseData: ', purchaseData); }).catch((error) => { console.log('@error1: ', error); }); })

I am totally stuck for several days, can you help me please.

voltrue2 commented 5 years ago

Hello,

It looks like your server uses proxy of some sort?

Cheers

Namoow commented 5 years ago

Hello,

It looks like your server uses proxy of some sort?

Cheers

hi,

I don't think so, but I decided to directly do the http request without the plugin and it works.

thanks anyway