Fix Charges Insert

This commit is contained in:
Justin Reynolds 2018-02-13 11:22:41 -06:00
parent 31621b39b2
commit 2dc9cc0b87

View file

@ -146,7 +146,7 @@ export const createCharge = async ({user, product, collection, document, metadat
currency: product.currency,
customer: customer.id,
metadata
}
};
// create Stripe charge
const charge = await stripe.charges.create(chargeData);
@ -155,7 +155,7 @@ export const createCharge = async ({user, product, collection, document, metadat
return processCharge({collection, document, charge, args, user})
}
};
/*
@ -190,7 +190,7 @@ export const processCharge = async ({collection, document, charge, args, user})
associatedId,
properties,
productKey,
}
};
if (token) {
chargeDoc.tokenId = token.id;
@ -198,7 +198,7 @@ export const processCharge = async ({collection, document, charge, args, user})
chargeDoc.ip = token.client_ip;
}
// insert
const chargeSaved = newMutation({
const chargeSaved = await newMutation({
collection: Charges,
document: chargeDoc,
validate: false,