|
Shop_PaymentMethod class
Represents a payment method.
Object if this class is available through the $payment_method property of the Shop_Order class.
Also, a collection of payment method objects is available on the Payment Method step of the Checkout process.
Public propertiesShow inherited properties.
Public methodsShow inherited methods.
Events
Property details¶ description propertypublic string $description;
Specifies the payment method description in plain text format.
¶ id propertypublic integer $id;
Specifies the payment method record identifier.
¶ ls_api_code propertypublic string $ls_api_code;
Specifies the payment method API code.
¶ name propertypublic string $name;
Specifies the payment method name.
Method details¶ delete_customer_profile() methodpublic void delete_customer_profile(Shop_Customer $customer)
Deletes a customer payment profile.
The method deletes the payment profile from the database and from the payment gateway.
¶ find_by_api_code() methodpublic static Shop_PaymentMethod find_by_api_code(string $code)
Finds a payment method by the API code.
This method allows you to find specific payment methods. You can assign the LemonStand API Code to any payment method
in the payment method configuration form.
¶ find_by_id() methodpublic static Shop_PaymentMethod find_by_id(integer $id)
Finds a payment method by its identifier.
This method caches payment methods in memory and it is preferable to use this method instead of direct Db_ActiveRecord
operations due to the performance considerations.
¶ find_customer_profile() methodpublic Shop_CustomerPaymentProfile find_customer_profile(Shop_Customer $customer)
Finds and returns a customer payment profile for this payment method.
See Also¶ get_paymenttype_object() methodpublic Shop_PaymentType get_paymenttype_object()
Returns a payment type object.
Each payment method has an underlying payment type object. Payment type classes
are specific for different payment gateways and implement operations
required for working with a specific gateway.
See Also¶ has_payment_form() methodpublic boolean has_payment_form()
Determines whether the payment method has a payment form.
This method returns TRUE for online payment methods. Some payment methods, for example
the custom payment method, do not have a payment form.
This method is used inside the payment page.
See Also¶ init_customer_profile() methodpublic Shop_CustomerPaymentProfile init_customer_profile(Shop_Customer $customer)
Initializes a new empty customer payment profile.
This method should be used by payment methods internally.
¶ list_available_transaction_transitions() methodpublic array list_available_transaction_transitions(string $transaction_id, string $transaction_code)
Returns a list of available transitions from a specific transaction status.
The method returns an associative array with keys corresponding transaction statuses
and values corresponding transaction status actions: array('V'=>'Void', 'S'=>'Submit for settlement').
Transaction statuses are specific for different payment gateways.
¶ pay_offline_message() methodpublic string pay_offline_message()
Returns the offline payment message if the payment method supports it.
Some payment methods, for example the custom payment method, do not have a payment form and display an
offline payment message instead.
This method is used inside the payment page.
See Also¶ profile_exists() methodpublic boolean profile_exists(Shop_Customer $customer)
Checks whether a customer profile for this payment method and a given customer exists.
¶ profle_exists() methodpublic boolean profle_exists(Shop_Customer $customer)
This method is deprecated. Use profile_exists() method.
Checks whether a customer profile for this payment method and a given customer exists.
¶ render_payment_form() methodpublic void render_payment_form(Cms_Controller $controller)
Renders the payment method payment form.
This method is used inside the payment page.
See Also¶ render_payment_profile_form() methodpublic void render_payment_profile_form(Cms_Controller $controller)
Renders the payment method payment profile form.
This method is used inside the payment proile page.
See Also¶ request_transaction_status() methodpublic Shop_TransactionUpdate request_transaction_status($transaction_id)
Returns status of a specific transaction.
This method contacts the payment gateway and requests the actual transaction status.
¶ set_transaction_status() methodpublic Shop_TransactionUpdate set_transaction_status(Shop_Order $order, string $transaction_id, string $transaction_code, string $new_transaction_code)
Contacts the payment gateway and sets specific status for specific transaction.
¶ supports_payment_profiles() methodpublic boolean supports_payment_profiles()
Checks whether the payment module supports payment profiles.
¶ supports_transaction_status_query() methodpublic boolean supports_transaction_status_query()
Checks whether the payment method supports requesting a status of a specific transaction.
|