PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

PayPal Pro Form and Hooks

s2Member Plugin. A Membership plugin for WordPress®.

PayPal Pro Form and Hooks

Postby mweichert » February 4th, 2011, 10:34 am

Hi,

I've created my own template for the paypal pro checkout form, moving the first name and last name fields to the "Billing Details" section. Reason being, for users that choose Express Checkout, I want to use their PayPal first name and last name rather than having to have them supply it.

Here was my plan:
1) When the PayPal form is submitted, check if a first name and last name are present in $_POST. If not, set them to 'Foo' and 'Bar'. I was able to do this by using the 'init' hook that Wordpress provides.

2) When the user returns to the form from Express Checkout, $_GET["s2member_paypal_xco"] and $_GET["token"] are both set. Issue an API call to GetExpressCheckoutDetails to get the buyer information, and update the user object in Wordpress with the PayPal first name and last name.

However, I can't do this because there's no possible hook to use. In the ws_plugin__s2member_pro_paypal_checkout() function, there needs to be a do_action() call at the start of each scenario:
- PayPal® Pro w/ Express Checkout. We need to perform a call to SetExpressCheckout and redirect to PayPal® Express Checkout.
- PayPal® Pro w/recurring profiles. The User/Member is logged in. We'll be updating their account.
- PayPal® Pro w/recurring profiles. The User/Member is NOT logged in. We'll be creating a new account.
- PayPal® Pro w/o recurring profiles. ( aka: Buy Now ) The User/Member is logged in. We'll be updating their account.
- PayPal® Pro w/o recurring profiles. ( aka: Buy Now ) The User/Member is NOT logged in. We'll be creating a new account.
- Else, we have an unknown scenario.

This would open up a lot of possibilities for customizations. The s2Member plugin has a lot of hooks to work with, but the s2Member Pro plugin has very few. I would love that to improve. Utlimately, IMO, it's what differentiates s2Member from all of the other membership plugins.

Thanks,
Mike
User avatar
mweichert
Registered User
Registered User
 
Posts: 10
Joined: January 31, 2011

Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 3 guests

cron