classes/payment_gateways/_template.php

Properties

Description

This is the "developer template" that documents most of what a payment gateway can do in the system.

Classes

_templatePaymentGateway

Properties

 
 
System  
No 
No 

Description

This is the "developer template" payment gateway handler, a developer could use this file as a starting point for creating a new payment gateway in the system.

Methods

adminRecurringDisplay, admin_custom_config, admin_display_payment_gateways, admin_update_payment_gateways, auction_final_feesOrderItem_canAutoCharge, auction_final_feesOrderItem_cron_close_listings, geoCart_payment_choicesCheckVars, geoCart_payment_choicesDisplay, geoCart_payment_choicesProcess, geoCart_process_orderDisplay, getRecurringAgreement, isRecurring, recurringCancel, recurringUpdateStatus, recurring_process, transaction_process,

adminRecurringDisplay( \geoRecurringBilling   $recurring, ) : array

Description

Optional, used to get info on a particular recurring billing specific to this gateway in the admin panel when viewing a recurring billing's details.

Arguments

Name Type Description Default
$recurring \geoRecurringBilling

Return value

Type Description
array An array of things to display as specified in-line comments

Tags

Name Description
since Version 4.1.0

admin_custom_config( ) : string

Description

Optional.
Used: in admin, on payment gateway pages, to see if should show configure button, and to display the contents if that button is clicked. If this function exists, it will be used to display custom settings specific for this gateway using ajax. If the function does not exist, no settings button will be displayed beside the gateway.

Return value

Type Description
string HTML to display below gateway when user clicked the settings button

admin_display_payment_gateways( ) : array

Description

Optional.
Used in admin, in paymentGatewayManage::getGatewayTable() which is used in both ajax calls, and to initially display the gateway page. Expects to return an array: array ( 'name' => $gateway->name, 'title' => 'What to display in list of gateways', ) Note: if need extra settings besides just being turned on or not, see the method admin_custom_config()

Return value

Type Description
array

admin_update_payment_gateways( ) : boolean

Description

Optional.
Used: in admin, in paymentGatewayManage::update_payment_gateways() Use this function to save any additional settings. Note that this is done IN ADDITION TO the normal "back-end" stuff such as enabling or disabling the gateway and serializing any changes. If this returns false however, that additional stuff will not be done.

Return value

Type Description
boolean True to continue with rest of update stuff, false to prevent saving rest of settings for this gateway.

auction_final_feesOrderItem_canAutoCharge( ) : bool

Description

Optional.
Used: in auction_final_feesOrderItem::geoCart_cartProcess Not part of main cart system. This is a special case, for giving the ability for a gateway to pay for auction final fees. This function would return true in order to display billing info page even when cart total is $0, in order to collect payment details.

Return value

Type Description
bool True to always display billing info, false otherwise.

auction_final_feesOrderItem_cron_close_listings( array   $vars, ) : n/a

Description

Optional.
Used: in auction_final_feesOrderItem::cron_close_listings Not part of main cart system. This is a special case, for giving the ability for a gateway to pay for auction final fees.

Arguments

Name Type Description Default
$vars array

see docs in this function

Return value

Type Description
n/a n/a

geoCart_payment_choicesCheckVars( ) : n/a

Description

Optional.
Used: in geoCart::payment_choicesCheckVars() Called no matter what selection is made when selecting payment type, so before doing any checks you need to make sure the payment type selected (in var $_POST['c']['payment_type']) matches this payment gateway. If there are any problems, use $cart->addError() to specify that it should not go onto the next step, processing the order (aka geoCart_payment_choicesProcess())

Return value

Type Description
n/a n/a

geoCart_payment_choicesDisplay( array   $vars, ) : array

Description

