BasePaymentGateway
class BasePaymentGateway extends ModelAction
Base Payment Gateway Class
Traits
Extension trait
Properties
string | $configPath | from ConfigMaker | |
protected | $configFileExtension | from ConfigMaker | |
static protected array | $extensionCallbacks | from ExtensionTrait | |
static string | $extendableStaticCalledClass | from ExtensionTrait | |
protected | $extensionHidden | from ExtensionTrait | |
protected Payments_model|Model | $model | ||
protected array | $requiredProperties | from ModelAction | |
protected | $orderModel | ||
protected | $orderStatusModel | ||
protected | $configFields | ||
protected | $configValidationAttributes | ||
protected | $configValidationMessages | ||
protected | $configRules |
Methods
Reads the contents of the supplied file and applies it to this object.
Reads the contents of the supplied file and applies it to this object.
Merges two configuration sources, either prepared or not, and returns them as a single configuration object.
Locates a file based on it's definition. If the file starts with the ~ symbol it will be returned in context of the application base path, otherwise it will be returned in context of the config path.
Guess the package path for the called class.
Guess the package path from a specified class.
Helper method for ::extend()
static method
Class constructor
Initialize method called when the payment gateway is first loaded with an existing model.
Initializes configuration data when the payment method is first created.
Extra field configuration for the payment type.
Returns the form configuration used by this payment type.
Returns the form validation rules used by this payment type.
Returns the form validation attributes used by this model.
Returns the form validation messages used by this model.
Registers a entry page with specific URL. For example, PayPal needs a landing page for the auto-return feature.
Utility function, creates a link to a registered entry point.
Returns true if the payment type is applicable for a specified order amount
Returns true if the payment type has additional fee
Returns the payment type additional fee
This method should return TRUE if the gateway completes the payment on the client's browsers.
Executed when this gateway is rendered on the checkout page.
No description
This method should return TRUE if the gateway supports user payment profiles.
Creates a customer profile on the payment gateway or update if the profile already exists.
Deletes a customer payment profile from the payment gateway.
Creates a payment transaction from an existing payment profile.
No description
Creates an instance of the order model
Creates an instance of the order status model
Details
in
ConfigMaker at line 27
array
loadConfig(array $configFile = [], array $requiredConfig = [], null $index = null)
Reads the contents of the supplied file and applies it to this object.
in
ConfigMaker at line 46
array
makeConfig(string|array $configFile, array $requiredConfig = [])
Reads the contents of the supplied file and applies it to this object.
in
ConfigMaker at line 97
array
mergeConfig($configLeft, $configRight)
Merges two configuration sources, either prepared or not, and returns them as a single configuration object.
in
ConfigMaker at line 116
string
getConfigPath(string $fileName, mixed $configPath = null)
Locates a file based on it's definition. If the file starts with the ~ symbol it will be returned in context of the application base path, otherwise it will be returned in context of the config path.
in
ConfigMaker at line 154
string
guessConfigPath(string $suffix = '')
Guess the package path for the called class.
in
ConfigMaker at line 169
string
guessConfigPathFrom(string $class, string $suffix = '')
Guess the package path from a specified class.
in
ExtensionTrait at line 32
extensionApplyInitCallbacks()
No description
in
ExtensionTrait at line 51
static void
extensionExtendCallback(callable $callback)
Helper method for ::extend()
static method
in
ExtensionTrait at line 64
protected
extensionHideField($name)
No description
in
ExtensionTrait at line 69
protected
extensionHideMethod($name)
No description
in
ExtensionTrait at line 74
extensionIsHiddenField($name)
No description
in
ExtensionTrait at line 79
extensionIsHiddenMethod($name)
No description
in
ExtensionTrait at line 84
static
getCalledExtensionClass()
No description
at line 39
__construct(null $model = null)
Class constructor
at line 63
array
initialize($host)
Initialize method called when the payment gateway is first loaded with an existing model.
at line 75
initConfigData(Model $host)
Initializes configuration data when the payment method is first created.
at line 82
defineFieldsConfig()
Extra field configuration for the payment type.
at line 90
getConfigFields()
Returns the form configuration used by this payment type.
at line 98
getConfigRules()
Returns the form validation rules used by this payment type.
at line 106
getConfigValidationAttributes()
Returns the form validation attributes used by this model.
at line 114
getConfigValidationMessages()
Returns the form validation messages used by this model.
at line 129
array
registerEntryPoints()
Registers a entry page with specific URL. For example, PayPal needs a landing page for the auto-return feature.
Important! Payment module access point names should have a prefix.
at line 141
string
makeEntryPointUrl(string $code)
Utility function, creates a link to a registered entry point.
at line 154
bool
isApplicable(float $total, $host)
Returns true if the payment type is applicable for a specified order amount
at line 165
bool
hasApplicableFee($host = null)
Returns true if the payment type has additional fee
at line 178
string
getFormattedApplicableFee($host = null)
Returns the payment type additional fee
at line 191
completesPaymentOnClient()
This method should return TRUE if the gateway completes the payment on the client's browsers.
Allows the system to take extra steps during checkout before completing the payment
at line 203
processPaymentForm(array $data, Model $host, Model $order)
Processes payment using passed data.
at line 210
beforeRenderPaymentForm($host, $controller)
Executed when this gateway is rendered on the checkout page.
at line 217
Payments_model
getHostObject()
No description
at line 230
supportsPaymentProfiles()
This method should return TRUE if the gateway supports user payment profiles.
The payment gateway must implement the updatePaymentProfile(), deletePaymentProfile() and payFromPaymentProfile() methods if this method returns true.
at line 241
Payment_profiles_model|object
updatePaymentProfile(Customers_model $customer, array $data)
Creates a customer profile on the payment gateway or update if the profile already exists.
at line 251
deletePaymentProfile(Customers_model $customer, Payment_profiles_model $profile)
Deletes a customer payment profile from the payment gateway.
at line 261
payFromPaymentProfile(Orders_model $order, array $data = [])
Creates a payment transaction from an existing payment profile.
at line 270
processRefundForm($data, $order, $paymentLog)
No description
at line 277
protected
createOrderModel()
Creates an instance of the order model
at line 287
protected
createOrderStatusModel()
Creates an instance of the order status model