Home / API Platform / PHP Processor

PHP Processor


Requirements

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 namePHP FunctionExampleError Message
First NameSet_First_Name();<input type="text" name="<?php echo $object->Set_First_Name();?>" id="BillingFirstName"/>Invalid First Name.
Middle InitialSet_Middle_Initial();<input type="text" name="<?php echo $object->Set_Middle_Initial();?>" id="BillingMI"/>Invalid Middle Name.
Last nameSet_Last_Name();<input type="text" name="<?php echo $object->Set_Last_Name();?>" id="BillingLastName"/>Invalid Last Name.
EmailSet_Email();<input type="text" name="<?php echo $object->Set_Email();?>" id="BillingEmail"/>Invalid Email.
BillingPhoneSet_Phone();<input type="text" name="<?php echo $object->Set_Phone();?>" id="BillingPhone"/>Invalid Phone Number.

Billing Address


Common namePHP FunctionExampleError Message
Address1Set_Billing_Address1();<input type="text" name="<?php echo $object->Set_Billing_Address1();?>" id="BillingAddress1"/>Invalid Address1.
Address2Set_Billing_Address2();<input type="text" name="<?php echo $object->Set_Billing_Address2();?>" id="BillingAddress2"/>Invalid Address2.
Address3Set_Billing_Address3();<input type="text" name="<?php echo $object->Set_Billing_Address3();?>" id="BillingAddress3"/>Invalid Address3.
CitySet_Billing_City();<input type="text" name="<?php echo $object->Set_Billing_City();?>" id="BillingCity"/>Invalid City.
State or ProvinceSet_State_Province();<input type="text" name="<?php echo $object->Set_State_Province('billing');?>" id="BillingStateProvince"/>Invalid State Province.
Postal CodeSet_Billing_Postal_Code();<input type="text" name="<?php echo $object->Set_Billing_Postal_Code();?>" id="BillingPostalCode"/>Invalid Postal Code.
Country CodeSet_Country_Code();<input type="text" name="<?php echo $object->Set_Country_Code('billing',840);?>" id="BillingCountryCode"/>Invalid Country.

Shipping Address

Common namePHP FunctionExampleError Message
First NameSet_Shipping_First_Name();<input type="text" name="<?php echo $object->Set_Shipping_First_Name();?>" id="ShippingFirstName"/>Invalid Shipping First Name.
Middle InitialSet_Shipping_Middle_Initial();<input type="text" name="<?php echo $object->Set_Shipping_Middle_Initial();?>" id="ShippingMI"/>Invalid Shipping Middle Name.
Last nameSet_Shipping_Last_name();<input type="text" name="<?php echo $object->Set_Shipping_Last_name();?>" id="ShippingLastName"/>Invalid Shipping Last Name.
EmailSet_Shipping_Email();<input type="text" name="<?php echo $object->Set_Shipping_Email();?>" id="ShippingEmail"/>Invalid Shipping Email.
BillingPhoneSet_Shipping_Phone();<input type="text" name="<?php echo $object->Set_Shipping_Phone();?>" id="ShippingPhone"/>Invalid Shipping Phone Number.
Address1Set_Shipping_Address1();<input type="text" name="<?php echo $object->Set_Shipping_Address1();?>" id="ShippingAddress1"/>Invalid Shipping Address1.
Address2Set_Shipping_Address2();<input type="text" name="<?php echo $object->Set_Shipping_Address2();?>" id="ShippingAddress2"/>Invalid Shipping Address2.
Address3Set_Shipping_Address3();<input type="text" name="<?php echo $object->Set_Shipping_Address3();?>" id="ShippingAddress3"/>Invalid Shipping Address3.
CitySet_Shipping_City();<input type="text" name="<?php echo $object->Set_Shipping_City();?>" id="ShippingCity"/>Invalid Shipping City.
State or ProvinceSet_State_Province();<input type="text" name="<?php echo $object->Set_State_Province('shipping');?>" id="ShippingStateProvince"/>Invalid Shipping State Province.
Postal CodeSet_Shipping_Postal_Code();<input type="text" name="<?php echo $object->Set_Shipping_Postal_Code();?>" id="ShippingPostalCode"/>invalid Shipping Postal Code.
Country CodeSet_Country_Code();<input type="text" name="<?php echo $object->Set_Country_Code('shipping',840);?>" id="BillingCountryCode"/>Invalid Shipping Country.

