Skip to content

classes_modules_payment_ishoporder.class

Daniel Spors edited this page Dec 19, 2023 · 3 revisions

Classes in file modules/payment/ishoporder.class.php

interface IShopOrder

Order Models must implement this interface.

DoAddVat

Checks if VAT needs to be paid.

Definition: public function DoAddVat()

Returns: bool true or false

FromOrderId

Creates an instance from an order id.

Definition: public static function FromOrderId($order_id)

Returns: IShopOrder The new/loaded order Model

Parameters:

  • mixed $order_id ID of order to load

GetAddress

Gets the orders address.

Definition: public function GetAddress()

Returns: ShopOrderAddress The order address

GetCurrency

Gets the currency code.

Definition: public function GetCurrency()

Returns: string A valid currency code

GetInvoiceId

Gets the invoice ID.

Definition: public function GetInvoiceId()

Returns: mixed Invoice identifier

GetLocale

Gets the order culture code. See CultureInfo

Definition: public function GetLocale()

Returns: string Valid culture code

GetTotalPrice

Return the total price incl. VAT (if VAT applies for the given country).

Definition: public function GetTotalPrice($price=false)

Returns: float Price including VAT (if VAT applies for the country).

Parameters:

  • float $price The price without VAT.

GetTotalVat

Return the total VAT (if VAT applies for the given country).

Definition: public function GetTotalVat()

Returns: float VAT in order currency

GetVatPercent

Return the total VAT percent (if VAT applies for the given country).

Definition: public function GetVatPercent()

Returns: float VAT percent

ListItems

Returns all items.

Definition: public function ListItems()

Returns: array A list of IShopOrderItem objects

SetCurrency

Sets the currency

Definition: public function SetCurrency($currency_code)

Returns: void

Parameters:

  • string $currency_code A valid currency code

SetFailed

Called when the order has failed. This is a callback from the payment processor. Will be called when there was an error in the payment process. This can be synchronous (when cutsomer aborts in then initial payment ui) or asynchronous when something goes wrong later in the payment processors processes.

Definition: public function SetFailed($payment_provider_type, $transaction_id, $statusmsg=false)

Returns: void

Parameters:

  • int $payment_provider_type Provider type identifier (PaymentProvider::PROCESSOR_PAYPAL, PaymentProvider::PROCESSOR_GATE2SHOP, ...)

  • mixed $transaction_id Transaction identifier (from the payment provider)

  • string $statusmsg An optional status message

SetPaid

Called when the order has been paid. This is a callback from the payment processor. Will be called when the customer has paid the order.

Definition: public function SetPaid($payment_provider_type, $transaction_id, $statusmsg=false)

Returns: void

Parameters:

  • int $payment_provider_type Provider type identifier (PaymentProvider::PROCESSOR_PAYPAL, PaymentProvider::PROCESSOR_GATE2SHOP, ...)

  • mixed $transaction_id Transaction identifier (from the payment provider)

  • string $statusmsg An optional status message

SetPending

Called when the order has reached pending state. This is a callback from the payment processor. Will be called when the customer has paid the order but the payment has not yet been finished/approved by the provider.

Definition: public function SetPending($payment_provider_type, $transaction_id, $statusmsg=false)

Returns: void

Parameters:

  • int $payment_provider_type Provider type identifier (PaymentProvider::PROCESSOR_PAYPAL, PaymentProvider::PROCESSOR_GATE2SHOP, ...)

  • mixed $transaction_id Transaction identifier (from the payment provider)

  • string $statusmsg An optional status message

SetRefunded

Called when the order has been refunded. This is a callback from the payment processor. Will be called when the payment was refunded for any reason. This can be reasons from the provider and/or from the customer (when he cancels the payment later).

Definition: public function SetRefunded($payment_provider_type, $transaction_id, $statusmsg=false)

Returns: void

Parameters:

  • int $payment_provider_type Provider type identifier (PaymentProvider::PROCESSOR_PAYPAL, PaymentProvider::PROCESSOR_GATE2SHOP, ...)

  • mixed $transaction_id Transaction identifier (from the payment provider)

  • string $statusmsg An optional status message

Clone this wiki locally