cambio para que coja el id que nos viene del producto.

This commit is contained in:
Jaume Solís 2024-04-18 12:02:47 +02:00
parent 7a52222a57
commit b718d7e4eb
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ const redsysProviders = require('./redsys/redsys.providers')
class PaymentServices {
async Create(req, res) {
try {
//parâmetros para retornar os produtos que serão comprados
//parameters to return the products that will be purchased
const { products, dateExpired, postalCode, customer, type } = req.body
const _products = await db.getProducts(dateExpired, postalCode)
@ -41,9 +41,9 @@ class PaymentServices {
}
},
})
console.log(jsonOrderData);
const order = await db.orderData_put(jsonOrderData);
const orderFk = order[0][0].orderFk
//const orderFk = order[0][0].orderFk
const orderFk = jsonOrderData.customer.customerData.products[0].id;
if (type === "paypal") {
const data = await payPalProviders.New(orderFk, price)