Plentymarkets interface documentation

Payment

Contracts

PaymentContactRelationRepositoryContract

The PaymentContactRelationRepositoryContract is the interface for the payment contact relation repository. Create and delete relations between payments and contact.

Namespace

Plenty\Modules\Payment\Contracts

Methods
public createContactRelation($payment, $contact):Plenty\Modules\Payment\Models\PaymentContactRelation
Return type: PaymentContactRelation

Creates a payment contact relation.

Parameters

Name

Type

Description

$payment

Payment

The ID of the payment

$contact

Contact

The ID of the contact

public deleteContactRelation($payment):void

Deletes a payment contact relation.

Parameters

Name

Type

Description

$payment

Payment

The ID of the payment

PaymentMatcherRepositoryContract

The PaymentMatcherRepositoryContract automatically matching payments to an order.

Namespace

Plenty\Modules\Payment\Contracts

Methods
public checkMapPayment($mopId, $data):void

Checks and save the payment data

Parameters

Name

Type

Description

$mopId

int

$data

public checkMapFindAssignPayment($mopId, $data):string

Checks and assigns payment data.

Parameters

Name

Type

Description

$mopId

int

$data

public findAssignPayment($payment):void

Finds and assigns payment data

Parameters

Name

Type

Description

$payment

Payment

public getMatchingRatesForPayment($paymentId):array

Gets the matching of payment data with orders.

Parameters

Name

Type

Description

$paymentId

int

public getMatchingOrAssigningRatesForPayment($paymentId):array

Get matching or assigning rate list for a payment

Parameters

Name

Type

Description

$paymentId

int

PaymentOrderRelationRepositoryContract

The PaymentOrderRelationRepositoryContract is the interface for the payment order relation repository. Create and delete relations between payments and orders.

Namespace

Plenty\Modules\Payment\Contracts

Methods
public createOrderRelation($payment, $order):Plenty\Modules\Payment\Models\PaymentOrderRelation
Return type: PaymentOrderRelation

Creates a payment order relation.

Parameters

Name

Type

Description

$payment

Payment

The ID of the payment

$order

Order

The ID of the order

public findOrderRelation($payment):Plenty\Modules\Payment\Models\PaymentOrderRelation
Return type: PaymentOrderRelation

Gets the payment order relation.

Parameters

Name

Type

Description

$payment

Payment

public deleteOrderRelation($payment):void

Deletes a payment order relation.

Parameters

Name

Type

Description

$payment

Payment

The ID of the payment

public createOrderRelationWithValidation($paymentId, $orderId, $matchingRate = null, $allowMultiplePaymentsPerOrder = false):Plenty\Modules\Payment\Models\PaymentOrderRelation
Return type: PaymentOrderRelation

Assign a payment to an order ID if order ID is valid and order ID doesn't have a payment assigned.

Parameters

Name

Type

Description

$paymentId

int

$orderId

int

$matchingRate

int

$allowMultiplePaymentsPerOrder

bool

public createOrderRelationByInvoiceNumber($paymentId, $invoiceNumber, $allowMultiplePaymentsPerOrder = false):Plenty\Modules\Payment\Models\PaymentOrderRelation
Return type: PaymentOrderRelation

Assign a payment to an order if invoice number is valid.

Parameters

Name

Type

Description

$paymentId

int

$invoiceNumber

string

$allowMultiplePaymentsPerOrder

bool

public autoAssignPayments($paymentIds):array

Bulk auto assign payments

Parameters

Name

Type

Description

$paymentIds

array

public detachAllPayments($orderId):void

Detach all the payment from and order.

Parameters

Name

Type

Description

$orderId

int

public resetPaidAmount($payment):void

Reset paid amount of order payment and add details in payment history

Parameters

Name

Type

Description

$payment

Payment

PaymentPropertyRepositoryContract

The PaymentPropertyRepositoryContract is the interface for the payment property repository. List, get, create and update payment properties.

Namespace

Plenty\Modules\Payment\Contracts

