Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
MethodInterface Interface Reference
Inheritance diagram for MethodInterface:
AbstractMethod Adapter TransparentInterface NullPaymentProvider VaultPaymentInterface Banktransfer Cashondelivery Checkmo Purchaseorder Free Substitution Stub Express AbstractAgreement OnlineMethod Directpost Transparent Vault

Public Member Functions

 getCode ()
 
 getFormBlockType ()
 
 getTitle ()
 
 setStore ($storeId)
 
 getStore ()
 
 canOrder ()
 
 canAuthorize ()
 
 canCapture ()
 
 canCapturePartial ()
 
 canCaptureOnce ()
 
 canRefund ()
 
 canRefundPartialPerInvoice ()
 
 canVoid ()
 
 canUseInternal ()
 
 canUseCheckout ()
 
 canEdit ()
 
 canFetchTransactionInfo ()
 
 fetchTransactionInfo (InfoInterface $payment, $transactionId)
 
 isGateway ()
 
 isOffline ()
 
 isInitializeNeeded ()
 
 canUseForCountry ($country)
 
 canUseForCurrency ($currencyCode)
 
 getInfoBlockType ()
 
 getInfoInstance ()
 
 setInfoInstance (InfoInterface $info)
 
 validate ()
 
 order (\Magento\Payment\Model\InfoInterface $payment, $amount)
 
 authorize (\Magento\Payment\Model\InfoInterface $payment, $amount)
 
 capture (\Magento\Payment\Model\InfoInterface $payment, $amount)
 
 refund (\Magento\Payment\Model\InfoInterface $payment, $amount)
 
 cancel (\Magento\Payment\Model\InfoInterface $payment)
 
 void (\Magento\Payment\Model\InfoInterface $payment)
 
 canReviewPayment ()
 
 acceptPayment (InfoInterface $payment)
 
 denyPayment (InfoInterface $payment)
 
 getConfigData ($field, $storeId=null)
 
 assignData (DataObject $data)
 
 isAvailable (CartInterface $quote=null)
 
 isActive ($storeId=null)
 
 initialize ($paymentAction, $stateObject)
 
 getConfigPaymentAction ()
 

Data Fields

const ACTION_ORDER = 'order'
 
const ACTION_AUTHORIZE = 'authorize'
 
const ACTION_AUTHORIZE_CAPTURE = 'authorize_capture'
 
const CHECK_USE_FOR_COUNTRY = 'country'
 
const CHECK_USE_FOR_CURRENCY = 'currency'
 
const CHECK_USE_CHECKOUT = 'checkout'
 
const CHECK_USE_INTERNAL = 'internal'
 
const CHECK_ORDER_TOTAL_MIN_MAX = 'total'
 
const CHECK_ZERO_TOTAL = 'zero_total'
 
const GROUP_OFFLINE = 'offline'
 

Detailed Description

Payment interface @api

Since
100.0.2

Definition at line 16 of file MethodInterface.php.

Member Function Documentation

◆ acceptPayment()

acceptPayment ( InfoInterface  $payment)

Attempt to accept a payment that us under review

Parameters
InfoInterface$payment
Returns
false
Exceptions

Implemented in AbstractMethod, Vault, Adapter, NullPaymentProvider, and Agreement.

◆ assignData()

assignData ( DataObject  $data)

Assign data to info model instance

Parameters
DataObject$data
Returns
$this

Implemented in NullPaymentProvider.

◆ authorize()

authorize ( \Magento\Payment\Model\InfoInterface  $payment,
  $amount 
)

Authorize payment abstract method

Parameters
InfoInterface$payment
float$amount
Returns
$this

◆ canAuthorize()

canAuthorize ( )

Check authorize availability

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canCapture()

canCapture ( )

Check capture availability

Returns
bool

Implemented in Directpost, Express, AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canCaptureOnce()

canCaptureOnce ( )

Check whether capture can be performed once and no further capture possible

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canCapturePartial()

canCapturePartial ( )

Check partial capture availability

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ cancel()

cancel ( \Magento\Payment\Model\InfoInterface  $payment)

Cancel payment abstract method

