Payment

Contracts

PaymentMatcherRepositoryContract

The PaymentMatcherRepositoryContract

Namespace

Plenty\Modules\Payment\Contracts

Methods

public checkMapFindAssignPayment(int $mopId, $data):string
Parameters
int $mopId
$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(string $lang):array

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

Parameters
string $lang The language of the payment property type
public findTypesById(int $id, string $lang):array

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

Parameters
int $id The ID of the payment property type. The following property types are available:
  • Transaction ID = 1
  • Reference ID = 2
  • Booking text = 3
  • Transaction password = 4
  • Transaction code = 5
  • Authorisation ID = 6
  • Capture ID = 7
  • Refund ID = 8
  • Credit note ID = 9
  • Order reference = 10
  • Name of the sender = 11
  • Email of the sender = 12
  • The sender's sort code = 13
  • The sender's bank name = 14
  • The sender's bank account number = 15
  • The holder of the bank account = 16
  • The country of the sender's bank account = 17
  • The sender's IBAN = 18
  • The sender's BIC = 19
  • Name of the recipient = 20
  • The recipient's bank account = 21
  • Reference text of the payment = 22
  • Payment origin = 23
  • Shipping address ID = 24
  • Invoice address ID = 25
  • Item buyer = 26
  • Item number = 27
  • Item transaction ID = 28
  • External transaction type = 29
  • External transaction status = 30
string $lang The language of the payment property type
public createType($data):PaymentPropertyType

Creates a payment property type.

Parameters
$data
public changeProperty($data):PaymentPropertyType

Updates a payment property type.

Parameters
$data

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
 $payment, Order
 $order):PaymentOrderRelation

Creates a payment order relation.

Parameters
Payment $payment The ID of the payment
Order $order The ID of the order
public findOrderRelation(Payment
 $payment):PaymentOrderRelation

Gets the payment order relation.

Parameters
Payment $payment
public deleteOrderRelation(Payment
 $payment):void

Deletes a payment order relation.

Parameters
Payment $payment The ID of the payment

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
 $payment, Contact
 $contact):PaymentContactRelation

Creates a payment contact relation.

Parameters
Payment $payment The ID of the payment
Contact $contact The ID of the contact
public deleteContactRelation(Payment
 $payment):void

Deletes a payment contact relation.

Parameters
Payment $payment The ID of the payment

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(int $itemsPerPage = 50, int $page = 1):array

Lists payments.

Parameters
int $itemsPerPage The number of items to list per page
int $page The page of results to search for
public getPaymentById(int $paymentId):Payment

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

Parameters
int $paymentId The ID of the payment
public getPaymentsByMethodId(int $methodId, int $itemsPerPage = 50, int $page = 1):array

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

Parameters
int $methodId The ID of the payment method
int $itemsPerPage The number of items to list per page
int $page The page of results to search for
public getPaymentsByStatusId(int $statusId, int $itemsPerPage = 50, int $page = 1):array

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

Parameters
int $statusId The ID of the payment status
int $itemsPerPage The number of items to list per page
int $page The page of results to search for
public getPaymentsByTransactionType(int $transactionType, int $itemsPerPage = 50, int $page = 1):array

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

Parameters
int $transactionType The transaction type of the payment
int $itemsPerPage The number of items to list per page
int $page The page of results to search for
public getPaymentsByOrderId(int $orderId):array

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

Parameters
int $orderId The ID of the order
public getPaymentsByImportDateInterval(string $startDate, string $endDate, int $itemsPerPage = 50, int $page = 1):array

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

Parameters
string $startDate The start date of the date range for the import date of the payment
string $endDate The end date of the date range for the import date of the payment
int $itemsPerPage The number of items to list per page
int $page The page of results to search for
public getPaymentsByEntryDateInterval(string $startDate, string $endDate, int $itemsPerPage = 50, int $page = 1):array

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

Parameters
string $startDate The start date of the date range for the entry date of the payment
string $endDate The end date of the date range for the entry date of the payment
int $itemsPerPage The number of items to list per page
int $page The page of results to search for
public getPaymentsByPropertyTypeAndValue(int $propertyTypeId, $propertyValue, int $itemsPerPage = 50, int $page = 1):array

Lists payments by payment property type and value.

Parameters
int $propertyTypeId The property type
$propertyValue The property value
int $itemsPerPage The number of items to list per page
int $page The page of results to search for
public createPayment($data):Payment

Creates a payment.

Parameters
$data
public updatePayment($data):Payment

