PHP Class Mollie_API_Object_Payment, mollie-api-php

All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Author: Mollie B.V. ([email protected])
Show file Open project: mollie/mollie-api-php Class Usage Examples

Public Properties

Property Type Description
$amount float The amount of the payment in EURO with 2 decimals.
$amountRefunded float | null The amount of the payment that has been refunded to the consumer, in EURO with 2 decimals. This field will be NULL if the payment can not be refunded.
$amountRemaining float | null For some payment methods this amount can be higher than the payment amount. This is possible to reimburse the costs for a return shipment to your customer for example.
$cancelledDatetime string | null Date and time the payment was cancelled in ISO-8601 format.
$createdDatetime string | null Date and time the payment was created in ISO-8601 format.
$customerId string | null The customer ID this payment is performed by.
$description string Description of the payment that is shown to the customer during the payment, and possibly on the bank or credit card statement.
$details object Details of a successfully paid payment are set here. For example, the iDEAL payment method will set $details->consumerName and $details->consumerAccount.
$expiredDatetime string | null Date and time the payment was cancelled in ISO-8601 format.
$expiryPeriod string | null The period after which the payment will expire in ISO-8601 format.
$id string Id of the payment (on the Mollie platform).
$links object
$locale string | null The locale used for this payment.
$mandateId string | null The mandate ID this payment is performed with.
$metadata object | mixed | null During creation of the payment you can set custom metadata that is stored with the payment, and given back whenever you retrieve that payment.
$method string | null If method is empty/null, the customer can pick his/her preferred payment method.
$mode string Mode of the payment, either "live" or "test" depending on the API Key that was used.
$paidDatetime string | null Date and time the payment was paid in ISO-8601 format.
$profileId string The profile ID this payment belongs to.
$recurringType string | null Either "first", "recurring", or NULL for regular payments.
$resource string
$status string The status of the payment.
$subscriptionId string | null The subscription ID this payment belongs to.

Public Methods

Method Description
canBePartiallyRefunded ( ) : boolean
canBeRefunded ( ) : boolean
getAmountRefunded ( ) : float Get the amount that is already refunded
getAmountRemaining ( ) : float Get the remaining amount that can be refunded. For some payment methods this amount can be higher than the payment amount. This is possible to reimburse the costs for a return shipment to your customer for example.
getPaymentUrl ( ) : string | null Get the payment URL where the customer can complete the payment.
hasRecurringType ( ) : boolean Check whether the 'recurringType' parameter has been defined for this payment.
hasRecurringTypeFirst ( ) : boolean Check whether 'recurringType' is set to 'first'. If a 'first' payment has been completed successfully, the consumer's account may be charged automatically using recurring payments.
hasRecurringTypeRecurring ( ) : boolean Check whether 'recurringType' is set to 'recurring'. This type of payment is processed without involving the consumer.
isCancelled ( ) : boolean Is this payment cancelled?
isChargedBack ( ) : boolean Is this payment charged back?
isExpired ( ) : boolean Is this payment expired?
isOpen ( ) : boolean Is this payment still open / ongoing?
isPaid ( ) : boolean Is this payment paid for?
isPaidOut ( ) : boolean Has the money been transferred to the bank account of the merchant?
isPending ( ) : boolean Is this payment pending?
isRefunded ( ) : boolean Is this payment (partially) refunded?

Method Details

canBePartiallyRefunded() public method

public canBePartiallyRefunded ( ) : boolean
return boolean

canBeRefunded() public method

public canBeRefunded ( ) : boolean
return boolean

getAmountRefunded() public method

Get the amount that is already refunded
public getAmountRefunded ( ) : float
return float

getAmountRemaining() public method

Get the remaining amount that can be refunded. For some payment methods this amount can be higher than the payment amount. This is possible to reimburse the costs for a return shipment to your customer for example.
public getAmountRemaining ( ) : float
return float

getPaymentUrl() public method

Get the payment URL where the customer can complete the payment.
public getPaymentUrl ( ) : string | null
return string | null