Methods
public all():array

Lists properties.

public findByPropertyId($propertyId):array

Gets a property. The ID of the payment property must be specified.

Parameters

Name

Type

Description

$propertyId

int

The ID of the payment property

public allByPaymentId($paymentId):array

Lists properties of a payment. The ID of the payment must be specified.

Parameters

Name

Type

Description

$paymentId

int

The ID of the payment

public allByTypeId($typeId):array

Lists properties of a property type. The ID of the property type must be specified.

Parameters

Name

Type

Description

$typeId

int

The ID of the payment property type. The following property types are available: <ul> <li>Transaction ID = 1</li> <li>Reference ID = 2</li> <li>Booking text = 3</li> <li>Transaction password = 4</li> <li>Transaction code = 5</li> <li>Authorisation ID = 6</li> <li>Capture ID = 7</li> <li>Refund ID = 8</li> <li>Credit note ID = 9</li> <li>Order reference = 10</li> <li>Name of the sender = 11</li> <li>Email of the sender = 12</li> <li>The sender’s sort code = 13</li> <li>The sender’s bank name = 14</li> <li>The sender’s bank account number = 15</li> <li>The holder of the bank account = 16</li> <li>The country of the sender’s bank account = 17</li> <li>The sender’s IBAN = 18</li> <li>The sender’s BIC = 19</li> <li>Name of the recipient = 20</li> <li>The recipient’s bank account = 21</li> <li>Reference text of the payment = 22</li> <li>Payment origin = 23</li> <li>Shipping address ID = 24</li> <li>Invoice address ID = 25</li> <li>Item buyer = 26</li> <li>Item number = 27</li> <li>Item transaction ID = 28</li> <li>External transaction type = 29</li> <li>External transaction status = 30</li> </ul>

public findByCreatedDateInterval($startDate, $endDate):array

Lists properties by creation date. The start and the end of the date range must be specified.

Parameters

Name

Type

Description

$startDate

string

The start date of the date range for the date of creation of the property

$endDate

string

The end date of the date range for the date of creation of the property

public createProperty($data):Plenty\Modules\Payment\Models\PaymentProperty
Return type: PaymentProperty

Creates a payment property.

Parameters

Name

Type

Description

$data

public changeProperty($data):Plenty\Modules\Payment\Models\PaymentProperty
Return type: PaymentProperty

Updates a payment property.

Parameters

Name

Type

Description

$data

PaymentProperty

PaymentPropertyTypeNameRepositoryContract

The PaymentPropertyTypeNameRepositoryContract is the interface for the repository of payment property type names. List, get, create and update payment property names.

Namespace

Plenty\Modules\Payment\Contracts

Methods
public allTypeNames($lang):array

Lists payment property type names. The language of the property type names must be specified.

Parameters

Name

Type

Description

$lang

string

The language of the payment property type name

public findByNameId($nameId):array

Finds a payment property type name. The ID of the payment property type name must be specified.

Parameters

Name

Type

Description

$nameId

int

The ID of the payment property type name

public createTypeName($data):Plenty\Modules\Payment\Models\PaymentPropertyTypeName
Return type: PaymentPropertyTypeName

Creates a payment property type name.

Parameters

Name

Type

Description

$data

public changeProperty($data):array

Updates a payment property type name.

Parameters

Name

Type

Description

$data

PaymentPropertyTypeRepositoryContract

The PaymentPropertyTypeRepositoryContract is the interface for the payment property type repository. List, get, create and update payment properties.

Namespace

Plenty\Modules\Payment\Contracts

Methods
public allTypes($lang):array

Lists payment property types. The language of the property type must be specified.

Parameters

Name

Type

Description

$lang

string

The language of the payment property type

public findTypesById($id, $lang):array

Gets a payment property type. The ID of the property type must be specified.

Parameters

Name

Type

Description

$id

int