Updates a payment.

Parameters
$data
public getStatusConstants():array
public getOriginConstants():array
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.

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(int $propertyId):array

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

Parameters
int $propertyId The ID of the payment property
public allByPaymentId(int $paymentId):array

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

Parameters
int $paymentId The ID of the payment
public allByTypeId(int $typeId):array

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

Parameters
int $typeId The ID of the payment property type. The following property types are available:
  • Transaction ID = 1
  • Reference ID = 2
  • Booking text = 3
  • Transaction password = 4
  • Transaction code = 5
  • Authorisation ID = 6
  • Capture ID = 7
  • Refund ID = 8
  • Credit note ID = 9
  • Order reference = 10
  • Name of the sender = 11
  • Email of the sender = 12
  • The sender's sort code = 13
  • The sender's bank name = 14
  • The sender's bank account number = 15
  • The holder of the bank account = 16
  • The country of the sender's bank account = 17
  • The sender's IBAN = 18
  • The sender's BIC = 19
  • Name of the recipient = 20
  • The recipient's bank account = 21
  • Reference text of the payment = 22
  • Payment origin = 23
  • Shipping address ID = 24
  • Invoice address ID = 25
  • Item buyer = 26
  • Item number = 27
  • Item transaction ID = 28
  • External transaction type = 29
  • External transaction status = 30
public findByCreatedDateInterval(string $startDate, string $endDate):array

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

Parameters
string $startDate The start date of the date range for the date of creation of the property
string $endDate The end date of the date range for the date of creation of the property
public createProperty($data):PaymentProperty

Creates a payment property.

Parameters
$data
public changeProperty(PaymentProperty
 $data):PaymentProperty

Updates a payment property.

Parameters
PaymentProperty $data

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(string $lang):array

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

Parameters
string $lang The language of the payment property type name
public findByNameId(int $nameId):array

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

Parameters
int $nameId The ID of the payment property type name
public createTypeName($data):PaymentPropertyTypeName

Creates a payment property type name.

Parameters
$data
public changeProperty($data):array

Updates a payment property type name.

Parameters
$data

Models

Payment

The payment model

Namespace

Plenty\Modules\Payment\Models

Properties

Type Name Description
int id The ID of the payment
float amount The amount of the payment
float exchangeRatio The exchange rate. Exchange rates are used if the default currency saved in plentymarkets differs from the currency of the order.
int parentId The ID of the parent payment
int deleted A deleted payment. Deleted payments have the value 1 and are not displayed in the plentymarkets back end.
int unaccountable An unassigned payment. Unassigned payments have the value 1.
string currency The currency of the payment in ISO 4217 code.
string type The payment type. Available types are credit and debit.
string hash The hash code of the payment. The hash code consists of 32 characters and is automatically generated.
int origin The origin of the payment. The following origins are available:
  • Undefined = 0
  • System = 1
  • Manually = 2
  • SOAP = 3
  • Import = 4
  • Split payment = 5
  • Plugin = 6
string receivedAt The time the payment was received
string importedAt The time the payment was imported
int status The status of the payment
int transactionType The transaction type of the payment. The following transaction types are available:
  • Interim transaction report = 1
  • Booked payment = 2
  • Split payment = 3
int mopId The ID of the payment method
Payment parent The parent payment
PaymentMethod method The payment method
array histories The payment history
array properties The properties of the payment
bool regenerateHash If $regenerateHash is true, regenerate the payment hash value. Default is false.
bool updateOrderPaymentStatus If $updateOrderPaymentStatus is true, update the order payment status. Default is false.
bool isSystemCurrency If $isSystemCurrency is false, the value will be converted to the standard currency with the provided exchange rate. If $isSystemCurrency is false, the value is not converted. Default is true.

Methods

public toArray()

Returns this model as an array.

PaymentPropertyTypeName

The payment property type name model

Namespace

Plenty\Modules\Payment\Models

Properties

Type Name Description
int id The ID of the name of the property type
int typeId The ID of the property type
string lang The language of the name of the property type
string name The name of the property type

Methods

public toArray()

Returns this model as an array.

PaymentProperty

The payment property model

Namespace

Plenty\Modules\Payment\Models

Properties

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

Methods

public toArray()

Returns this model as an array.

PaymentPropertyType

The payment property type model

Namespace

Plenty\Modules\Payment\Models

Properties