Optional.
Used: in geoCart::payment_choicesDisplay() Should return an associative array that is structured as follows: array( 'title' => string, 'title_extra' => string, 'label_name' => string, //needs to be: self::gateway_name, 'radio_value' => string, //should be self::gateway_name 'help_link' => string, //entire link including a tag and link text, example: $cart->site->display_help_link(3240), 'checked' => boolean, //leave false to let system determine if it is checked or not, true to force being checked //Items below will be auto generated if left as empty string. 'radio_name' => string,//usually c[self::gateway_name] - this set by system if left as empty string. 'choices_box' => string,//use custom stuff for the entire choice box. 'help_box' => string,//use custom stuff for help link and box surrounding it. 'radio_box' => string,//use custom box for radio 'title_box' => string,//use custom box for title 'radio_tag' => string//use custom tag for radio tag )

Arguments

Name Type Description Default
$vars array

Array of info, see source of method for further documentation.

Return value

Type Description
array Associative Array as specified above.

geoCart_payment_choicesProcess( ) : n/a

Description

Optional.
Used: in geoCart::payment_choicesProcess() This function is where any processing is done, and is also where things like re-directing to an external payment site would be done, or updating account balance, etc. Note that this is only called if this payment gateway is the one that was chosen, and there were no errors generated by geoCart_payment_choicesCheckVars(). This is where you would create a transaction that would pay for the order, into the invoice.

Return value

Type Description
n/a n/a

geoCart_process_orderDisplay( ) : n/a

Description

Optional.
Used: in geoCart::process_orderDisplay() This is a good place to do things like display a message that the listing has been placed on hold until payment is received, or place to display other similar messages. Note that there is no process_orderCheckVars() or process_orderProcess() since this page is only meant for display purposes, for any processing that needs to be done, needs to go in geoCart::payment_choicesProcess()

Return value

Type Description
n/a n/a

getRecurringAgreement( ) : array|bool

Description

Optional, used on payment selection page, this will be the recurring billing user agreement label and text, it should return an array.
Only used if isRecurring returns true and it is recurring payment. If implemented by payment gateway, the superclass will return false which indicates no user agreement.

Return value

Type Description
array|bool Either bool false if no agreement shown, or an array like: array ('label' => 'label text', 'text' => 'text in agreement box.')

isRecurring( ) : bool

Description

Optional, used in various places, if return true then you signify that this payment gateway has recurring billing capabilities. If method not implemented, the superclass will return false (not recurring) by default.

Return value

Type Description
bool

recurringCancel( \geoRecurringBilling   $recurring, string   $reason = '', ) : bool

Description

Optional, called to cancel the recurring billing, to stop payments.
Gateway should do whatever is needed to cancel the payment status, and update the details on the recurring billing.

Arguments

Name Type Description Default
$recurring \geoRecurringBilling
$reason string

The reason for the recurring billing cancelation.

''

Return value

Type Description
bool Return true to say to cancel recurring payment, false to block canceling the recurring payment.

recurringUpdateStatus( \geoRecurringBilling   $recurring, ) : n/a

Description

Optional, used to get an updated status for the recurring billing to see if it is current and paid, and if so update the recurring data's info.
Called to query the gateway to see the status of the recurring billing, and update the recurring billing's paidUntil status, update main status (for gateways that choose to use that), add a recurring billing transaction if applicable, etc.

Arguments

Name Type Description Default
$recurring \geoRecurringBilling

Return value

Type Description
n/a n/a

recurring_process( ) : n/a

Description

Optional.
Used: In recurring_process.php to allow processing of "signals" back from a payment processor regarding recurring payments. Typical usage is on payment gateways that use recurring billing, and send a signal back to the site to notify when payments are made, or when recurring billing is canceled by the user, etc. To use, you would specify the following url for the recurring billing notifications: https://example.com/recurring_process.php?gateway=_template (Adjust site URL and gateway value) It would be up to this method to determine what "transaction/recurring billing" this signal is for, to do any "security checks" to make sure the signal is authentic, and to determine what actions should be made for the recurring billing. See other payment gateway usage (like in paypal.php) for examples on how to do this.

Return value

Type Description
n/a n/a

transaction_process( ) : n/a

Description

Optional.
Used: In transaction_process.php to allow processing of "signals" back from a payment processor. Called from file /transaction_process.php - this function should be used when expecting some sort of processing to take place where the external gateway needs to contact the software back (like Paypal IPN) It is up to the function to verify everything, and make any changes needed to the transaction/order. Note that this is NOT where normal payment processing would happen when someone clicks the payment button, this is only called by transaction_process.php when a payment signal for this gateway is received. To use, you would specify the url: https://example.com/transaction_process.php?gateway=_template As the "signal/notification URL" to send notifications to (obviously would need to adjust for the actual payment gateway and actual site's URL). Don't forget to authenticate the signal in some way, to validate it is indeed coming from the payment processor!

Return value

Type Description
n/a n/a

Properties

$name, $type,

string  public  $name = '_template'

Required, the name of this gateway, should be the same as the file name without the .php


string  public  $type = '_template'

Required, Usually the same as the name, this can be used as a means to warn the admin that they may be using 2 gateways that are the same type. Mostly used to distinguish CC payment gateways (by using type of 'cc'), but can be used for other things as well.


Constants

  gateway_name = '_template'

For convenience, should be same as $name


Documentation was generated by phpDocumentor 2.2.0 .

Namespaces

  • global

    Packages

    • Default
      • ExampleAddon
        • addon_example_admin
          In charge of doing stuff on the admin side, this is optional.
        • addon_example_info
          Required class for addons, this is the Addon information class, used by the addon system to determine what the addon can do. Also contains info about the addon that can be viewed in the addon management page in the admin.
        • addon_example_pages
          Addon page class, used by the addon system to display pages on the client side.
        • addon_example_setup
          This class is not required. If it, and the function for a particular routine exist, then that function will be called IN ADDITION TO the automated routines of the addon framework.
        • addon_example_tags
          Expects one function for each tag. Function name should be the same as the tag name. Can also have a constructor if anything needs to be constructed.
        • addon_example_util
          This is where to put functions that the main part of the addon will use.
        • eWidgetOrderItem
          This order item is designed to allow users on your site to purchase an eWidget.
      • System
        • DataAccess
          This is the main Database access object.
        • Singleton
          Singleton method class
        • _templateOrderItem
          Developers: use this file as a template to create a new order item.
        • _templatePaymentGateway
          This is the "developer template" payment gateway handler, a developer could use this file as a starting point for creating a new payment gateway in the system.
        • geoAPI
          The main system class for receiving and handling remote API calls, this acts as a translation layer between the communication with the "outside" and each API call.
        • geoAddon
          This is the class that handles anything and everything to do with addons.
        • geoArrayTools
          Utility functions for manipulating arrays
        • geoBrowse
          Contains functions common to browsing listings
        • geoBrowsingFilter
          System for activating, storing, and deactivating browsing filters.
        • geoCJAX
          Class that wraps the CJAX_FRAMEWORK, used to get the CJAX class.
        • geoCache
          This is the main part of the Geo cache system, it does all the "low level" stuff like writing files and escaping cache data.
        • geoCacheModule
          Part of Geo Cache system, specifically tuned to work best with cacheing module data (which will be an array).
        • geoCachePage
          Cache system specifically tuned to work best with cacheing output of pages and modules
        • geoCacheSetting
          Part of Geo Cache system, specifically tuned to work best with cacheing site-wide key=value type settings.
        • geoCacheText
          Part of Geo Cache system, this part specifically tuned to work best with cacheing language specific messages.
        • geoCalendar
          Holds utility method(s) for manipulating stuff dealing with calendar selector.
        • geoCart
          This class is behind the cart, loading all the order items and such and displaying, and processing all the different pages.
        • geoCategory
          Utility class that holds various methods to do stuff with categories in the system.
        • geoCombineResources
          This class helps to combine CSS and JS files, minify them, and optionally compress them.
        • geoCron
          This is the cron job backend, it handles all the communication and security and all that.
        • geoCrypt
          Class to use for encrypting information that needs to be able to be retrieved later.
        • geoDate
          Holds utility method(s) for manipulating stuff dealing with dates.
        • geoEmail
          Class that sends out e-mails.
        • geoFields
          Class that holds settings information for fields to use.
        • geoFieldsField
          A mini object to hold data about a specific field.
        • geoFile
          As the name implies, this is used for file-based utility methods.
        • geoFilter
          A few utility methods, good for filtering stuff.
        • geoFormatString
          Used to display a message nice and pretty, we'll probably be getting rid of this class though so don't go crazy using it.
        • geoHTML
          Class to generate chunks of HTML that are very common, used the most in the admin panel.
        • geoImage
          This class is responsible for a lot of the image processing, along with other aspects like generating the image tag for thumbnails.
        • geoInvoice
          This is the invoice object representing an invoice in the system.
        • geoLeveledField
          Class for doing common things with leveled fields.
        • geoListing
          A listing object, basically a container object for particular listing.
        • geoListingDisplay
          This is basically a container that is responsible for helping to display {listing .
        • geoListingFeed
          Class that helps to render RSS or other types of feeds based on list of listings.
        • geoMaster
          This is dedicated class for getting the value of, and setting, the various "master switches" within the software. Since this is meant as an easy way to get the values of master switches, most of the methods are static.
        • geoNumber
          Utility functions relating to number conversion/manipulation/validation ect.
        • geoOrder
          The geoOrder object, an object representation of an order in the system.
        • geoOrderItem
          The class that all order items must extend.
        • geoPC
          Used for login credential validation, password hashing, etc. along with software licensing.
        • geoPagination
          Utility functions useful for generating pagination of a results page such as when browing ads or searching
        • geoPaymentGateway
          This class should be extended by each different payment gateway, this will have some default functions that each gateway will inherit, and also has a few final static methods used by the system to affect all order items.
        • geoPlanItem
          A container to hold settings for a particular order item type, according to price plan ID, and optionally category ID for category specific settings.
        • geoRecurringBilling
          The geoRecurringBilling object, an object representation of a recurring billing in the system.
        • geoRegion
          Stuff for regions and sub-regions.
        • geoRegistry
          Handy little object, can be used to set registry type settings.
        • geoSearchUtils
          Class for search utilities.
        • geoSellerBuyer
          Handles back-end for the seller/buyer payment gateways, to allow the buyer to more easily pay the seller for a won auction. This handles the underlying system, but the actual work is done by individual seller/buyer gateways, for instance the Paypal buy-now functionality.
        • geoSession
          Manages session storage and session cookies for user sessions.
        • geoString
          Utility functions relating to languages and string manipulation.
        • geoStringData
          This class is to store accented chars, to be used by {@link geoString::removeAccents()}, mainly to keep the String.class.php file un-cluttered.
        • geoTable
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableRow
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableRowset
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableSelect
          Class used to generate a select query, useful when multiple areas want to affect a single query, for instance when generating a search query and there are addons involved.
        • geoTables
          Used to hold database table names, used throughout the code.
        • geoTemplate
          Template object that extends the Smarty class (a 3rd party library) to enable using templates to display things.
        • geoTransaction
          This is the object used for a transaction in the order and invoice system.
        • geoUser
          An object representative of a certain user in the system.
        • geoUserRating
          Store, retrieve, and display inter-user ratings
        • geoUtil
          Misc utility functions
        • geoView
          As the name implies, this is used for creating the page view. It does take a little setup (like any class), the setup is normally done in the display_page method in geoSite, or display_page in geoAdmin if displaying a page in the admin.
        • iApiTransport
          Interface for API Transports, a transport must implement this interface for the system to use it.
        • iOrderItem
          You cannot have abstract static functions, so instead need to have an interface to force the given static functions to be defined.
        • metaDbTables
          Used so that old locations that use the old name geoTables will still work.