Posted by pelicani on March 28, 2008 at 12:34am
4 followers
| Project: | Signup Pay for a node |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Issue Summary
Do we want to handle non-PayPal transactions in a special way?
The PayPal path provides a submit button to take the registrant to PayPal.
Check processing could display instructions for what to do when submitting a check.
i.e. address, contact info and specific check instructioins
Others could each have their own content.
Comments
#1
Good idea. Go for it.
Better yet, have it modular so that we can have pluggable payment methods for each type. e.g. signup_pay_paypal.inc, signup_pay_cheque.inc, ...etc. and people can extend this in any way they want, even credit card gateways if they wish ...
#2
I'm trying to get another co-worker (Josh Benner) involved based on other work for another client. He has a need for Authorize.net payment. To quote him, "Cool. I'd recommend that hook_signup_pay_types() accepts arrays of information, callbacks, etc. that define how to handle the different payment types. Statically cache the results of the hook, then have utility functions for the different data types... or even better, have the hook statically cache objects that encapsulate the functionality for each payment type."
#3
I'm starting to incorporate a signup_pay_invoke_payapi function.
In other modules, this api can be used to communicate with the signup pay module.
Is this an acceptable solution for incorporating other payment options?
Hooks and include files where both mentioned by separate people.
And here is an api, which seems to be the most drupal path, no?
Any feedback is appreciated.
#4
Can you post some skeleton code, or pseudo code on what your vision is for this hook?
It would help better visualize for me to understand and comment on.
#5
This is the payment function within the signup_pay module...
function signup_pay_do_payment() {
global $user;
$record = array();
// Get method and node, from session
$record['nid'] = $_SESSION['signup_pay_nid'];
$record['uid'] = $user->uid;
$record['method'] = $_SESSION['signup_pay_method'];
$record['mail'] = $_SESSION['signup_pay_anon_mail'] ? $_SESSION['signup_pay_anon_mail'] : $user->mail;
$record['phone'] = $_SESSION['signup_pay_phone'];
$record['name'] = $_SESSION['signup_pay_name'];
// TODO integrate in to payapi
if (signup_pay_check_payment($nid,$record['mail'])) {
drupal_set_message(t('You have already paid for this event.'));
return;
}
foreach (module_implements('payapi') as $module) {
if ('SIGNUP_PAY_METHOD_'.strtoupper(module_invoke($module, 'payapi', $record, 'display name')) == $record['method']) {
return module_invoke($module, 'payapi', $record, 'process');
}
}
//TODO watchdog message
return "failed";
}
#6
This is the api function within the individual payment option code...
function signup_pay_paypal_payapi($data, $op, $arg = '') {
switch ($op) {
case 'display name':
return t('Paypal');
case 'process':
return signup_pay_paypal_do_payment($data);
break;
}
}
#7
Web Developer : RockRiverStar.com : Philadelphia, PA
#8
Here is the rest of the code that handles the external modules...
one patch for the install file as well.
Please let me know what you think.
#9
Then if you have those, you will need the modules to actually process the payment option.
I've seen other modules have 'contrib' directories, but I didn't use that technique.
Attached are the files that belong in the signup_pay_paypal and signup_pay_cheque modules.
I had no idea how to submit these, as they are not a patch file.
Please let me know if this was correct, or how I should submit them.
Your help has been much appreciated.
#10
Here is a different approach.
The Payment API is a new module by Nedjo Rogers: http://drupal.org/project/payment_api
If we add the cheque and Paypal as payment methods to it, it would be useful to a whole lot of other modules that don't want ecommerce/ubercart yet want something more than just Paypal.
#11
nedjo has a project page up but zero code to download.
is there some place we can look at the code to see how it integrates. it appears that you may have access to it.
thanks
#12
the code can be downloaded directly from cvs.
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/payment_api/
I am worried about the lack of a dev version, at least, of this module.
But, will take a stab at changing the approach to include this module.
It is a great idea.
#13
What is the status of this development?