medusa-payment-stripe
Advanced tools
Comparing version 1.1.39-dev.122 to 1.1.39-next.116
@@ -10,4 +10,2 @@ "use strict"; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var carts = { | ||
@@ -56,3 +54,3 @@ emptyCart: { | ||
quantity: 10 | ||
}, _defineProperty({ | ||
}, { | ||
id: _medusaTestUtils.IdMap.getId("existingLine"), | ||
@@ -70,3 +68,3 @@ title: "merge line", | ||
quantity: 1 | ||
}, "quantity", 10)], | ||
}], | ||
shipping_methods: [{ | ||
@@ -97,3 +95,4 @@ id: _medusaTestUtils.IdMap.getId("freeShipping"), | ||
discounts: [], | ||
customer_id: _medusaTestUtils.IdMap.getId("lebron") | ||
customer_id: _medusaTestUtils.IdMap.getId("lebron"), | ||
context: {} | ||
}, | ||
@@ -100,0 +99,0 @@ frCartNoStripeCustomer: { |
@@ -31,3 +31,4 @@ "use strict"; | ||
amount: 100, | ||
customer: "cus_123456789_new" | ||
customer: "cus_123456789_new", | ||
description: data === null || data === void 0 ? void 0 : data.description | ||
}); | ||
@@ -40,3 +41,4 @@ } | ||
amount: 100, | ||
customer: "cus_lebron" | ||
customer: "cus_lebron", | ||
description: data === null || data === void 0 ? void 0 : data.description | ||
}); | ||
@@ -43,0 +45,0 @@ } |
{ | ||
"name": "medusa-payment-stripe", | ||
"version": "1.1.39-dev.122+5300926d", | ||
"version": "1.1.39-next.116+4198ee77", | ||
"description": "Stripe Payment provider for Meduas Commerce", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
"jest": "^25.5.2", | ||
"medusa-test-utils": "^1.1.38-dev.122+5300926d" | ||
"medusa-test-utils": "^1.1.38-next.116+4198ee77" | ||
}, | ||
@@ -44,6 +44,6 @@ "scripts": { | ||
"express": "^4.17.1", | ||
"medusa-core-utils": "^1.1.32-dev.175+5300926d", | ||
"medusa-core-utils": "^1.1.32-next.164+4198ee77", | ||
"stripe": "^8.50.0" | ||
}, | ||
"gitHead": "5300926db87b61ccd38541eea529c838e7f065ea" | ||
"gitHead": "4198ee7756fe53b2603673c359e0f0abeb1e0abd" | ||
} |
@@ -235,2 +235,4 @@ "use strict"; | ||
var _createPayment = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(cart) { | ||
var _cart$context$payment, _cart$context, _this$options; | ||
var customer_id, region_id, email, region, currency_code, amount, intentRequest, _customer$metadata, customer, stripeCustomer, _stripeCustomer, paymentIntent; | ||
@@ -256,2 +258,3 @@ | ||
amount: Math.round(amount), | ||
description: (_cart$context$payment = cart === null || cart === void 0 ? void 0 : (_cart$context = cart.context) === null || _cart$context === void 0 ? void 0 : _cart$context.payment_description) !== null && _cart$context$payment !== void 0 ? _cart$context$payment : (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.payment_description, | ||
currency: currency_code, | ||
@@ -258,0 +261,0 @@ payment_method_types: ["bancontact"], |
@@ -235,2 +235,4 @@ "use strict"; | ||
var _createPayment = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(cart) { | ||
var _cart$context$payment, _cart$context, _this$options; | ||
var customer_id, region_id, email, region, currency_code, amount, intentRequest, _customer$metadata, customer, stripeCustomer, _stripeCustomer, paymentIntent; | ||
@@ -256,2 +258,3 @@ | ||
amount: Math.round(amount), | ||
description: (_cart$context$payment = cart === null || cart === void 0 ? void 0 : (_cart$context = cart.context) === null || _cart$context === void 0 ? void 0 : _cart$context.payment_description) !== null && _cart$context$payment !== void 0 ? _cart$context$payment : (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.payment_description, | ||
currency: currency_code, | ||
@@ -258,0 +261,0 @@ payment_method_types: ["giropay"], |
@@ -235,2 +235,4 @@ "use strict"; | ||
var _createPayment = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(cart) { | ||
var _cart$context$payment, _cart$context, _this$options; | ||
var customer_id, region_id, email, region, currency_code, amount, intentRequest, _customer$metadata, customer, stripeCustomer, _stripeCustomer, paymentIntent; | ||
@@ -256,2 +258,3 @@ | ||
amount: Math.round(amount), | ||
description: (_cart$context$payment = cart === null || cart === void 0 ? void 0 : (_cart$context = cart.context) === null || _cart$context === void 0 ? void 0 : _cart$context.payment_description) !== null && _cart$context$payment !== void 0 ? _cart$context$payment : (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.payment_description, | ||
currency: currency_code, | ||
@@ -258,0 +261,0 @@ payment_method_types: ["ideal"], |
@@ -12,4 +12,2 @@ "use strict"; | ||
var _lodash = _interopRequireDefault(require("lodash")); | ||
var _stripe = _interopRequireDefault(require("stripe")); | ||
@@ -19,2 +17,4 @@ | ||
var _dist = require("@medusajs/medusa/dist"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
@@ -104,3 +104,3 @@ | ||
var _getStatus = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(paymentData) { | ||
var id, paymentIntent, status; | ||
var id, paymentIntent; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -116,47 +116,22 @@ while (1) { | ||
paymentIntent = _context.sent; | ||
status = "pending"; | ||
_context.t0 = paymentIntent.status; | ||
_context.next = _context.t0 === "requires_payment_method" ? 7 : _context.t0 === "requires_confirmation" ? 7 : _context.t0 === "processing" ? 7 : _context.t0 === "requires_action" ? 8 : _context.t0 === "canceled" ? 9 : _context.t0 === "requires_capture" ? 10 : _context.t0 === "succeeded" ? 10 : 11; | ||
break; | ||
if (!(paymentIntent.status === "requires_payment_method")) { | ||
_context.next = 7; | ||
break; | ||
} | ||
return _context.abrupt("return", status); | ||
case 7: | ||
if (!(paymentIntent.status === "requires_confirmation")) { | ||
_context.next = 9; | ||
break; | ||
} | ||
return _context.abrupt("return", _dist.PaymentSessionStatus.PENDING); | ||
return _context.abrupt("return", status); | ||
case 8: | ||
return _context.abrupt("return", _dist.PaymentSessionStatus.REQUIRES_MORE); | ||
case 9: | ||
if (!(paymentIntent.status === "processing")) { | ||
_context.next = 11; | ||
break; | ||
} | ||
return _context.abrupt("return", _dist.PaymentSessionStatus.CANCELED); | ||
return _context.abrupt("return", status); | ||
case 10: | ||
return _context.abrupt("return", _dist.PaymentSessionStatus.AUTHORIZED); | ||
case 11: | ||
if (paymentIntent.status === "requires_action") { | ||
status = "requires_more"; | ||
} | ||
return _context.abrupt("return", _dist.PaymentSessionStatus.PENDING); | ||
if (paymentIntent.status === "canceled") { | ||
status = "canceled"; | ||
} | ||
if (paymentIntent.status === "requires_capture") { | ||
status = "authorized"; | ||
} | ||
if (paymentIntent.status === "succeeded") { | ||
status = "authorized"; | ||
} | ||
return _context.abrupt("return", status); | ||
case 16: | ||
case 12: | ||
case "end": | ||
@@ -329,4 +304,6 @@ return _context.stop(); | ||
var _createPayment = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(cart) { | ||
var customer_id, region_id, email, _yield$this$regionSer, currency_code, amount, intentRequest, _customer$metadata, customer, stripeCustomer, _stripeCustomer, paymentIntent; | ||
var _cart$context$payment, _cart$context, _this$options; | ||
var customer_id, region_id, email, _yield$this$regionSer, currency_code, amount, intentRequest, _customer$metadata, customer, stripeCustomer, _stripeCustomer; | ||
return regeneratorRuntime.wrap(function _callee5$(_context5) { | ||
@@ -349,2 +326,3 @@ while (1) { | ||
intentRequest = { | ||
description: (_cart$context$payment = cart === null || cart === void 0 ? void 0 : (_cart$context = cart.context) === null || _cart$context === void 0 ? void 0 : _cart$context.payment_description) !== null && _cart$context$payment !== void 0 ? _cart$context$payment : (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.payment_description, | ||
amount: Math.round(amount), | ||
@@ -409,6 +387,5 @@ currency: currency_code, | ||
case 29: | ||
paymentIntent = _context5.sent; | ||
return _context5.abrupt("return", paymentIntent); | ||
return _context5.abrupt("return", _context5.sent); | ||
case 31: | ||
case 30: | ||
case "end": | ||
@@ -415,0 +392,0 @@ return _context5.stop(); |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
143963
3086