Parameters
InfoInterface$payment
Returns
$this

◆ canEdit()

canEdit ( )

Can be edit order (renew order)

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canFetchTransactionInfo()

canFetchTransactionInfo ( )

Check fetch transaction info availability

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canOrder()

canOrder ( )

Check order availability

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canRefund()

canRefund ( )

Check refund availability

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canRefundPartialPerInvoice()

canRefundPartialPerInvoice ( )

Check partial refund availability for invoice

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canReviewPayment()

canReviewPayment ( )

Whether this method can accept or deny payment

Returns
bool

Implemented in AbstractMethod, Vault, Express, NullPaymentProvider, Agreement, and Adapter.

◆ canUseCheckout()

canUseCheckout ( )

Can be used in regular checkout

Returns
bool

Implemented in AbstractMethod, Vault, Express, Adapter, and NullPaymentProvider.

◆ canUseForCountry()

canUseForCountry (   $country)

To check billing country is allowed for the payment method

Parameters
string$country
Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canUseForCurrency()

canUseForCurrency (   $currencyCode)

Check method for processing with base currency

Parameters
string$currencyCode
Returns
bool @SuppressWarnings(PHPMD.UnusedFormalParameter)

Implemented in AbstractMethod, Vault, Adapter, Express, and NullPaymentProvider.

◆ canUseInternal()

canUseInternal ( )

Using internal pages for input payment data Can be used in admin

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ canVoid()

canVoid ( )

Check void availability

Returns
bool

Implemented in Express, AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ capture()

capture ( \Magento\Payment\Model\InfoInterface  $payment,
  $amount 
)

Capture payment abstract method

Parameters
InfoInterface$payment
float$amount
Returns
$this

◆ denyPayment()

denyPayment ( InfoInterface  $payment)

Attempt to deny a payment that us under review

Parameters
InfoInterface$payment
Returns
false
Exceptions

Implemented in AbstractMethod, Vault, Adapter, NullPaymentProvider, and Agreement.

◆ fetchTransactionInfo()

fetchTransactionInfo ( InfoInterface  $payment,
  $transactionId 
)

Fetch transaction info

Parameters
InfoInterface$payment
string$transactionId
Returns
array @SuppressWarnings(PHPMD.UnusedFormalParameter)

Implemented in AbstractMethod, Adapter, Agreement, Vault, and NullPaymentProvider.

◆ getCode()

getCode ( )

Retrieve payment method code

Returns
string

Implemented in Adapter, AbstractMethod, Vault, NullPaymentProvider, Stub, and AbstractAgreementStub.

◆ getConfigData()

getConfigData (   $field,
  $storeId = null 
)

Retrieve information from payment configuration

Parameters
string$field
int | string | null | \Magento\Store\Model\Store$storeId
Returns
mixed

Implemented in AbstractMethod, Vault, NullPaymentProvider, Adapter, and Express.

◆ getConfigPaymentAction()

getConfigPaymentAction ( )

Get config payment action url Used to universalize payment actions when processing payment place

Returns
string

Implemented in AbstractMethod, Adapter, Vault, NullPaymentProvider, Agreement, Express, and Free.

◆ getFormBlockType()

getFormBlockType ( )

Retrieve block type for method form generation

Returns
string
Deprecated:
100.0.2

Implemented in Adapter, AbstractMethod, Vault, and NullPaymentProvider.

◆ getInfoBlockType()

getInfoBlockType ( )

Retrieve block type for display method information

Returns
string
Deprecated:
100.0.2

Implemented in Adapter, AbstractMethod, Vault, and NullPaymentProvider.

◆ getInfoInstance()

getInfoInstance ( )

Retrieve payment information model object

Returns
InfoInterface
Exceptions

Implemented in Adapter, AbstractMethod, Vault, and NullPaymentProvider.

◆ getStore()

getStore ( )

Store id getter

Returns
int

Implemented in Adapter, AbstractMethod, Vault, and NullPaymentProvider.

◆ getTitle()

getTitle ( )

Retrieve payment method title

Returns
string

Implemented in AbstractMethod, Adapter, Vault, NullPaymentProvider, and Substitution.