The ID of the payment property type. The following property types are available: <ul> <li>Transaction ID = 1</li> <li>Reference ID = 2</li> <li>Booking text = 3</li> <li>Transaction password = 4</li> <li>Transaction code = 5</li> <li>Authorisation ID = 6</li> <li>Capture ID = 7</li> <li>Refund ID = 8</li> <li>Credit note ID = 9</li> <li>Order reference = 10</li> <li>Name of the sender = 11</li> <li>Email of the sender = 12</li> <li>The sender’s sort code = 13</li> <li>The sender’s bank name = 14</li> <li>The sender’s bank account number = 15</li> <li>The holder of the bank account = 16</li> <li>The country of the sender’s bank account = 17</li> <li>The sender’s IBAN = 18</li> <li>The sender’s BIC = 19</li> <li>Name of the recipient = 20</li> <li>The recipient’s bank account = 21</li> <li>Reference text of the payment = 22</li> <li>Payment origin = 23</li> <li>Shipping address ID = 24</li> <li>Invoice address ID = 25</li> <li>Item buyer = 26</li> <li>Item number = 27</li> <li>Item transaction ID = 28</li> <li>External transaction type = 29</li> <li>External transaction status = 30</li> </ul>

$lang

string

The language of the payment property type

public createType($data):Plenty\Modules\Payment\Models\PaymentPropertyType
Return type: PaymentPropertyType

Creates a payment property type.

Parameters

Name

Type

Description

$data

public changeProperty($data):Plenty\Modules\Payment\Models\PaymentPropertyType
Return type: PaymentPropertyType

Updates a payment property type.

Parameters

Name

Type

Description

$data

PaymentRepositoryContract

The PaymentRepositoryContract is the interface for the payment repository. List, get, create and update payments. Payments can come into plentymarkets automatically or can be booked manually. Existing payments can be filtered by payment method, by ID, by payment status, by transaction type, by order or by date. Existing payments can also be updated.

Namespace

Plenty\Modules\Payment\Contracts

Methods
public getAll($itemsPerPage = 50, $page = 1):array

Lists payments.

Parameters

Name

Type

Description

$itemsPerPage

int

The number of items to list per page

$page

int

The page of results to search for

Return type: PaginatedResult

Searches for a list of payments.

Parameters

Name

Type

Description

$page

int

The shown page. Default value is 1.

$itemsPerPage

int

The items shown per page. Default value is 50.

$with

array

The relations to be loaded.

public getPaymentById($paymentId):Plenty\Modules\Payment\Models\Payment
Return type: Payment

Gets a payment. The ID of the payment must be specified.

Parameters

Name

Type

Description

$paymentId

int

The ID of the payment

public getPaymentsByMethodId($methodId, $itemsPerPage = 50, $page = 1):array

Lists payments of a payment method. The ID of the payment method must be specified.

Parameters

Name

Type

Description

$methodId

int

The ID of the payment method

$itemsPerPage

int

The number of items to list per page

$page

int

The page of results to search for

public getPaymentsByStatusId($statusId, $itemsPerPage = 50, $page = 1):array

Lists payments of a payment status. The ID of the payment status must be specified.

Parameters

Name

Type

Description

$statusId

int

The ID of the payment status

$itemsPerPage

int

The number of items to list per page

$page

int

The page of results to search for

public getPaymentsByTransactionType($transactionType, $itemsPerPage = 50, $page = 1):array

Lists payments of a transaction type. The transaction type must be specified.

Parameters

Name

Type

Description

$transactionType

int

The transaction type of the payment

$itemsPerPage

int

The number of items to list per page

$page

int

The page of results to search for

public getPaymentsByOrderId($orderId):array

Lists payments of an order. The ID of the order must be specified.

Parameters

Name

Type

Description

$orderId

int

The ID of the order

public getPaymentsByImportDateInterval($startDate, $endDate, $itemsPerPage = 50, $page = 1):array

Lists payments by import date. The start and the end of the date range must be specified.

Parameters

Name

Type

Description

$startDate

string

The start date of the date range for the import date of the payment

$endDate

string

The end date of the date range for the import date of the payment

