Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Purchaseorder Class Reference
Inheritance diagram for Purchaseorder:
AbstractMethod AbstractExtensibleModel MethodInterface PaymentMethodInterface AbstractModel CustomAttributesDataInterface DataObject ExtensibleDataInterface

Public Member Functions

 assignData (\Magento\Framework\DataObject $data)
 
 validate ()
 
- Public Member Functions inherited from AbstractMethod
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Payment\Model\Method\Logger $logger, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[], DirectoryHelper $directory=null)
 
 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)
 
 getCode ()
 
 getFormBlockType ()
 
 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)
 
 getTitle ()
 
 getConfigData ($field, $storeId=null)
 
 assignData (\Magento\Framework\DataObject $data)
 
 isAvailable (\Magento\Quote\Api\Data\CartInterface $quote=null)
 
 isActive ($storeId=null)
 
 initialize ($paymentAction, $stateObject)
 
 getConfigPaymentAction ()
 
 getDebugFlag ()
 
 debugData ($debugData)
 
 getDebugReplacePrivateDataKeys ()
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from MethodInterface
 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)
 
 assignData (DataObject $data)
 
 isAvailable (CartInterface $quote=null)
 
- Public Member Functions inherited from PaymentMethodInterface
 getStoreId ()
 
 getIsActive ()
 

Data Fields

const PAYMENT_METHOD_PURCHASEORDER_CODE = 'purchaseorder'
 
- Data Fields inherited from AbstractMethod
const STATUS_UNKNOWN = 'UNKNOWN'
 
const STATUS_APPROVED = 'APPROVED'
 
const STATUS_ERROR = 'ERROR'
 
const STATUS_DECLINED = 'DECLINED'
 
const STATUS_VOID = 'VOID'
 
const STATUS_SUCCESS = 'SUCCESS'
 
- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from MethodInterface
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'
 

Protected Attributes

 $_code = self::PAYMENT_METHOD_PURCHASEORDER_CODE
 
 $_formBlockType = \Magento\OfflinePayments\Block\Form\Purchaseorder::class
 
 $_infoBlockType = \Magento\OfflinePayments\Block\Info\Purchaseorder::class
 
 $_isOffline = true
 
- Protected Attributes inherited from AbstractMethod
 $_code
 
 $_formBlockType = \Magento\Payment\Block\Form::class
 
 $_infoBlockType = \Magento\Payment\Block\Info::class
 
 $_isGateway = false
 
 $_isOffline = false
 
 $_canOrder = false
 
 $_canAuthorize = false
 
 $_canCapture = false
 
 $_canCapturePartial = false
 
 $_canCaptureOnce = false
 
 $_canRefund = false
 
 $_canRefundInvoicePartial = false
 
 $_canVoid = false
 
 $_canUseInternal = true
 
 $_canUseCheckout = true
 
 $_isInitializeNeeded = false
 
 $_canFetchTransactionInfo = false
 
 $_canReviewPayment = false
 
 $_canCancelInvoice = false
 
 $_debugReplacePrivateDataKeys = []
 
 $_paymentData
 
 $_scopeConfig
 
 $logger
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractMethod
 initializeData ($data=[])
 
 _debug ($debugData)
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Class Purchaseorder

@method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes()

@api

Since
100.0.2

Definition at line 18 of file Purchaseorder.php.

Member Function Documentation

◆ assignData()

assignData ( \Magento\Framework\DataObject  $data)

Assign data to info model instance

Parameters
\Magento\Framework\DataObject | mixed$data
Returns
$this
Exceptions
LocalizedException

Definition at line 53 of file Purchaseorder.php.

54  {
55  $this->getInfoInstance()->setPoNumber($data->getPoNumber());
56  return $this;
57  }

◆ validate()

validate ( )

Validate payment method information object

Returns
$this
Exceptions
LocalizedException@api

Implements MethodInterface.

Definition at line 66 of file Purchaseorder.php.

67  {
68  parent::validate();
69 
70  if (empty($this->getInfoInstance()->getPoNumber())) {
71  throw new LocalizedException(__('Purchase order number is a required field.'));
72  }
73 
74  return $this;
75  }
__()
Definition: __.php:13

Field Documentation

◆ $_code

$_code = self::PAYMENT_METHOD_PURCHASEORDER_CODE
protected

Definition at line 27 of file Purchaseorder.php.

◆ $_formBlockType

$_formBlockType = \Magento\OfflinePayments\Block\Form\Purchaseorder::class
protected

Definition at line 32 of file Purchaseorder.php.

◆ $_infoBlockType

$_infoBlockType = \Magento\OfflinePayments\Block\Info\Purchaseorder::class
protected

Definition at line 37 of file Purchaseorder.php.

◆ $_isOffline

$_isOffline = true
protected

Definition at line 44 of file Purchaseorder.php.

◆ PAYMENT_METHOD_PURCHASEORDER_CODE

const PAYMENT_METHOD_PURCHASEORDER_CODE = 'purchaseorder'

Definition at line 20 of file Purchaseorder.php.


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