PaymentMethod

Contracts

FrontendPaymentMethodRepositoryContract

The FrontendPaymentMethodRepositoryContract is the interface for the front end payment method repository. Get the payment method information to be displayed in the online store.

Namespace

Plenty\Modules\Frontend\PaymentMethod\Contracts

Methods

public getCurrentPaymentMethodsList():array

Lists all payment methods of the current customer session.

public getCurrentPaymentMethodsListForSwitch(int $currentPaymentMethodId, int $orderId = null, string $lang = "de"):array

Lists all payment methods for switch.

Parameters
int $currentPaymentMethodId
int $orderId
string $lang
public getCurrentPaymentMethodsForExpressCheckout():array

Lists all payment methods if express checkout is available

public getPaymentMethodName(PaymentMethod
 $paymentMethod, string $lang):string

Gets the name of the payment method in the specified language.

Parameters
PaymentMethod $paymentMethod The payment method
string $lang The language
public getPaymentMethodFee(PaymentMethod
 $paymentMethod):float

Gets additional costs for the payment method. Additional costs can be entered in the config.json.

Parameters
PaymentMethod $paymentMethod The payment method
public getPaymentMethodIcon(PaymentMethod
 $paymentMethod, string $lang):string

Gets the icon of the payment method. The path of the icon can be entered in the config.json.

Parameters
PaymentMethod $paymentMethod The payment method
string $lang The language
public getPaymentMethodDescription(PaymentMethod
 $paymentMethod, string $lang):string

Gets the description of the payment method. The description can be entered in the config.json.

Parameters
PaymentMethod $paymentMethod
string $lang
public getPaymentMethodSourceUrl(PaymentMethod
 $paymentMethod):string

Gets the detail link of the payment method. The detail link can be entered in the config.json.

Parameters
PaymentMethod $paymentMethod
public getIsSwitchableTo(PaymentMethod
 $paymentMethod):bool

Gets the detail link of the payment method. The detail link can be entered in the config.json.

Parameters
PaymentMethod $paymentMethod
public getIsSwitchableFrom(PaymentMethod
 $paymentMethod):bool

Gets the detail link of the payment method. The detail link can be entered in the config.json.

Parameters
PaymentMethod $paymentMethod
public getPaymentMethodIsSelectable(PaymentMethod
 $paymentMethod):bool

Get true if the payment method can be selected in the payment method list

Parameters
PaymentMethod $paymentMethod
public getPaymentMethodNameById(int $paymentMethodId, string $lang):string

Gets the name of the payment method by ID and language. The ID of the payment method and the language must be specified.

Parameters
int $paymentMethodId The ID of the payment method
string $lang The language
public getPaymentMethodFeeById(int $paymentMethodId):float

Gets additional costs for the payment method by ID. The ID of the payment method must be specified.

Parameters
int $paymentMethodId The ID of the payment method
public getPaymentMethodIconById(int $paymentMethodId, string $lang):string

Gets the icon of the payment method by ID and language. The ID of the payment method and the language must be specified.

Parameters
int $paymentMethodId The ID of the payment method
string $lang The language
public getPaymentMethodDescriptionById(int $paymentMethodId, string $lang):string

Gets the description of the payment method by ID and language. The ID of the payment method and the language must be specified.

Parameters
int $paymentMethodId The ID of the payment method
string $lang The language
public getPaymentMethodSwitchToById(int $paymentMethodId, int $orderId = null):bool
Parameters
int $paymentMethodId
int $orderId
public getPaymentMethodSwitchFromById(int $paymentMethodId, int $orderId = null):bool
Parameters
int $paymentMethodId
int $orderId
public getPaymentMethodSwitchableToById(int $paymentMethodId, int $orderId = null):bool
Parameters
int $paymentMethodId
int $orderId
public getPaymentMethodSwitchableFromById(int $paymentMethodId, int $orderId = null):bool
Parameters
int $paymentMethodId
int $orderId

Frontend

Contracts

CurrencyExchangeRepositoryContract

The CurrencyExchangeRatioRepositoryContract is the interface for the currency exchange repository. This interface allows you to get the default system currency, to get exchange ratios for every currency and to convert an amount from the default currency into a given currency or from a given currency into the default currency.

Namespace

Plenty\Modules\Frontend\Contracts

Methods

public getExchangeRatioByCurrency(string $currency):float
Parameters
string $currency
public getDefaultCurrency():string