$itemsPerPage

int

The number of items to list per page

$page

int

The page of results to search for

public getPaymentsByEntryDateInterval($startDate, $endDate, $itemsPerPage = 50, $page = 1):array

Lists payments by entry date. The start and the end of the date range must be specified.

Parameters

Name

Type

Description

$startDate

string

The start date of the date range for the entry date of the payment

$endDate

string

The end date of the date range for the entry date of the payment

$itemsPerPage

int

The number of items to list per page

$page

int

The page of results to search for

public getPaymentsByPropertyTypeAndValue($propertyTypeId, $propertyValue = &quot;&quot;, $itemsPerPage = 50, $page = 1):void

Lists payments by payment property type and value.

Parameters

Name

Type

Description

$propertyTypeId

int

The property type

$propertyValue

The property value

$itemsPerPage

int

The number of items to list per page

$page

int

The page of results to search for

public createPayment($data):Plenty\Modules\Payment\Models\Payment
Return type: Payment

Creates a payment.

Parameters

Name

Type

Description

$data

public updatePayment($data):Plenty\Modules\Payment\Models\Payment
Return type: Payment

Updates a payment.

Parameters

Name

Type

Description

$data

public getStatusConstants():array
public getOriginConstants():array
public deletePayment($paymentId):void
Parameters

Name

Type

Description

$paymentId

int

public splitAndAssignPayment($paymentId, $orderIds):bool

Split and assign a payment to given order IDs

Parameters

Name

Type

Description

$paymentId

int

$orderIds

array

public deletePayments($paymentIds):array

Bulk delete payments.

Parameters

Name

Type

Description

$paymentIds

array

An array containing payment ids. Eg: [ids ⇒ [1, 2, 3]]

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

Exceptions

PaymentMatcherException

Class PaymentMatcherException

Namespace

Plenty\Modules\Payment\Exceptions

Models

Payment

The payment model representing a received payment by a payment service provider.

Namespace

Plenty\Modules\Payment\Models

Properties
Name Type Description

id

int

The ID of the payment

amount

float

The amount of the payment

exchangeRatio

float

The exchange rate. Exchange rates are used if the default currency saved in plentymarkets differs from the currency of the order.

parentId

int

The ID of the parent payment

deleted

int

A deleted payment. Deleted payments have the value 1 and are not displayed in the plentymarkets back end.

unaccountable

int

An unassigned payment. Unassigned payments have the value 1.

currency

string

The currency of the payment in ISO 4217 code.

type

string

The payment type. Available types are credit and debit.

hash

string

The hash code of the payment. The hash code consists of 32 characters and is automatically generated.

origin

int

The origin of the payment. The following origins are available: <ul> <li>Undefined = 0</li> <li>System = 1</li> <li>Manually = 2</li> <li>SOAP = 3</li> <li>Import = 4</li> <li>Split payment = 5</li> <li>Plugin = 6</li> <li>POS = 7</li> </ul>

receivedAt

string

The time the payment was received

importedAt

string

The time the payment was imported

status

int

The <a href="https://developers.plentymarkets.com/en-gb/developers/main/rest-api-guides/getting-started.html#_payment_status_ids" target="_blank">status</a> of the payment

transactionType

int

The transaction type of the payment. The following transaction types are available: <ul> <li>Interim transaction report = 1</li> <li>Booked payment = 2</li> <li>Split payment = 3</li> </ul>

mopId

int

The ID of the payment method

parent

Payment

The parent payment

children

method

PaymentMethod

The payment method

order

PaymentOrderRelation

contact

PaymentContactRelation

histories

array

The payment history

properties

array

The properties of the payment

regenerateHash

bool

If $regenerateHash is true, regenerate the payment hash value. Default is false.

updateOrderPaymentStatus

bool

If $updateOrderPaymentStatus is true, update the order payment status. Default is false.

isSystemCurrency

bool

If $isSystemCurrency is false, the value will be converted to the standard currency with the provided exchange rate. If $isSystemCurrency is true, the value is not converted. Default is true.

