In order to implement another payment processor other than PayPal, there are a couple of things that have to be implemented:
1) Performing the steps required by the payment processor to process a transaction. This varies from processor to processor and from the perspective of the personal fundraiser plugin you need to provide something on the cause that somehow links to the payment processing screens. The PayPal implementation does this by using PayPal’s donation buttons.
2) Recording the details of the transaction within the personal fundraiser plugin. There are several ways to do this, the easiest is to return the user to the campaign url with the following parameters passed along:
g
: — a timestamp generated from calling the php function time()
n
: — a wordpress nonce created using wp_create_nonce( 'pfund-donate-campaign'.$post->ID.$gentime)
— where $post->ID is the post_id of the campaign and gentime is the value from g above.
pfund_action
: this should be the value ‘donate-campaign’. This tells the plugin that a donation has been received.
t
: — A value that indicates what kind of transaction is being processed. This can be any value except ‘pp’ and ‘ipn’ which are currently used for PayPal.
You also need to create a function that fires on the ‘pfund_transaction_array’ filter. This function would be where you would map values from your payment processor to values that the personal fundraiser plugin uses. To see an example of this, you can see in /includes/user.php that the function _pfund_process_donate function calls pfund_process_paypal_pdt in /includes/paypalfunctions.php in order to process PayPal transactions. That function then calls _pfund_map_paypal_fields in the same file to translate paypal values to personal fundraiser values.
The following values are needed by the personal fundraiser plugin to record a transaction:
amount
— Amount of donation
donor_first_name
— First name of donor
donor_last_name
— Last_name of donor
donor_email
— Donor email address
anonymous
— boolean value to indicate if transaction was an anonymous transaction.
I hope that makes sense. Let me know if you have any questions.