Type Name Description
int id The ID of the property type
int erasable Specifies whether the property type can be deleted. Property types that can be deleted have the value 1. Default property types cannot be deleted.
int position The position number of the property type
PaymentPropertyTypeName name The name of the property type

Methods

public toArray()

Returns this model as an array.

PaymentContactRelation

The payment contact relation model

Namespace

Plenty\Modules\Payment\Models

Properties

Type Name Description
int id The ID of the payment order relation
int paymentId The ID of the payment
int contactId The ID of the contact
string assignedAt 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

Type Name Description
int id The ID of the payment order relation
int paymentId The ID of the payment
int orderId The ID of the order
string assignedAt The time the payment order relation was assigned

Methods

public toArray()

Returns this model as an array.

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(int $paymentId, int $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
int $paymentId The ID of the payment
int $typeId The ID of the history type. The following types are available:
  • Created = 1
  • Status updated = 2
  • Assigned = 3
  • Detached = 4
  • Deleted = 5
  • Updated = 6
public createHistory($data):PaymentHistory

Creates the payment history.

Parameters
$data

Models

PaymentHistory

The payment history model

Namespace

Plenty\Modules\Payment\History\Models

Properties

Type Name Description
int id The ID of the payment history
int paymentId The ID of the payment
int typeId The ID of the history type. The following types are available:
  • Created = 1
  • Status updated = 2
  • Assigned = 3
  • Detached = 4
  • Deleted = 5
  • Updated = 6
string value The language of the payment history
string user The user who initiated the action

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(int $orderId):Checkout

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

Parameters
int $orderId The ID of the order
public getOrderId():int

Gets the ID of the order.

public setMop(int $mop):Checkout

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

Parameters
int $mop The ID of the payment method
public getMop():int

Gets the ID of the payment method.

public setType(string $type):Checkout

Updates the content type.

Parameters
string $type The content type of the payment plugin
public getType():string

Gets the content type.

public setValue(string $value):Checkout

Updates the value of the content type.

Parameters
string $value 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(int $mop):Checkout

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

Parameters
int $mop The ID of the payment method
public getMop():int

Gets the ID of the payment method.

public setType(string $type):Checkout

Updates the content type.

Parameters
string $type The content type of the payment plugin
public getType():string

Gets the content type.

public setValue(string $value):Checkout

Updates the value of the content type.

Parameters
string $value The value of the content type
public getValue():string

Gets the value of the content type.

public setParams($params):Checkout

Updates the parameters. The parameters must be specified.

Parameters
$params The parameters
public getParams():void

Gets the parameters.

Method

Contracts

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(string $pluginKey):array

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

Parameters
string $pluginKey The plugin key
public allPluginPaymentMethods():array
public allOldPaymentMethods():array
public findByPaymentMethodId(int $paymentMethodId):PaymentMethod

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

Parameters
int $paymentMethodId The ID of the payment method
public getPreviewList(string $language = null):array

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

Parameters
string $language The names will be returned in this language.
public createPaymentMethod($paymentMethodData):PaymentMethod

Creates a payment method.

Parameters
$paymentMethodData
public updateName($paymentMethodData):PaymentMethod

Updates the payment method name.

Parameters
$paymentMethodData
public preparePaymentMethod(int $mop):array

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

Parameters
int $mop The ID of the payment method
public executePayment(int $mop, int $orderId):array

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

Parameters
int $mop The ID of the payment method
int $orderId The ID of the order

PaymentMethodContainer

The payment method container

Namespace

Plenty\Modules\Payment\Method\Contracts

Methods

public register(string $paymentKey, string $paymentMethodServiceClass, array $rebuildEventClassesList):void
Parameters
string $paymentKey The unique key of a payment plugin
string $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.
array $rebuildEventClassesList A list of events. It is checked again for the list of events whether the payment method is active.
public isRegistered(string $paymentKey):bool
Parameters
string $paymentKey

PaymentMethodService

The payment method service

Namespace

Plenty\Modules\Payment\Method\Contracts

Models

PaymentMethod

The payment method model

Namespace

Plenty\Modules\Payment\Method\Models

Properties

Type Name Description
int id The ID of the payment method
string pluginKey The plugin key of the payment method
string paymentKey The payment key of the payment method
string name The name of the payment method

Methods

public toArray()

Returns this model as an array.

MethodName

Models

PaymentMethodName

The payment method name model

Namespace

Plenty\Modules\Payment\MethodName\Models

Properties

Type Name Description
int paymentMethodId
string lang
string name

Methods

public toArray()

Returns this model as an array.