Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16728,6 +16728,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,vue__WEBPACK_IMPORTED_MODULE_1__.defineComponent)({
setup: function setup() {
var _this = this;

var state = (0,vue__WEBPACK_IMPORTED_MODULE_1__.reactive)({
stripe: {},
cardElement: {},
Expand All @@ -16741,6 +16743,9 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
zip_code: ''
}
});
var cart = (0,vue__WEBPACK_IMPORTED_MODULE_1__.computed)(function () {
return _this.$store.state.cart;
});
(0,vue__WEBPACK_IMPORTED_MODULE_1__.onMounted)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
var stripe;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
Expand All @@ -16754,15 +16759,19 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
stripe = _context.sent;
console.log('Stripe test: ');
console.log(stripe);
console.log('Cart computed: ');
console.log(cart);

case 5:
case 7:
case "end":
return _context.stop();
}
}
}, _callee);
})));
return _objectSpread({}, (0,vue__WEBPACK_IMPORTED_MODULE_1__.toRefs)(state));
return _objectSpread(_objectSpread({}, (0,vue__WEBPACK_IMPORTED_MODULE_1__.toRefs)(state)), {}, {
cart: cart
});
}
}));

Expand Down
14 changes: 10 additions & 4 deletions resources/js/pages/Checkout/Checkout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

<script>
import {
defineComponent, onMounted, reactive, toRefs,
computed,
defineComponent,
onMounted,
reactive,
toRefs,
} from 'vue';

import { loadStripe } from '@stripe/stripe-js';
Expand All @@ -27,17 +31,19 @@ export default defineComponent({
state: '',
zip_code: '',
},

});

const cart = computed(() => this.$store.state.cart);

onMounted(async () => {
const stripe = await loadStripe(process.env.MIX_STRIPE_KEY);
console.log('Stripe test: ');
console.log(stripe);
console.log('Cart computed: ');
console.log(cart);
});

return { ...toRefs(state) };
return { ...toRefs(state), cart };
},
});

</script>