Custom Questions

Top
Common namePHP FunctionExampleError Message
QuestionSet_Custom_Question($id,$question);Employer <?php echo $object->Set_Custom_Question(1,'Employer');?>
AnswerSet_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 namePHP FunctionExample
Item IDSet_ItemID($basket_id);<input type="hidden" name="<?php echo $object->Set_ItemID(1);?>" id="ItemID1" value="0"/>
Item NameSet_ItemName($basket_id);<input type="hidden" name="<?php echo $object->Set_ItemName(1);?>" id="ItemName1" value="Donation" />
QuantitySet_Quantity($basket_id);<input type="hidden" name="<?php echo $object->Set_Quantity(1);?>" id="Quantity1" value="1" />
Unit PriceSet_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 TaxSet_UnitTax($basket_id);<input type="hidden" name="<?php echo $object->Set_UnitTax(1);?>" id="UnitTax1" value="0"/>
Unit DiscountSet_UnitDiscount($basket_id);<input type="hidden" name="<?php echo $object->Set_UnitDiscount(1);?>" id="UnitDiscount1" value="0"/>
SKUSet_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 namePHP FunctionExample
MethodSet_ShippingMethod();Fed-Ex : <input type="hidden" name="<?php echo $object->Set_ShippingMethod();?>" id="ShippingMethod" value="Fed-Ex"/>
Fee and TaxSet_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 namePHP FunctionExample
WIDSet_Wid($wid);<?php echo $object->Set_Wid(8547);?>
Send ReceiptSet_SendReceipt($receipt);<?php echo $object->Set_SendReceipt('true');?>
Organization InformationSet_OrganizationInformation($organization_information)<?php echo $object->Set_OrganizationInformation('Text about Organization');?>
Thank You MessageSet_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 namePHP FunctionExample
Recurring TypeSet_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" />
PeriodicitySet_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');
  • CreditCard
  • eCheck

CreditCard

Common namePHP FunctionExampleError Message
Payment TypeSet_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 CardSet_NameOnCard();<input type="text" name="<?php echo $object->Set_NameOnCard();?>"/>Invalid Credit Card Name.
Card NumberSet_CardNumber();<input name="<?php echo $object->Set_CardNumber();?>" type="text" id="CardNumber" />Invalid Credit Card Number.
Cvv2Set_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 namePHP FunctionExampleError Message
Payment TypeSet_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 AccountSet_NameOnAccount();<input type="text" name="<?php echo $object->Set_NameOnAccount();?>"/>Invalid Name On Account.
Routing NumberSet_RoutingNumber();<input name="<?php echo $object->Set_RoutingNumber();?>" type="text" id="RoutingNumber" />Invalid Routing Number.
Account NumberSet_AccountNumber();<input type="text" name="<?php echo $object->Set_AccountNumber();?>" id="AccountNumber"/>Invalid Name On Account.
Account TypeSet_AccountType();<input type="text" name="<?php echo $object->Set_AccountType();?>" id="AccountType"/>Invalid Account Type.
Check TypeSet_CheckType();<input type="text" name="<?php echo $object->Set_CheckType();?>" id="CheckType"/>Invalid Check Type.
Check NumberSet_CheckNumber();<input type="text" name="<?php echo $object->Set_CheckNumber();?>" id="CheckNumber"/>Invalid Check Number.

Account Information

Top
Common namePHP FunctionExample
Guid* and Account ID*Set_Authentication($guid,$accountid);<?php echo $object->Set_Authentication('ddd31189-9a80-41d9-99e7-fdbb4350893c','14521');?>
AccountTokenSet_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 namePHP FunctionExampleError Message
Order ModeSet_Order_Mode($ordermode);<?php echo $object->Set_Order_Mode('Test');?>Invalid Order Mode Argument.
TrackerSet_Tracker($tracker);<?php echo $object->Set_Tracker('Campaign123');?>Invalid Tracker.
CampaignSet_Campaign_Name($campaign_name);<?php echo $object->Set_Campaign_Name('child fund');?>Invalid Campaign.



 RSS of this page