Home / API Platform / PHP Processor

PHP Processor


Requirements

Fraud Protection

Custom forms are not protected by Click & Pledge's fraud protection guarantee since reCAPTCHA cannot be enforced, as well as various server-side checks & balances we have included in the CONNECT forms.  Please make sure the forms are tested against credit card validation robo-attacks.  By using the API you are accepting complete responsibility for all fraudulent transactions.

Downloads

 

Web Server

  • Apache

PHP Version 7.3.19

Place the ClickandPledge_PaaS_Processer.php in your web server.

Include the ClickandPledge_PaaS_Processer.php file by using the following syntax :

 $file_path = 'ClickandPledge_PaaS_Processor.php'; // This will specify the path for the ClickandPledge_PaaS_Processor.php

require_once $file_path; // This will include the ClickandPledge_PaaS_Processor.php file

Create instance for the class

$object = new PaaS_PHP($file_path); // This will create the instance for the class

Instructions

  1. You should use the Click & Pledge form open function to create the form.
    • Example : - echo $object->Form_Open();
  2. All the form elements should be placed after form open function.
  3. You should use submit function for submitting the form.
    • Example : - echo $object->Form_Submit(); 
  4. 4.You should use the Click & Pledge form close function to close the form.
    • Example : - echo $object->Form_Close();
  5. To Processes the form and display Error/Success messages use below syntax.
$nn = $an->Check();

Billing/Personal Information

Common name PHP Function Example Error Message
First Name Set_First_Name(); <input type="text" name="<?php echo $object->Set_First_Name();?>" id="BillingFirstName"/> Invalid First Name.
Middle Initial Set_Middle_Initial(); <input type="text" name="<?php echo $object->Set_Middle_Initial();?>" id="BillingMI"/> Invalid Middle Name.
Last name Set_Last_Name(); <input type="text" name="<?php echo $object->Set_Last_Name();?>" id="BillingLastName"/> Invalid Last Name.
Email Set_Email(); <input type="text" name="<?php echo $object->Set_Email();?>" id="BillingEmail"/> Invalid Email.
BillingPhone Set_Phone(); <input type="text" name="<?php echo $object->Set_Phone();?>" id="BillingPhone"/> Invalid Phone Number.

Billing Address


Common name PHP Function Example Error Message
Address1 Set_Billing_Address1(); <input type="text" name="<?php echo $object->Set_Billing_Address1();?>" id="BillingAddress1"/> Invalid Address1.
Address2 Set_Billing_Address2(); <input type="text" name="<?php echo $object->Set_Billing_Address2();?>" id="BillingAddress2"/> Invalid Address2.
Address3 Set_Billing_Address3(); <input type="text" name="<?php echo $object->Set_Billing_Address3();?>" id="BillingAddress3"/> Invalid Address3.
City Set_Billing_City(); <input type="text" name="<?php echo $object->Set_Billing_City();?>" id="BillingCity"/> Invalid City.
State or Province Set_State_Province(); <input type="text" name="<?php echo $object->Set_State_Province('billing');?>" id="BillingStateProvince"/> Invalid State Province.
Postal Code Set_Billing_Postal_Code(); <input type="text" name="<?php echo $object->Set_Billing_Postal_Code();?>" id="BillingPostalCode"/> Invalid Postal Code.
Country Code Set_Country_Code(); <input type="text" name="<?php echo $object->Set_Country_Code('billing',840);?>" id="BillingCountryCode"/> Invalid Country.

Shipping Address

