Open Marioegarcia opened 2 years ago
Any updates on this ?
Any updates on this ? x2
Same here, how did you solve this?
Got it to "almost" work by changing the package function createDeviceSessionId
to by async.
let identifierForVendor = this.identifierForVendor();
returns a promise, but is not fulfilled unless you add an await
.
So I made the function async like this:
createDeviceSessionId = async () => {
let identifierForVendor = await this.identifierForVendor() || "testing this";
console.log("identifierForVendor",identifierForVendor)
identifierForVendor = identifierForVendor.replace(/-/g, '');
const uri = vsprintf('%s/oa/logo.htm?m=%s&s=%s', [
this.props.isProductionMode ? API_URL_PRODUCTION : API_URL_SANDBOX,
this.props.merchantId,
sessionId,
]);
const injectedJavaScript = vsprintf('var identifierForVendor = "%s";', [
identifierForVendor,
]);
this.setState(() => ({uri, injectedJavaScript}));
this.props.deviceSession(sessionId);
};
Not an openpay worker lol, but this fixes the crash. It still by no means fixes other validation errors that you get via interacting with the card.
ERROR TypeError: identifierForVendor.replace is not a function. (In 'identifierForVendor.replace(/-/g, '')', 'identifierForVendor.replace' is undefined)