Skip to content

Commit fff9b99

Browse files
committed
Send cart total
1 parent 1b92b35 commit fff9b99

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

public/js/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20457,7 +20457,7 @@ 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 _store$getCustomerDet, firstName, lastName, address, zipcode, city, state, email, _yield$localState$str, paymentMethod, error, kunde;
20460+
var _store$getCustomerDet, firstName, lastName, address, zipcode, city, state, email, _yield$localState$str, paymentMethod, error, finalCustomerDetails;
2046120461

2046220462
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2046320463
while (1) {
@@ -20492,12 +20492,12 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
2049220492
return _context2.abrupt("return");
2049320493

2049420494
case 9:
20495-
kunde = _objectSpread(_objectSpread({}, store.getCustomerDetails), {}, {
20495+
finalCustomerDetails = _objectSpread(_objectSpread({}, store.getCustomerDetails), {}, {
2049620496
cart: JSON.stringify(store.getCartContent),
20497-
amount: 5000,
20497+
amount: store.getCartTotal * 100,
2049820498
payment_method_id: paymentMethod.id
2049920499
});
20500-
axios.post("/api/purchase", kunde).then(function (response) {
20500+
axios.post("/api/purchase", finalCustomerDetails).then(function (response) {
2050120501
localState.paymentIsProcessing = true;
2050220502

2050320503
if (response.statusText === "Created") {

resources/js/components/Checkout/OrderCheckout.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ const checkout = async () => {
114114
return;
115115
}
116116
117-
const kunde = {
117+
const finalCustomerDetails = {
118118
...store.getCustomerDetails,
119119
cart: JSON.stringify(store.getCartContent),
120-
amount: 5000,
120+
amount: store.getCartTotal * 100,
121121
payment_method_id: paymentMethod.id,
122122
};
123123
124124
axios
125-
.post("/api/purchase", kunde)
125+
.post("/api/purchase", finalCustomerDetails)
126126
.then((response) => {
127127
localState.paymentIsProcessing = true;
128128

0 commit comments

Comments
 (0)