@@ -20457,40 +20457,41 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
2045720457
2045820458 var checkout = /*#__PURE__*/function () {
2045920459 var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
20460- var _yield$localState$str, paymentMethod, error, kunde;
20460+ var _store$getCustomerDet, firstName, lastName, address, zipcode, city, state, email, _yield$localState$str, paymentMethod, error, kunde;
2046120461
2046220462 return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2046320463 while (1) {
2046420464 switch (_context2.prev = _context2.next) {
2046520465 case 0:
20466- _context2.next = 2;
20466+ _store$getCustomerDet = store.getCustomerDetails, firstName = _store$getCustomerDet.firstName, lastName = _store$getCustomerDet.lastName, address = _store$getCustomerDet.address, zipcode = _store$getCustomerDet.zipcode, city = _store$getCustomerDet.city, state = _store$getCustomerDet.state, email = _store$getCustomerDet.email;
20467+ _context2.next = 3;
2046720468 return localState.stripe.createPaymentMethod("card", localState.cardElement, {
2046820469 billing_details: {
20469- name: "Test test" ,
20470- email: "test@test.no" ,
20470+ name: "".concat(firstName, " ").concat(lastName) ,
20471+ email: email ,
2047120472 address: {
20472- line1: "Test" ,
20473- city: "City" ,
20474- state: "State" ,
20475- postal_code: "1234"
20473+ line1: address ,
20474+ city: city ,
20475+ state: state ,
20476+ postal_code: zipcode
2047620477 }
2047720478 }
2047820479 });
2047920480
20480- case 2 :
20481+ case 3 :
2048120482 _yield$localState$str = _context2.sent;
2048220483 paymentMethod = _yield$localState$str.paymentMethod;
2048320484 error = _yield$localState$str.error;
2048420485
2048520486 if (!(error || !paymentMethod.id)) {
20486- _context2.next = 8 ;
20487+ _context2.next = 9 ;
2048720488 break;
2048820489 }
2048920490
2049020491 localState.orderError = "Error";
2049120492 return _context2.abrupt("return");
2049220493
20493- case 8 :
20494+ case 9 :
2049420495 kunde = _objectSpread(_objectSpread({}, store.getCustomerDetails), {}, {
2049520496 cart: JSON.stringify(store.getCartContent),
2049620497 amount: 5000,
@@ -20511,7 +20512,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
2051120512 localState.orderError = true;
2051220513 });
2051320514
20514- case 10 :
20515+ case 11 :
2051520516 case "end":
2051620517 return _context2.stop();
2051720518 }
0 commit comments