Common name PHP Function Example Error Message
First Name Set_Shipping_First_Name(); <input type="text" name="<?php echo $object->Set_Shipping_First_Name();?>" id="ShippingFirstName"/> Invalid Shipping First Name.
Middle Initial Set_Shipping_Middle_Initial(); <input type="text" name="<?php echo $object->Set_Shipping_Middle_Initial();?>" id="ShippingMI"/> Invalid Shipping Middle Name.
Last name Set_Shipping_Last_name(); <input type="text" name="<?php echo $object->Set_Shipping_Last_name();?>" id="ShippingLastName"/> Invalid Shipping Last Name.
Email Set_Shipping_Email(); <input type="text" name="<?php echo $object->Set_Shipping_Email();?>" id="ShippingEmail"/> Invalid Shipping Email.
BillingPhone Set_Shipping_Phone(); <input type="text" name="<?php echo $object->Set_Shipping_Phone();?>" id="ShippingPhone"/> Invalid Shipping Phone Number.
Address1 Set_Shipping_Address1(); <input type="text" name="<?php echo $object->Set_Shipping_Address1();?>" id="ShippingAddress1"/> Invalid Shipping Address1.
Address2 Set_Shipping_Address2(); <input type="text" name="<?php echo $object->Set_Shipping_Address2();?>" id="ShippingAddress2"/> Invalid Shipping Address2.
Address3 Set_Shipping_Address3(); <input type="text" name="<?php echo $object->Set_Shipping_Address3();?>" id="ShippingAddress3"/> Invalid Shipping Address3.
City Set_Shipping_City(); <input type="text" name="<?php echo $object->Set_Shipping_City();?>" id="ShippingCity"/> Invalid Shipping City.
State or Province Set_State_Province(); <input type="text" name="<?php echo $object->Set_State_Province('shipping');?>" id="ShippingStateProvince"/> Invalid Shipping State Province.
Postal Code Set_Shipping_Postal_Code(); <input type="text" name="<?php echo $object->Set_Shipping_Postal_Code();?>" id="ShippingPostalCode"/> invalid Shipping Postal Code.
Country Code Set_Country_Code(); <input type="text" name="<?php echo $object->Set_Country_Code('shipping',840);?>" id="BillingCountryCode"/> Invalid Shipping Country.

Custom Questions

Top
Common name PHP Function Example Error Message
Question Set_Custom_Question($id,$question); Employer <?php echo $object->Set_Custom_Question(1,'Employer');?>
Answer Set_Custom_Answer($id); <input type="text" name="<?php echo $object->Set_Custom_Answer(1);?>"/>

Examples

Employer <?php echo $object->Set_Custom_Question(1,'Employer');?>
<input name="<?php echo $object->Set_Custom_Answer(1);?>" type="text" maxlength="500" size="50 /> 

In case of multiple custom questions use a numerical suffix as shown below: 

Employer <?php echo $object->Set_Custom_Question(1,'Employer');?>
<input name="<?php echo $object->Set_Custom_Answer(1);?>" type="text" maxlength="500" size="50 /> 

Occupation <?php echo $object->Set_Custom_Question(2,'Occupation');?>
<input name="<?php echo $object->Set_Custom_Answer(2);?>" type="text" maxlength="500" size="50 /> 

Place of Employment <?php echo $object->Set_Custom_Question(3,'Place of Employment');?>
<input name="<?php echo $object->Set_Custom_Answer(3);?>" type="text" maxlength="500" size="50 /> 

Product Information

Top
Common name PHP Function Example
Item ID Set_ItemID($basket_id); <input type="hidden" name="<?php echo $object->Set_ItemID(1);?>" id="ItemID1" value="0"/>
Item Name Set_ItemName($basket_id); <input type="hidden" name="<?php echo $object->Set_ItemName(1);?>" id="ItemName1" value="Donation" />
Quantity Set_Quantity($basket_id); <input type="hidden" name="<?php echo $object->Set_Quantity(1);?>" id="Quantity1" value="1" />
Unit Price Set_Unit_Price($basket_id); <input type="text" name="<?php echo $object->Set_Unit_Price(1);?>" id="UnitPrice1" value="" />
Unit Deductible % Set_Unit_Deductible($basket_id); <input type="hidden" name="<?php echo $object->Set_Unit_Deductible(1);?>" id="UnitDeductible1" value="10" />
Unit Tax Set_UnitTax($basket_id); <input type="hidden" name="<?php echo $object->Set_UnitTax(1);?>" id="UnitTax1" value="0"/>
Unit Discount Set_UnitDiscount($basket_id); <input type="hidden" name="<?php echo $object->Set_UnitDiscount(1);?>" id="UnitDiscount1" value="0"/>
Item SKU Set_SKU($basket_id); <input type="hidden" name="<?php echo $object->Set_SKU(1);?>" id="SKU1" value="00-ABCD-2013"/>
Other field [special case]* Explained in example below

