cambio para que coja el id que nos viene del producto.
This commit is contained in:
parent
7a52222a57
commit
b718d7e4eb
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue