Hey Team,
I have a custom user input form that is doing a number of things on the back end integrating with stripe along with creating wix users and inserting some data into a data set. I am stuck at the point at which the code registers a wix user and then tries to insert data into a wix data set. It is very odd because the wix user is generated in the wix dashboard, but the code stops at the catch error and returns and error of "Cannot read property ‘member’ of null. I have have used the debugger at that point in the code to check that all fields are populated that are being passed and none of them are null. Has anyone run into this issue before? Is there something I am missing?
Below is my code. Seems to match with the corvid API documentation.
async function signUpMember(response, cus, lastFour, brand, subStatus) {
console.log("signing up wix member"); //show when member sign up starts
let array = [];
let phone = $w("#phone").value;
await array.push(phone);
wixUsers.register($w("#email").value, $w("#password").value, {
"contactInfo": {
"firstName": $w("#fName").value,
"lastName": $w("#lName").value,
"phones": array,
"country": $w("#country").value
}
})
.then((result) => {
console.log("signing up wix memeber"); //show when member sign up starts
confirmInsertSuccess(response, cus, lastFour, brand, subStatus);
})
.catch((err) => {console.log(`could not insert into paying members: ${err}`); //show when member sign up starts
debugger
});
}