Wt
4.11.1
|
Contains information of a sales order. More...
#include <Wt/Payment/Order.h>
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. | |
Contains information of a sales order.
Usage example:
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.
Money Wt::Payment::Order::computeTotalOrderCost | ( | ) | const |
Computes the total cost of the order.
Computes the total of totalItemCost(), tax(), shipping(), handling(), shippinDiscount() and shippingInsurance().
std::string Wt::Payment::Order::description | ( | ) | const |
Returns the order description.
Money Wt::Payment::Order::handling | ( | ) | const |
Returns handeling.
std::vector<OrderItem>& Wt::Payment::Order::items | ( | ) |
Returns all items in the order.
const std::vector<OrderItem>& Wt::Payment::Order::items | ( | ) | const |
Returns all items in the order.
std::string Wt::Payment::Order::paymentBroker | ( | ) | const |
Returns the payment broker.
std::string Wt::Payment::Order::paymentTransactionId | ( | ) | const |
Returns the payment transaction ID.
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.
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.
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.
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.
Money Wt::Payment::Order::shippingDiscount | ( | ) | const |
Returns the shipping discount.
Money Wt::Payment::Order::shippingInsurance | ( | ) | const |
Returns shipping insurance.
Money Wt::Payment::Order::totalItemCost | ( | ) | const |
Returns the total item cost.