OTHER field

To help with the “OTHER” field problem the following provision is now a feature of PHP Processor:

  • $10  
  • $20  
  • $50  
  • $100  
  • OTHER  
  • [OTHER field]  
In the above scenario a radio form field passes UnitPrice as the value of the radio field. If the value which is passed by the UnitPrice is “OTHER” then FaaS looks for the amount which is in a text field labeled “OTHER”. 

The following is a sample HTML demonstrating the above presentation: 

<input type="radio" name="<?php echo $object->Set_Unit_Price(1);?>" id="radio" value="10" />$10

<input type="radio" name="<?php echo $object->Set_Unit_Price(1);?>" id="radio" value="20" />$20

<input type="radio" name="<?php echo $object->Set_Unit_Price(1);?>" id="radio" value="30" />$30

<input type="radio" name="<?php echo $object->Set_Unit_Price(1);?>" id="radio" value="40" />$40

<input type="radio" name="<?php echo $object->Set_Unit_Price(1);?>" id="radio" value="50" />$50

<input type="radio" name="<?php echo $object->Set_Unit_Price(1);?>" id="radio" value="<?php echo $object->Set_OtherValue();?>" />Other

Other <input name="<?php echo $object->Set_Other(1);?>" type="text" id="Other1" size="10" /> 

If the radio button option for Other is selected, the Other field text value will be used by PHP Processor as the value passed.

Multiple products 

multiple products may be added to any form by simply incrementing the Basket id for each item. The following provides a quick overview example: 

<input name="<?php echo $object->Set_Unit_Price(1);?>" type="text" id="UnitPrice1" value="5" size="10" />
<input name="<?php echo $object->Set_Unit_Deductible(1);?>" type="hidden" id="UnitDeductible1" value="100%" /> 
<input name="<?php echo $object->Set_ItemID(1);?>" type="hidden" id="ItemID1" value="1" />
<input name="<?php echo $object->Set_ItemName(1);?>" type="hidden" id="ItemName1" value="Cause 1" />
<input name="<?php echo $object->Set_Quantity(1);?>" type="hidden" id="Quantity1" value="1" /> 

<input name="<?php echo $object->Set_Unit_Price(2);?>" type="text" id="UnitPrice2" value="10" size="10" />
<input name="<?php echo $object->Set_Unit_Deductible(2);?>" type="hidden" id="UnitDeductible2" value="5" />
<input name="<?php echo $object->Set_ItemID(2);?>" type="hidden" id="ItemID2" value="2" />
<input name="<?php echo $object->Set_ItemName(2);?>" type="hidden" id="ItemName2" value="Cause 2" />
<input name="<?php echo $object->Set_Quantity(2);?>" type="hidden" id="Quantity2" value="1" />

There is no limit on the number of elements that may be passed. 
Note :- <?php echo $object->Set_Unit_Price('text');?> --> Invalid Basket Declaration.
Always Basket Id is numeric.

Shipping Information

Top
Common name PHP Function Example
Method Set_ShippingMethod(); Fed-Ex : <input type="hidden" name="<?php echo $object->Set_ShippingMethod();?>" id="ShippingMethod" value="Fed-Ex"/>
Fee and Tax Set_ShippingValueTax($method,$methodvalue,$methodtax); <?php echo $object->Set_ShippingValueTax("Fed-Ex",0,2);?>
Important Note