Get the default currency.

public convertFromDefaultCurrency(string $currency, float $amount, float $exchangeRatio = 0.0):float

Converts the given value from the default currency to the given currency.

Parameters
string $currency
float $amount
float $exchangeRatio
public convertToDefaultCurrency(string $currency, float $amount, float $exchangeRatio = 0.0):float

Converts the given value to the default currency from the given currency.

Parameters
string $currency
float $amount
float $exchangeRatio

Checkout

The CheckoutContract is the interface for the checkout repository. This interface allows to set the shipping country ID, the payment method ID, the shipping profile ID and the currency in the checkout.

Namespace

Plenty\Modules\Frontend\Contracts

Methods

public getShippingCountryId():int

Gets the shipping country ID.

public setShippingCountryId(int $shippingCountryId):void

Updates the ID of the shipping country. The ID must be specified.

Parameters
int $shippingCountryId The ID of the shipping country
public getPaymentMethodId():int

Gets the payment method id of the current shopping cart.

public setPaymentMethodId(int $paymentMethodId):void

Updates the ID of the payment method. The ID must be specified.

Parameters
int $paymentMethodId The ID of the payment method
public getShippingProfileId():int

Gets the shipping profile id of the current shopping cart.

public setShippingProfileId(int $shippingProfileId):void

Updates the ID of the shipping profile. The ID must be specified.

Parameters
int $shippingProfileId The ID of the shipping profile
public setCurrency(string $currency):void

Updates the currency. The currency must be specified.

Parameters
string $currency The currency
public setBasketReferrerId(int $referrerId):void

Updates the ID of the order referrer. The ID must be specified.

Parameters
int $referrerId The ID of the order referrer. The order referrer settings can be changed in the plentymarkets back end.
public getCustomerInvoiceAddressId():int

Gets the invoice address id of the current shopping cart.

public setCustomerInvoiceAddressId(int $invoiceAddressId):void

Sets the invoice address id for the current shopping cart.

Parameters
int $invoiceAddressId
public getCustomerShippingAddressId():int

Gets the shipping address id of the current shopping cart.

public setCustomerShippingAddressId(int $shippingAddressId):void

Sets the shipping address id for the current shopping cart.

Parameters
int $shippingAddressId
public validateCheckout():ValidateCheckoutEvent

Models

TotalVat

frontend total vat model

Namespace

Plenty\Modules\Frontend\Models

Properties

Type Name Description
int vatId
float vatAmount
float vatValue

Methods

public toArray()

Returns this model as an array.

Factories

FrontendFactory

Frontend-Factory

Namespace

Plenty\Modules\Frontend\Factories

Methods

public getLocale():LocaleService
public getAgent():AgentService
public getSystem():SystemService
public getAccount():AccountService
public getFile():FileService

Events

FrontendCurrencyChanged

The event is triggered when the currency is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getCurrency():string

Gets the currency.

public getCurrencyExchangeRatio():float

Gets the exchange rate used for converting the currency.

FrontendCustomerAddressChanged

The event is triggered when a customer address is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

FrontendUpdatePaymentSettings

The event is triggered when the payment method is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getPaymentMethodId():int

Gets the ID of the payment method.

FrontendUpdateInvoiceAddress

The event is triggered when the invoice address is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getAccountAddressId():int

Gets the ID of the address saved for the account.

FrontendShippingProfileChanged

The event is triggered when the shipping profile is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getShippingProfileId():void

Gets the ID of the shipping profile.

public setShippingProfileId($shippingProfileId):void

Updates the ID of the shipping profile. The ID must be specified.

Parameters
$shippingProfileId

FrontendUpdateDeliveryAddress

The event is triggered when the delivery address is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getAccountAddressId():int

Gets the ID of the address saved for the account.

FrontendLanguageChanged

The event is triggered when the language is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getLanguage():string

Gets the language of the online store.

FrontendShippingCountryChanged

The event is triggered when the shipping country is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getShippingCountryId():int

Gets the ID of the shipping country.

public setShippingCountryId(int $shippingCountryId):FrontendShippingCountryChanged

Updates the ID of the shipping country. The ID must be specified.

Parameters
int $shippingCountryId The ID of the shipping country

FrontendPaymentMethodChanged

The event is triggered when the payment method is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getPaymentMethodId():void

Gets the ID of the payment method.

public setPaymentMethodId($paymentMethodId):void

Updates the ID of the payment method. The ID must be specified.