Methods
public toArray()

Returns this model as an array.

PaymentContactRelation

The payment contact relation model

Namespace

Plenty\Modules\Payment\Models

Properties
Name Type Description

id

int

The ID of the payment order relation

paymentId

int

The ID of the payment

contactId

int

The ID of the contact

assignedAt

string

The time the payment contact relation was assigned

Methods
public toArray()

Returns this model as an array.

PaymentOrderRelation

The payment order relation model

Namespace

Plenty\Modules\Payment\Models

Properties
Name Type Description

id

int

The ID of the payment order relation

paymentId

int

The ID of the payment

orderId

int

The ID of the order

assignedAt

string

The time the payment order relation was assigned

Methods
public toArray()

Returns this model as an array.

PaymentProperty

The payment property model

Namespace

Plenty\Modules\Payment\Models

Properties
Name Type Description

id

int

The ID of the payment property

paymentId

int

The ID of the payment

typeId

int

The ID of the property type. The following property types are available: <ul> <li>Transaction ID = 1</li> <li>Reference ID = 2</li> <li>Booking text = 3</li> <li>Transaction password = 4</li> <li>Transaction code = 5</li> <li>Authorisation ID = 6</li> <li>Capture ID = 7</li> <li>Refund ID = 8</li> <li>Credit note ID = 9</li> <li>Order reference = 10</li> <li>Name of the sender = 11</li> <li>Email of the sender = 12</li> <li>The sender’s sort code = 13</li> <li>The sender’s bank name = 14</li> <li>The sender’s bank account number = 15</li> <li>The holder of the bank account = 16</li> <li>The country of the sender’s bank account = 17</li> <li>The sender’s IBAN = 18</li> <li>The sender’s BIC = 19</li> <li>Name of the recipient = 20</li> <li>The recipient’s bank account = 21</li> <li>Reference text of the payment = 22</li> <li>Payment origin = 23</li> <li>Shipping address ID = 24</li> <li>Invoice address ID = 25</li> <li>Item buyer = 26</li> <li>Item number = 27</li> <li>Item transaction ID = 28</li> <li>External transaction type = 29</li> <li>External transaction status = 30</li> <li>The receiver’s IBAN = 31</li> <li>The receiver’s BIC = 32</li> <li>Transaction fee = 33</li> <li>Transaction lifespan = 34</li> <li>Matching rate = 36</li> </ul>

value

string

The value of the property type

payment

Payment

type

PaymentPropertyType

Methods
public toArray()

Returns this model as an array.

PaymentPropertyType

The payment property type model

Namespace

Plenty\Modules\Payment\Models

Properties
Name Type Description

id

int

The ID of the property type

erasable

int

Specifies whether the property type can be deleted. Property types that can be deleted have the value 1. Default property types cannot be deleted.

position

int

The position number of the property type

name

PaymentPropertyTypeName

The name of the property type

Methods
public toArray()

Returns this model as an array.

PaymentPropertyTypeName

The payment property type name model

Namespace

Plenty\Modules\Payment\Models

Properties
Name Type Description

id

int

The ID of the name of the property type

typeId

int

The ID of the property type

lang

string

The language of the name of the property type

name

string

The name of the property type

Methods
public toArray()

Returns this model as an array.

Events

Checkout

ExecutePayment

The event is triggered when a payment is executed.

Namespace

Plenty\Modules\Payment\Events\Checkout

Methods
public setOrderId($orderId):Plenty\Modules\Payment\Events\Checkout\ExecutePayment
Return type: ExecutePayment

Updates the ID of the order in the checkout. The ID must be specified.

Parameters

Name

Type

Description

$orderId

int

The ID of the order

public getOrderId():int

Gets the ID of the order.

public setMop($mop):Plenty\Modules\Payment\Events\Checkout\ExecutePayment
Return type: ExecutePayment

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

Parameters

Name

Type

Description

$mop

int

The ID of the payment method