The following are key points in dealing with shipping.
For Shipping to be added to the receipt ShippingMethod has to have a value. If the value is blank no shipping will be posted.
In the absence of "Shipping Address" nodes "Billing Address" will be used for "Shipping Address" nodes.

Receipt Information

Top
Common name PHP Function Example
WID Set_Wid($wid); <?php echo $object->Set_Wid(8547);?>
Send Receipt Set_SendReceipt($receipt); <?php echo $object->Set_SendReceipt('true');?>
Organization Information Set_OrganizationInformation($organization_information) <?php echo $object->Set_OrganizationInformation('Text about Organization');?>
Thank You Message Set_ThankYouMessage($thank_you_message); <?php echo $object->Set_ThankYouMessage('Thank you message will display on receipt');?>

Recurring Transactions

Top

Note :- 
Allowed Periodicity Values 
$this->periodicity_options = array('Week'=>'Week','2 Weeks'=>'2 Weeks','Month'=>'Month','2 Months'=>'2 Months','Quarter'=>'Quarter','6 Months'=>'6 Months','Year'=>'Year');

Allowed Recurring Method 
$this->allowed_recurringmethod = array('Installment','Subscription'); 

Common name PHP Function Example
Recurring Type Set_Recurring_Method(); <input type="hidden" name="<?php echo $an->Set_Recurring_Method(); ?>" value="<?php echo $an->allowed_recurringmethod[1]; ?>" />
Number of payments* Set_No_Of_Recurring(); <input name="<?php echo $object->Set_No_Of_Recurring();?>" type="hidden" value="10" />
Periodicity Set_Periodicity(); <input name="<?php echo $object->Set_Periodicity();?>" type="hidden" id="Periodicity" value="Month" />

Note :- Periodicity Allowed Values 
$this->periodicity_options=array('Week'=>'Week','2 Weeks'=>'2 Weeks','Month'=>'Month','2 Months'=>'2 Months','Quarter'=>'Quarter','6 Months'=>'6 Months','Year'=>'Year');

Example :-

<select name="<?php echo $an->Set_Periodicity(); ?>" id="Periodicity">
<?php foreach($an->Periodicity_options as $Periodicity_options) { ?>
<option value="<?php echo $Periodicity_options;?>"><?php echo $Periodicity_options;?></option>
<?php } ?>
</select>

Special Condition:

Subscription = 999: The special case of 999 translates to indefinite recurring payments. The receipt message for the recurring payment will NOT display the END DATE and will ask the patron to contact the organization for cancellation. 
Installment = 998 is maximum number of Installments.

Payment Information

Top The following payment types are supported:

$this->allowed_paymenttypes=array('CreditCard','eCheck','CustomPayment Type');
  • CreditCard
  • eCheck
  • Custom Payment Type

CreditCard

Common name PHP Function Example Error Message
Payment Type Set_PaymentType(); <input name="<?php echo $object->Set_PaymentType();?>" type="hidden" id="CreditCard" value="CreditCard" />
(or)
<input name="<?php echo $object->Set_PaymentType();?>" type="hidden" id="CreditCard" value="<?php echo $an->allowed_paymenttypes[0]; ?>" />
Payment Method Is Not Supported.
Name On Card Set_NameOnCard(); <input type="text" name="<?php echo $object->Set_NameOnCard();?>"/> Invalid Credit Card Name.
Card Number Set_CardNumber(); <input name="<?php echo $object->Set_CardNumber();?>" type="text" id="CardNumber" /> Invalid Credit Card Number.
Cvv2 Set_Cvv(); <input type="text" name="<?php echo $object->Set_Cvv();?>" id="Cvv2"/> Invalid Cvv Number.
Expiration Date* Set_Expiration_Date(); <?php echo $object->Set_Expiration_Date();?> Invalid Month/Year.

eCheck