Parameters
$paymentMethodId

ValidateCheckoutEvent

validation event

Namespace

Plenty\Modules\Frontend\Events

Methods

public getErrorKeysList():array
public addErrorKey(string $errorKey):Events
Parameters
string $errorKey

FrontendUpdateShippingSettings

The event is triggered when the shipping method is updated in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getShippingCosts():float

Gets the shipping costs.

public getParcelServiceId():int

Gets the ID of the shipping service provider.

public getParcelServicePresetId():int

Gets the preset ID of the shipping service provider.

FrontendReferrerChanged

The event is triggered when the referrer id is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods

public getReferrerId():void
public setReferrerId($referrerId):FrontendReferrerChanged
Parameters
$referrerId

Services

AgentService

Frontend-Service for agent information

Namespace

Plenty\Modules\Frontend\Services

Methods

public getLanguages():array
public getBrowser():string
public getPlatform():string
public getDevice():string
public getIsDesktop():bool
public getRobotName():string
public getIsRobot():bool
public getHttpHeaders():array
public getIsMobile():bool
public getIsTablet():bool

AccountService

Frontend-service for customer information

Namespace

Plenty\Modules\Frontend\Services

Methods

public getIsAccountLoggedIn():bool
public getAccountContactId():int

FileService

Frontend-service for file information

Namespace

Plenty\Modules\Frontend\Services

Methods

public addJsFile(string $jsFile):void
Parameters
string $jsFile
public get(string $key):void
Parameters
string $key
public hasGetMutator(string $key):bool

Determine if a get mutator exists for an attribute.

Parameters
string $key
public setAttributes($attributes):void
Parameters
$attributes
public setAttribute(string $key, $value):Models

Set a given attribute on the model.

Parameters
string $key
$value
public hasSetMutator(string $key):bool

Determine if a set mutator exists for an attribute.

Parameters
string $key
public changeValue(string $key, callable $callback):void
Parameters
string $key
callable $callback
public offsetExists($offset):bool
Parameters
$offset
public offsetGet($offset):void
Parameters
$offset
public offsetSet($offset, $value):void
Parameters
$offset
$value
public offsetUnset($offset):void
Parameters
$offset
public toArray(bool $translate = false):array
Parameters
bool $translate Flag indicating if values should be translated.
public toJson(int $options):string
Parameters
int $options
public jsonSerialize():void
public fill(array $attributes):Models

Fill the model with an array of attributes.

Parameters
array $attributes
public isFillable(string $key):bool

Determine if the given attribute may be mass assigned.

Parameters
string $key
public getFillable():array

Get the fillable attributes for the model.

public fillable(array $fillable):Models

Set the fillable attributes for the model.

