CreditConfig
in package
Class containing methods used to handle payment processing when keyword advertising is enabled.
This class is a "blank" implementation that does not charge credit cards An implementation that uses stripe.com for payment processing can be obtained from seekquarry.com. Putting that implementation in the APP_DIR/configs/ folder would that enable real credit card processing in Yioop
Table of Contents
- charge() : bool
- Server side method that is actually responsible for charging the credit card
- getAttribute() : string
- Used to get field values from input tag with attribute name set to $name and attribute value set to value
- getCreditTokenUrl() : string
- Returns the URL to the credit processing Javascript library responsible for sending securely the credit card details to the credit payment agency (for example, stripe.com) then sending along a authorization token as part of the form to the Yioop backend
- isActive() : bool
- Returns whether a version of CreditConfig actually capable of charging cards, receiving bitcoins, etc is in use.
Methods
charge()
Server side method that is actually responsible for charging the credit card
public
static charge(float $amount, string $token, string &$message) : bool
Parameters
- $amount : float
-
dollar amount to charge the card
- $token : string
-
token issued for transaction from the card processing agency
- $message : string
-
message to use as for reason for charge
Return values
bool —whether or not the charge was successful
getAttribute()
Used to get field values from input tag with attribute name set to $name and attribute value set to value
public
static getAttribute(string $name, string $value) : string
Parameters
- $name : string
-
of attribute (usually data-)
- $value : string
-
value of attribute
Return values
string —field value of the correspond input tag
getCreditTokenUrl()
Returns the URL to the credit processing Javascript library responsible for sending securely the credit card details to the credit payment agency (for example, stripe.com) then sending along a authorization token as part of the form to the Yioop backend
public
static getCreditTokenUrl() : string
Return values
string —isActive()
Returns whether a version of CreditConfig actually capable of charging cards, receiving bitcoins, etc is in use.
public
static isActive() : bool
Return values
bool —whether a real credit card processing class is use