Common name PHP Function Example Error Message
Payment Type Set_PaymentType(); <input name="<?php echo $object->Set_PaymentType();?>" type="hidden" id="Check" value="Check" />
(or)
<input name="<?php echo $object->Set_PaymentType();?>" type="hidden" id="Check" value="<?php echo $an->allowed_paymenttypes[1]; ?>" />
Payment Method Is Not Supported.
Name On Account Set_NameOnAccount(); <input type="text" name="<?php echo $object->Set_NameOnAccount();?>"/> Invalid Name On Account.
Routing Number Set_RoutingNumber(); <input name="<?php echo $object->Set_RoutingNumber();?>" type="text" id="RoutingNumber" /> Invalid Routing Number.
Account Number Set_AccountNumber(); <input type="text" name="<?php echo $object->Set_AccountNumber();?>" id="AccountNumber"/> Invalid Name On Account.
Account Type Set_AccountType(); <input type="text" name="<?php echo $object->Set_AccountType();?>" id="AccountType"/> Invalid Account Type.
Check Type Set_CheckType(); <input type="text" name="<?php echo $object->Set_CheckType();?>" id="CheckType"/> Invalid Check Type.
Check Number Set_CheckNumber(); <input type="text" name="<?php echo $object->Set_CheckNumber();?>" id="CheckNumber"/> Invalid Check Number.

Custom Payment Type


$this->allowed_custompaymenttypes = array('Cash', 'Pay Later');
You may add any text as the custom payment type names.
Common name PHP Function Example
Custom Payment Type Set_CustomPaymentType(); <select name="<?php echo $an->Set_CustomPaymentType(); ?>" id="CustomPaymentName"> <?php foreach($an->allowed_custompaymenttypes as $Allowed_Custompaymenttypes) { ?> <option value="<?php echo $Allowed_Custompaymenttypes;?>"><?php echo $Allowed_Custompaymenttypes;?></option> <?php } ?></select>
NOTE: Custom Payment Type: Only past and present transactions are allowed while no future date transaction may be processed.

Account Information

Top
Common name PHP Function Example
Guid* and Account ID* Set_Authentication($guid,$accountid); <?php echo $object->Set_Authentication('ddd31189-9a80-41d9-99e7-fdbb4350893c','14521');?>
AccountToken Set_AccountToken(); <input name="<?php echo $an->Set_AccountToken();?>" type="radio" id="AccountToken" value="8cab4c84-09a1-4ecc-a614-27902640c2ee/20861/59201/Account-2">
* Account information may be combined through AccountToken. AccountToken format is as follows:

AccountToken: AccountGuid/AccountID/CheckoutPageID/Tracker 

If CheckOutPageID is not needed use blank as the value

AccountToken: AccountGuid/AccountID//Tracker 

AccountToken is useful when a form needs to post all account information fields as an option. For example an organization may have three accounts and wants to use one donation form to accept donations for all three accounts giving the donor the option for donating to a specific account, e.g. Foundation, PAC, and Building Fund. In this case a radio button may be used and AccountToken will be used to pass the account information with each radio button.

Order Mode

Top
Common name PHP Function Example Error Message
Order Mode Set_Order_Mode($ordermode); <?php echo $object->Set_Order_Mode('Test');?> Invalid Order Mode Argument.
Tracker Set_Tracker($tracker); <?php echo $object->Set_Tracker('Campaign123');?> Invalid Tracker.
Campaign Set_Campaign_Name($campaign_name); <?php echo $object->Set_Campaign_Name('child fund');?> Invalid Campaign.


CONNECT Campaign


Common name PHP Function Example Error Message
CONNECT Campaign Set_ConnectCampaign(); <input name="<?php echo $an->Set_ConnectCampaign();?>" type="hidden" id="ConnectCampaign" value="feedthepoor"> Invalid Connect Campaign.


Charge Date


Common name PHP Function Example Error Message
Charge Date Set_Charge_Date(); <?php echo $an->Set_Charge_Date();?> Transaction Date should not be less than system date.



 RSS of this page