Parameters
array $fillable
public hasCast(string $key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters
string $key
$types
public fromJson(string $value, bool $asObject = false):void

Decode the given JSON back into an array or object.

Parameters
string $value
bool $asObject

SystemService

Frontend-service for system information

Namespace

Plenty\Modules\Frontend\Services

Methods

public getPlentyId():int
public getWebstoreId():int

OrderPropertyFileService

Frontend-service for customer information

Namespace

Plenty\Modules\Frontend\Services

Methods

public uploadFile(array $fileData):string
Parameters
array $fileData
public getFileURL(string $key):string
Parameters
string $key
public getFile(string $key):StorageObject
Parameters
string $key
public copyBasketFileToOrder(string $filename):string
Parameters
string $filename
public deleteFile(string $filename):void
Parameters
string $filename

LocaleService

frontend service for changing current language

Namespace

Plenty\Modules\Frontend\Services

Methods

public setLanguage(string $newLanguage, bool $fireEvents = true):void
Parameters
string $newLanguage
bool $fireEvents

VatService

Frontend-service for vat information

Namespace

Plenty\Modules\Frontend\Services

Methods

public getCountryVatId():int
public getCurrentTotalVats():array
public getVat(string $taxIdNumber = ""):Vat
Parameters
string $taxIdNumber
public getLocationId(int $countryId = null):int

Get the ID of the location

Parameters
int $countryId

LegalInformation

Contracts

LegalInformationRepositoryContract

Repository contract for LegalInformation model.

Namespace

Plenty\Modules\Frontend\LegalInformation\Contracts

Methods

public find(int $plentyId, string $lang, string $type):LegalInformation

Get legal information of an online store

Parameters
int $plentyId The ID of the online store
string $lang The language of the legal information text as ISO 639-1 code, e.g. e.g. en for English
string $type The type of the legal information text. The types available are:
  • TermsConditions
  • CancellationRights
  • PrivacyPolicy
  • LegalDisclosure
  • WithdrawalForm
public save(array $data, int $plentyId, string $lang, string $type):LegalInformation

Save legal information for an online store

Parameters
array $data Array of data for 'plainText' and 'htmlText'
int $plentyId The plenty ID of the online store
string $lang The language of the legal information text as ISO 639-1 code, e.g. en for English
string $type The type of the legal information text. The types available are:
  • TermsConditions
  • CancellationRights
  • PrivacyPolicy
  • LegalDisclosure
  • WithdrawalForm

Models

LegalInformation

The legal information model.

Namespace

Plenty\Modules\Frontend\LegalInformation\Models

Properties

Type Name Description
int plentyId The unique identifier of the plenty client
string lang The language of the legal information text
string type The type of the legal information text. The types available are:
  • TermsConditions
  • CancellationRights
  • PrivacyPolicy
  • LegalDisclosure
  • WithdrawalForm
string plainText The text value of the legal information text
string htmlText The html value of the legal information text

Methods

public toArray()

Returns this model as an array.

Storage

Contracts

FrontendSessionStorageFactoryContract

The FrontendSessionStorageFactoryContract is the interface for the front end session storage repository. This interface allows to get information about the locale, the customer, the order, the plugin and the forum from the session.

Namespace

Plenty\Modules\Frontend\Session\Storage\Contracts

Methods

public getLocaleSettings():LocaleSettings

Get the locale settings from the session storage.

public getCustomer():Customer

Get the customer data from the session storage.

public getOrder():Order

Get the order data from the session storage.

public getPlugin():Plugin

Get the plugin data from the session storage.

public getForum():Forum

Get the forum data from the session storage.

Models

Forum

The session storage model for forum data.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Properties

Type Name Description
int forumGroupId The ID of the forum group
string forumUsername The name of the user in the forum
array forumConfig The forum configuration
array forumPermissions The forum permissions
int forumLastVisitTime The time the forum was visited last

Methods

public toArray()

Returns this model as an array.

Order

The session storage model for order data.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Properties

Type Name Description
int deliveryAddressId The ID of the delivery address
int invoiceAddressId The ID of the invoice address
int parcelServiceId The ID of the parcel service
int parcelServicePresetId The preset ID of the parcel service
int methodOfPayment The payment method
bool isNet Flag that indicates if the shown price is the net price
int shippingCosts The shipping costs
string orderinfoText Additional information specified by the customer in the order
int payDataComplete
array itemOrderParams The parameters of the order
array uploadedFileStack
array trustedShopBuyerProtection
string trustedShopApplicationId
string coupon The coupon code
string couponDisplay
array activePaymentMethodsList A list of active payment methods
int referrerId The ID of the order referrer
int referrerPriceColumn The price column for the order referrer
int referrerItemId The ID of the item referrer
int schedulerId The ID of the subscription
int schedulerIntervalId The ID of the interval of a subscription
int schedulerOrderExecutionId The ID for the execution of the order
int schedulerFirstDeliveryDate The date for the first delivery of a subscription

Methods

public toArray()

Returns this model as an array.

Plugin

The session storage model for plugins.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Methods

public setValue(string $key, $value):void

Updates the value of a key. The key and the new value must be specified.

Parameters
string $key
$value
public getValue(string $key):void

Gets a value for a key. The key must be specified.

Parameters
string $key
public unsetKey(string $key):void

Unsets a key. The key must be specified.

Parameters
string $key

LocaleSettings

The session storage model for locale settings.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Properties

Type Name Description
string currency The currency
float currencyExchange The exchange rate for the currency
string language The language

Methods

public toArray()

Returns this model as an array.

Customer

The session storage model for customer data.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Properties

Type Name Description
int deliveryCountryId The ID of the country of delivery
bool showNetPrice Flag that indicates if the shown price is the net price
string ebaySellerAccount The eBay seller account
string accountContactSign The reference sign specified by the contact
int accountContactClassId The ID of the contact class
int sourceItemWishListAccountContactId The ID of the contact that created the wish list
int sourceItemWishListAccountAddressId The ID of the address that created the wish list
string salesAgent The sales representative

Methods

public toArray()

Returns this model as an array.