hasRecurringType() public method

Check whether the 'recurringType' parameter has been defined for this payment.
public hasRecurringType ( ) : boolean
return boolean

hasRecurringTypeFirst() public method

Check whether 'recurringType' is set to 'first'. If a 'first' payment has been completed successfully, the consumer's account may be charged automatically using recurring payments.
public hasRecurringTypeFirst ( ) : boolean
return boolean

hasRecurringTypeRecurring() public method

Check whether 'recurringType' is set to 'recurring'. This type of payment is processed without involving the consumer.

isCancelled() public method

Is this payment cancelled?
public isCancelled ( ) : boolean
return boolean

isChargedBack() public method

Is this payment charged back?
public isChargedBack ( ) : boolean
return boolean

isExpired() public method

Is this payment expired?
public isExpired ( ) : boolean
return boolean

isOpen() public method

Is this payment still open / ongoing?
public isOpen ( ) : boolean
return boolean

isPaid() public method

Is this payment paid for?
public isPaid ( ) : boolean
return boolean

isPaidOut() public method

Note: When a payment is refunded or charged back, the status 'refunded'/'charged_back' will overwrite the 'paidout' status.
public isPaidOut ( ) : boolean
return boolean

isPending() public method

Is this payment pending?
public isPending ( ) : boolean
return boolean

isRefunded() public method

Is this payment (partially) refunded?
public isRefunded ( ) : boolean
return boolean

Property Details

$amount public property

The amount of the payment in EURO with 2 decimals.
public float $amount
return float

$amountRefunded public property

The amount of the payment that has been refunded to the consumer, in EURO with 2 decimals. This field will be NULL if the payment can not be refunded.
public float|null $amountRefunded
return float | null

$amountRemaining public property

For some payment methods this amount can be higher than the payment amount. This is possible to reimburse the costs for a return shipment to your customer for example.
public float|null $amountRemaining
return float | null

$cancelledDatetime public property

Date and time the payment was cancelled in ISO-8601 format.
public string|null $cancelledDatetime
return string | null

$createdDatetime public property

Date and time the payment was created in ISO-8601 format.
public string|null $createdDatetime
return string | null

$customerId public property

The customer ID this payment is performed by.
public string|null $customerId
return string | null

$description public property

Description of the payment that is shown to the customer during the payment, and possibly on the bank or credit card statement.
public string $description
return string

$details public property

Details of a successfully paid payment are set here. For example, the iDEAL payment method will set $details->consumerName and $details->consumerAccount.
public object $details
return object

$expiredDatetime public property

Date and time the payment was cancelled in ISO-8601 format.
public string|null $expiredDatetime
return string | null

$expiryPeriod public property

The period after which the payment will expire in ISO-8601 format.
public string|null $expiryPeriod
return string | null

$id public property

Id of the payment (on the Mollie platform).
public string $id
return string

$locale public property

The locale used for this payment.
public string|null $locale
return string | null

$mandateId public property

The mandate ID this payment is performed with.
public string|null $mandateId
return string | null

$metadata public property

During creation of the payment you can set custom metadata that is stored with the payment, and given back whenever you retrieve that payment.
public object|mixed|null $metadata
return object | mixed | null

$method public property

If method is empty/null, the customer can pick his/her preferred payment method.
See also: Mollie_API_Object_Method
public string|null $method
return string | null

$mode public property

Mode of the payment, either "live" or "test" depending on the API Key that was used.
public string $mode
return string

$paidDatetime public property

Date and time the payment was paid in ISO-8601 format.
public string|null $paidDatetime
return string | null

$profileId public property

The profile ID this payment belongs to.
public string $profileId
return string

$recurringType public property

Either "first", "recurring", or NULL for regular payments.
public string|null $recurringType
return string | null

$resource public property

public string $resource
return string

$status public property

The status of the payment.
public string $status
return string

$subscriptionId public property

The subscription ID this payment belongs to.
public string|null $subscriptionId
return string | null