public getMop():int

Gets the ID of the payment method.

public setType($type):Plenty\Modules\Payment\Events\Checkout\ExecutePayment
Return type: ExecutePayment

Updates the content type.

Parameters

Name

Type

Description

$type

string

The <a href="https://developers.plentymarkets.com/dev-doc/payment-plugins#payment-prepare-payment">content type</a> of the payment plugin

public getType():string

Gets the content type.

public setValue($value):Plenty\Modules\Payment\Events\Checkout\ExecutePayment
Return type: ExecutePayment

Updates the value of the content type.

Parameters

Name

Type

Description

$value

string

The value of the content type

public getValue():string

Gets the value of the content type.

GetPaymentMethodContent

The event is triggered after the payment method is selected in the checkout.

Namespace

Plenty\Modules\Payment\Events\Checkout

Methods
public setMop($mop):Plenty\Modules\Payment\Events\Checkout\GetPaymentMethodContent
Return type: GetPaymentMethodContent

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

Parameters

Name

Type

Description

$mop

int

The ID of the payment method

public getMop():int

Gets the ID of the payment method.

public setType($type):Plenty\Modules\Payment\Events\Checkout\GetPaymentMethodContent
Return type: GetPaymentMethodContent

Updates the content type.

Parameters

Name

Type

Description

$type

string

The <a href="https://developers.plentymarkets.com/dev-doc/payment-plugins#payment-prepare-payment">content type</a> of the payment plugin

public getType():string

Gets the content type.

public setValue($value):Plenty\Modules\Payment\Events\Checkout\GetPaymentMethodContent
Return type: GetPaymentMethodContent

Updates the value of the content type.

Parameters

Name

Type

Description

$value

string

The value of the content type

public getValue():string

Gets the value of the content type.

public setParams($params):Plenty\Modules\Payment\Events\Checkout\GetPaymentMethodContent
Return type: GetPaymentMethodContent

Updates the parameters. The parameters must be specified.

Parameters

Name

Type

Description

$params

The parameters

public getParams():void

Gets the parameters.

History

Contracts

PaymentHistoryRepositoryContract

The PaymentHistoryRepositoryContract is the interface for the payment history repository. Get and create the payment history.

Namespace

Plenty\Modules\Payment\History\Contracts

Methods
public getByPaymentId($paymentId, $typeId):array

Gets the payment history for a payment. The ID of the payment and the ID of the payment type must be specified.

Parameters

Name

Type

Description

$paymentId

int

The ID of the payment

$typeId

int

The ID of the history type. The following types are available: <ul> <li>Created = 1</li> <li>Status updated = 2</li> <li>Assigned = 3</li> <li>Detached = 4</li> <li>Deleted = 5</li> <li>Updated = 6</li> </ul>

public getByOrderId($orderId):void

Get payment history by order ID.

Parameters

Name

Type

Description

$orderId

int

public createHistory($data):Plenty\Modules\Payment\History\Models\PaymentHistory
Return type: PaymentHistory

Creates the payment history.

Parameters

Name

Type

Description

$data

Models

PaymentHistory

The payment history model

Namespace

Plenty\Modules\Payment\History\Models

Properties
Name Type Description

id

int

The ID of the payment history

paymentId

int

The ID of the payment

typeId

int

The ID of the history type. The following types are available: <ul> <li>Created = 1</li> <li>Status updated = 2</li> <li>Assigned = 3</li> <li>Detached = 4</li> <li>Deleted = 5</li> <li>Updated = 6</li> </ul>

value

string

The value of the payment history

user

string

The user who initiated the action

Methods
public toArray()

Returns this model as an array.

MatcherRules

Contracts

PaymentMatcherRulesContainerContract

Payment Matcher Rules Container Service

Namespace

Plenty\Modules\Payment\MatcherRules\Contracts

Methods
public registerRule($ruleClass, $mopIds = []):void

Register a specific rule class, either for specific methods of payment, or, lacking the second param, for all

Parameters

Name

Type

