Wt  3.3.8
Public Member Functions | List of all members
Wt::Payment::Order Class Reference

Contains information of a sales order. More...

#include <Wt/Payment/Order>

Public Member Functions

void setTax (const Money &tax)
 Sets sales taxes. More...
 
Money tax () const
 Returns sales taxes. More...
 
void setShipping (const Money &shipping)
 Sets shipping cost. More...
 
Money shipping () const
 Returns the shipping cost. More...
 
void setHandling (const Money &handling)
 Sets handling cost. More...
 
Money handling () const
 Returns handeling. More...
 
void setShippingDiscount (const Money &discount)
 Sets the shipping discount. More...
 
Money shippingDiscount () const
 Returns the shipping discount. More...
 
void setShippingInsurance (const Money &insurance)
 Sets shipping insurance. More...
 
Money shippingInsurance () const
 Returns shipping insurance. More...
 
void setPaymentTransactionId (const std::string &transactionId)
 Sets a payment transaction ID. More...
 
std::string paymentTransactionId () const
 Returns the payment transaction ID. More...
 
void setPaymentBroker (const std::string &broker)
 Sets the payment broker. More...
 
std::string paymentBroker () const
 Returns the payment broker. More...
 
void setDescription (const std::string description)
 Sets the order description. More...
 
std::string description () const
 Returns the order description. More...
 
const std::vector< OrderItem > & items () const
 Returns all items in the order. More...
 
std::vector< OrderItem > & items ()
 Returns all items in the order. More...
 
Money computeTotalItemCost () const
 Computes the total net cost of all items. More...
 
void setTotalItemCost (const Money &totalItemCost)
 Sets the total net cost of all items. More...
 
Money totalItemCost () const
 Returns the total item cost. More...
 
Money computeTotalOrderCost () const
 Computes the total cost of the order. More...
 
void setTotalOrderCost (const Money &totalOrderCost)
 Sets the total order cost. More...
 
Money totalOrderCost () const
 Returns the total order cost.
 

Detailed Description

Contains information of a sales order.

Usage example:

Wt::Payment::OrderItem item1, item2;
item1.setName("Waffle Maker");
item1.setNumber("00001");
item1.setDescription("Emweb FlipSide Belgian Waffle Maker");
item1.setQuantity(1);
item1.setUnitCost(Wt::Payment::Money(49, 99, "USD"));
order.items().push_back(item1);
order.setShipping(Wt::Payment::Money(7, 1, "USD"));
order.setTax(Wt::Payment::Money(500, 99, "USD"));

Member Function Documentation

Money Wt::Payment::Order::computeTotalItemCost ( ) const

Computes the total net cost of all items.

This computes the total item cost based on the list of items() in this order. This does not include tax, shipping, shippingDiscount, shippingInsurance and handling fees.

See also
items(), setTotalItemCost()
Money Wt::Payment::Order::computeTotalOrderCost ( ) const

Computes the total cost of the order.

Computes the total of totalItemCost(), tax(), shipping(), handling(), shippinDiscount() and shippingInsurance().

See also
setTotalOrderCost()
std::string Wt::Payment::Order::description ( ) const

Returns the order description.

See also
setDescription()
Money Wt::Payment::Order::handling ( ) const

Returns handeling.

See also
setHandling()
const std::vector<OrderItem>& Wt::Payment::Order::items ( ) const

Returns all items in the order.

See also
OrderItem
std::vector<OrderItem>& Wt::Payment::Order::items ( )

Returns all items in the order.

See also
OrderItem
std::string Wt::Payment::Order::paymentBroker ( ) const

Returns the payment broker.

See also
setPaymentBroker()
std::string Wt::Payment::Order::paymentTransactionId ( ) const

Returns the payment transaction ID.

See also
setPaymentTransactionId()
void Wt::Payment::Order::setDescription ( const std::string  description)

Sets the order description.

Sets a description for the total order.

void Wt::Payment::Order::setHandling ( const Money handling)

Sets handling cost.

This is the total cost for handling.

The default value is 0.

void Wt::Payment::Order::setPaymentBroker ( const std::string &  broker)

Sets the payment broker.

This identifies the payment broker that was used to provide payment for this order. This is usually set together with a payment transaction ID by the payment broker during the payment process.

See also
setPaymentTransactionId()
void Wt::Payment::Order::setPaymentTransactionId ( const std::string &  transactionId)

Sets a payment transaction ID.

This transaction identification number provides tracability of the payment, and is usually set by the payment broker during the payment process.

See also
setPaymentBroker()
void Wt::Payment::Order::setShipping ( const Money shipping)

Sets shipping cost.

This is the total shipping cost for the order, excluding discounts and insurance.

The default value is 0.

See also
setShippingInsurance(), setShippingDiscount()
void Wt::Payment::Order::setShippingDiscount ( const Money discount)

Sets the shipping discount.

The shipping order discount (which should be a negative number).

The default value is 0.

void Wt::Payment::Order::setShippingInsurance ( const Money insurance)

Sets shipping insurance.

The total order shipping insurance cost.

The default value is 0.

void Wt::Payment::Order::setTax ( const Money tax)

Sets sales taxes.

This is the total amount of taxes for the order.

The default value is 0 (your government may not like that !).

void Wt::Payment::Order::setTotalItemCost ( const Money totalItemCost)

Sets the total net cost of all items.

This sets the total item cost. This does not include tax, shipping, shippingDiscount, shippingInsurance and handling fees.

If you have specified the individual items, then you can use computeTotalItemCost() to set the computed value.

void Wt::Payment::Order::setTotalOrderCost ( const Money totalOrderCost)

Sets the total order cost.

This sets the total order cost. If you have specified the total item cost, and suitable values for tax, shipping and handling, then you can use computeTotalOrderCost() to set the computed value.

Money Wt::Payment::Order::shipping ( ) const

Returns the shipping cost.

See also
setShipping()
Money Wt::Payment::Order::shippingDiscount ( ) const

Returns the shipping discount.

See also
setShippingDiscount()
Money Wt::Payment::Order::shippingInsurance ( ) const

Returns shipping insurance.

See also
setShippingInsurance()
Money Wt::Payment::Order::tax ( ) const

Returns sales taxes.

See also
setTax()
Money Wt::Payment::Order::totalItemCost ( ) const

Returns the total item cost.

See also
setTotalItemCost()

Generated on Mon Sep 4 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11