Descuentos

Describe los descuentos que se aplicarán a una orden.

Objeto Descuento

Atributos

Tipo

Descripción

id

string

Identificador único del descuento, asignado al azar.

code

string

Código del descuento.

type

string

Puede ser 'loyalty', 'campaign', 'coupon' o 'sign'

amount

integer

La cantidad a descontar de la suma total de todos los pagos, en centavos.

puts discount_line.inspect

{
  "code" => "123",
  "amount" => 600,
  "type" => "loyalty",
  "object" => "discount_line",
  "id" => "dis_lin_2fw8nZ9gwQei9A1JM",
  "parent_id" => "ord_2fw8nZCwQZhqLyPxh"
}
{
  "code": "123",
  "amount": 600,
  "type": "loyalty",
  "object": "discount_line",
  "id": "dis_lin_2fw8nZ9gwQei9A1JM",
  "parent_id": "ord_2fw8nZCwQZhqLyPxh"
}
echo $discount_line;

{
  "code": "123",
  "amount": 600,
  "type": "loyalty",
  "object": "discount_line",
  "id": "dis_lin_2fw8nZ9gwQei9A1JM",
  "parent_id": "ord_2fw8nZCwQZhqLyPxh"
}
console.log(discount_line);

{
  code: "123",
  amount: 600,
  type: "loyalty",
  object: "discount_line",
  id: "dis_lin_2fw8nZ9gwQei9A1JM",
  parent_id: "ord_2fw8nZCwQZhqLyPxh"
}
print discount_line

{
  "code": "123",
  "amount": 600,
  "type": "loyalty",
  "object": "discount_line",
  "id": "dis_lin_2fw8nZ9gwQei9A1JM",
  "parent_id": "ord_2fw8nZCwQZhqLyPxh"
}
System.out.println(discountLine.toString());

{
  amount=5,
  code=Cupon de descuento,
  id=dis_lin_2fwchSbbQ2hjADDUo,
  type=loyalty
}
System.Console.WriteLine(discountLine);

{
  "code": "123",
  "amount": 600,
  "type": "loyalty",
  "object": "discount_line",
  "id": "dis_lin_2fw8nZ9gwQei9A1JM",
  "parent_id": "ord_2fw8nZCwQZhqLyPxh"
}
{
  "code": "123",
  "amount": 600,
  "type": "loyalty",
  "object": "discount_line",
  "id": "dis_lin_2fw8nZ9gwQei9A1JM",
  "parent_id": "ord_2fw8nZCwQZhqLyPxh"
}