Description

$ruleClass

string

$mopIds

array

public getRegisteredRules($mopId):array

Gets all registered rules that apply to a specific method of payment If the payment method doesn't have any specificity, the rule set that applies generically is returned

Parameters

Name

Type

Description

$mopId

int

public excludeRuleForMethods($ruleClass, $mopIds):void

Excludes the specified rule from the method's ruleset.

Parameters

Name

Type

Description

$ruleClass

string

$mopIds

array

Rules

CheckMatchedOrderInvoiceAmount

Invoice Amount Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchAlreadyOverpaid

Already Overpaid Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchAmount

Amount Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchCustomerEmail

Customer E-Mail Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchCustomerId

Customer ID Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchCustomerName

Customer Name Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchDeutschePost

Deutsche Post Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchEbayName

Ebay Name Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchEbayTransactionId

Ebay Transaction ID Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchEbayUniquePaymentId

Ebay Unique Payment ID Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchExternalOrderId

External Order ID Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchInvoiceNumber

Invoice Number Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchOrderId

Order ID Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchPackageNum

Package Number Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchPaymentBeforeEntryDate

Payment Before Entry Date Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

MatchPaymentTransactionId

Payment Transaction ID Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

PaymentMatcherBaseRule

Abstract Payment Matcher Rule

Namespace

Plenty\Modules\Payment\MatcherRules\Rules

Methods
public getScoreUp():int
public setScoreUp($scoreUp):void
Parameters

Name

Type

Description

$scoreUp

int

public getScoreDown():void
public setScoreDown($scoreDown):void
Parameters

Name

Type

Description

$scoreDown

public calculateMatchingCondition($payment):int

calculate the matching condition used in 2 rules - amount and email

Parameters

Name

Type

Description

$payment

Payment

public canScore($payment, $matchScore, $scoringLog):bool
Parameters

Name

Type

Description

$payment

Payment

$matchScore

int

$scoringLog

array

public score($payment, $order):float
Parameters

Name

Type

Description

$payment

Payment

$order

Order

Method

Contracts

PaymentMethodContainer

The payment method container

Namespace

Plenty\Modules\Payment\Method\Contracts

Methods
public register($paymentKey, $paymentMethodServiceClass, $rebuildEventClassesList):void

Registers a payment method

Parameters

Name

Type

Description

$paymentKey

string

The unique key of a payment plugin

$paymentMethodServiceClass

The class of the payment method. This class contains information of the payment plugin, such as the name and whether the payment method is active.

$rebuildEventClassesList

array

A list of events. It is checked again for the list of events whether the payment method is active.

public isRegistered($paymentKey):bool

Checks registered payment method

Parameters

Name

Type

Description

$paymentKey

string

PaymentMethodRepositoryContract

The PaymentMethodRepositoryContract is the interface for the payment method repository. List, get, create and update payment methods.

Namespace

Plenty\Modules\Payment\Method\Contracts

Methods
public all():array

Lists payment methods.

public allForPlugin($pluginKey):array

Lists payment methods for a plugin key. The plugin key must be specified.

Parameters

Name

Type

Description

$pluginKey

string

The plugin key

public allPluginPaymentMethods():array

Get all plugin payment methods.

public allOldPaymentMethods():array

Get all old payment methods.

public findByPaymentMethodId($paymentMethodId):Plenty\Modules\Payment\Method\Models\PaymentMethod
Return type: PaymentMethod

Gets a payment method. The ID of the payment method must be specified.

Parameters

Name

Type

Description

$paymentMethodId

int

The ID of the payment method

public findByPluginAndPaymentKey($pluginKey, $paymentKey):Plenty\Modules\Payment\Method\Models\PaymentMethod
Return type: PaymentMethod

Gets a payment method. The plugin and the payment key must be specified.

Parameters

Name

Type

Description

$pluginKey

string

$paymentKey

string

public getPreviewList($language = null):array

Get an array with all payment methods with the ID as key and the name as value.

Parameters

Name

Type

Description

$language

string

The names will be returned in this language.