◆ initialize()

initialize (   $paymentAction,
  $stateObject 
)

Method that will be executed instead of authorize or capture if flag isInitializeNeeded set to true

Parameters
string$paymentAction
object$stateObject
Returns
$this @SuppressWarnings(PHPMD.UnusedFormalParameter)

Implemented in AbstractMethod, Adapter, Vault, NullPaymentProvider, and Directpost.

◆ isActive()

isActive (   $storeId = null)

Is active

Parameters
int | null$storeId
Returns
bool

Implemented in AbstractMethod, Express, Vault, NullPaymentProvider, and Adapter.

◆ isAvailable()

isAvailable ( CartInterface  $quote = null)

Check whether payment method can be used

Parameters
CartInterface | null$quote
Returns
bool

Implemented in NullPaymentProvider, and Adapter.

◆ isGateway()

isGateway ( )

Retrieve payment system relation flag

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ isInitializeNeeded()

isInitializeNeeded ( )

Flag if we need to run payment initialize while order place

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ isOffline()

isOffline ( )

Retrieve payment method online/offline flag

Returns
bool

Implemented in AbstractMethod, Vault, Adapter, and NullPaymentProvider.

◆ order()

order ( \Magento\Payment\Model\InfoInterface  $payment,
  $amount 
)

Order payment abstract method

Parameters
InfoInterface$payment
float$amount
Returns
$this

◆ refund()

refund ( \Magento\Payment\Model\InfoInterface  $payment,
  $amount 
)

Refund specified amount for payment

Parameters
InfoInterface$payment
float$amount
Returns
$this

◆ setInfoInstance()

setInfoInstance ( InfoInterface  $info)

Retrieve payment information model object

Parameters
InfoInterface$info
Returns
void
Deprecated:
100.0.2

Implemented in Adapter, AbstractMethod, Vault, and NullPaymentProvider.

◆ setStore()

setStore (   $storeId)

Store id setter

Parameters
int$storeId
Returns
void

Implemented in Adapter, Express, AbstractMethod, Vault, Agreement, and NullPaymentProvider.

◆ validate()

validate ( )

Validate payment method information object

Returns
$this
Exceptions

Implemented in AbstractMethod, Vault, Adapter, NullPaymentProvider, Directpost, Transparent, and Purchaseorder.

◆ void()

Void payment abstract method

Parameters
InfoInterface$payment
Returns
$this

Field Documentation

◆ ACTION_AUTHORIZE

const ACTION_AUTHORIZE = 'authorize'

Definition at line 23 of file MethodInterface.php.

◆ ACTION_AUTHORIZE_CAPTURE

const ACTION_AUTHORIZE_CAPTURE = 'authorize_capture'

Definition at line 25 of file MethodInterface.php.

◆ ACTION_ORDER

const ACTION_ORDER = 'order'

Different payment actions.

Definition at line 21 of file MethodInterface.php.

◆ CHECK_ORDER_TOTAL_MIN_MAX

const CHECK_ORDER_TOTAL_MIN_MAX = 'total'

Definition at line 38 of file MethodInterface.php.

◆ CHECK_USE_CHECKOUT

const CHECK_USE_CHECKOUT = 'checkout'

Definition at line 34 of file MethodInterface.php.

◆ CHECK_USE_FOR_COUNTRY

const CHECK_USE_FOR_COUNTRY = 'country'

Different payment method checks.

Definition at line 30 of file MethodInterface.php.

◆ CHECK_USE_FOR_CURRENCY

const CHECK_USE_FOR_CURRENCY = 'currency'

Definition at line 32 of file MethodInterface.php.

◆ CHECK_USE_INTERNAL

const CHECK_USE_INTERNAL = 'internal'

Definition at line 36 of file MethodInterface.php.

◆ CHECK_ZERO_TOTAL

const CHECK_ZERO_TOTAL = 'zero_total'

Definition at line 40 of file MethodInterface.php.

◆ GROUP_OFFLINE

const GROUP_OFFLINE = 'offline'

Definition at line 42 of file MethodInterface.php.


The documentation for this interface was generated from the following file: