Creating Data in my Collection from Wix Members.

Hi there,

I am really hoping you can help! I’ve created a paid subscription portal to stripe - using a Lightbox and repeater. I am having trouble being able to create a customer into my collection ‘payingMembersdata’ the code so far does the transaction with Stripe, creates a member in my site members / contacts but then stops - the console.log (err) reads ‘evaluating e-member’.

Where am I going wrong?! Have read all that I can find on the site and other blogs, but can’t find my solution.

Many thanks for your support!
Henry

//--------------------------------------------Sign up member--------------------------------------------//

async function signUpMember(response, cus, lastFour, brand, subStatus) {
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) => {
confirmInsertSuccess(response, cus, lastFour, brand, subStatus);
})
. catch ( (err) => {
console.log(err);
});
}
//-----------------------------------------------------------Continue With Sign Up-------------------------------------------------------//

function confirmInsertSuccess(response, cus, lastFour, brand, subStatus) {
let data = {
firstName: $w( “#fName” ).value,
lastName: $w( “#lName” ).value,
email: $w( “#email” ).value,
customerId: cus,
subscriptionId: response.id,
lastFour: String(lastFour),
cardType: brand,
subscriptionStatus: subStatus
};
wixData.insert( ‘payingMembersdata’ , data)
.then( (result) => {
let item = result;
wixLocation.to(/my-dashboard/{ID}); //redirect to member page (dynamic)
});
}