public createPaymentMethod($paymentMethodData):Plenty\Modules\Payment\Method\Models\PaymentMethod
Return type: PaymentMethod

Creates a payment method.

Parameters

Name

Type

Description

$paymentMethodData

public updateName($paymentMethodData):Plenty\Modules\Payment\Method\Models\PaymentMethod
Return type: PaymentMethod

Updates the payment method name.

Parameters

Name

Type

Description

$paymentMethodData

public preparePaymentMethod($mop):array

Prepares a payment method. The ID of the payment method must be specified.

Parameters

Name

Type

Description

$mop

int

The ID of the payment method

public executePayment($mop, $orderId):array

Executes a payment. The ID of the payment method and the ID of the order must be specified.

Parameters

Name

Type

Description

$mop

int

The ID of the payment method

$orderId

int

The ID of the order

public listBackendSearchable($lang):array

List all payment methods which are searchable for the backend

Parameters

Name

Type

Description

$lang

string

public listBackendActive($lang):array

List all payment methods which are active for the backend

Parameters

Name

Type

Description

$lang

string

public listBackendIcon():array

List all payment methods backend icon

public listCanHandleSubscriptions($lang):array

List all payment methods which can handle subscriptions

Parameters

Name

Type

Description

$lang

string

public listAllActive($lang):array

List all payment methods which are active

Parameters

Name

Type

Description

$lang

string

public backendSearchablePaymentMethods():array
public backendActivePaymentMethods():array

PaymentMethodService

Deprecated: The payment method service

Namespace

Plenty\Modules\Payment\Method\Contracts

Methods
public isBackendSearchable():bool

Is this payment method searchable in the backend?

public isBackendActive():bool

Is this payment method active in the backend?

public getBackendName($lang):string

Get the backend name of the payment method

Parameters

Name

Type

Description

$lang

string

public canHandleSubscriptions():bool

Can this payment method handle subscriptions?

Models

PaymentMethod

The payment method model

Namespace

Plenty\Modules\Payment\Method\Models

Properties
Name Type Description

id

int

The ID of the payment method

pluginKey

string

The plugin key of the payment method

paymentKey

string

The payment key of the payment method

name

string

The name of the payment method

Methods
public toArray()

Returns this model as an array.

Services

PaymentMethodBaseService

The payment method service

Namespace

Plenty\Modules\Payment\Method\Services

Methods
public isActive():bool

Determine if the payment method is active for the frontend

public getName($lang = &quot;&quot;):string

Return the frontend name of the payment method according to the language

Parameters

Name

Type

Description

$lang

string

public getFee():float

Return an additional payment fee for the payment method

public getIcon($lang = &quot;&quot;):string

Return the frontend icon of the payment method according to the language

Parameters

Name

Type

Description

$lang

string

public getDescription($lang = &quot;&quot;):string

Return the frontend description of the payment method according to the language

Parameters

Name

Type

Description

$lang

string

public getSourceUrl($lang = &quot;&quot;):string

Return an url with additional information shown in the frontend about the payment method according to the language

Parameters

Name

Type

Description

$lang

string

public isSwitchableTo():bool

Check if it is allowed to switch to this payment method after the order is placed

public isSwitchableFrom():bool

Check if it is allowed to switch from this payment method after the order is placed

public isBackendSearchable():bool

Is this payment method searchable in the backend?

public isBackendActive():bool

Is this payment method active in the backend to used for existing orders?

public getBackendName($lang = &quot;&quot;):string

Get the backend name of the payment method according to the language

Parameters

Name

Type

Description

$lang

string

public canHandleSubscriptions():bool

Can this payment method handle subscriptions?

public getBackendIcon():string

Return the icon for the backend, shown in the payments ui

MethodName

Models

PaymentMethodName

The payment method name model

Namespace

Plenty\Modules\Payment\MethodName\Models

Properties
Name Type Description

paymentMethodId

int

lang

string

name

string

Methods
public toArray()

Returns this model as an array.