Fixes as a result of 'end-to-end-backend' test

This commit is contained in:
olivermrbl committed 2020-07-03 17:00:27 +02:00
1 parent 63a2f126c5
commit 758c72bdf1
18 files changed
+90 -37

No files matched your search

+2 -2
View File
@@ -27,7 +27,7 @@
"medusa-test-utils": "^0.3.0"
},
"scripts": {
"build": "babel src -d dist",
"build": "babel src -d .",
"prepare": "cross-env NODE_ENV=production npm run build",
"watch": "babel -w src --out-dir . --ignore **/__tests__",
"test": "jest"
@@ -42,4 +42,4 @@
"body-parser": "^1.19.0"
},
"gitHead": "35e0930650d5f4aedf2610749cd131ae8b7e17cc"
}
}
@@ -3,7 +3,7 @@ export default async (req, res) => {
let event
try {
const stripeProviderService = req.resolve("pp_stripe")
const stripeProviderService = req.scope.resolve("pp_stripe")
event = stripeProviderService.constructWebhookEvent(req.body, signature)
} catch (err) {
res.status(400).send(`Webhook Error: ${err.message}`)
@@ -103,7 +103,7 @@ class StripeProviderService extends PaymentService {
const paymentIntent = await this.stripe_.paymentIntents.create({
customer: stripeCustomerId,
amount: amount * 100, // Stripe amount is in cents
currency: currency_code
currency: currency_code,
})
return paymentIntent
@@ -134,7 +134,7 @@ class StripeProviderService extends PaymentService {
const { id } = data
const amount = this.totalsService_.getTotal(cart)
return this.stripe_.paymentIntents.update(id, {
amount
amount,
})
} catch (error) {
throw error