Page 1 of 1

Rephrased API Question

PostPosted: May 28th, 2011, 4:31 pm
by sgtcory
I've read the documentation for the Paypal API and custom notifications. What I would like to know, is if I am missing something - because ideally I would like to keep what I am scripting "S2 Memberfied" vice using an external notification script or another plugin in to hook into.

Is there a hook that I can use to update custom fields on subscription payments?

Re: Rephrased API Question

PostPosted: May 28th, 2011, 5:03 pm
by Cristián Lávaque
Could you explain a little more what you want to do? By custom field you mean the custom attribute in the shortcode? You can use PHP to change add values dynamically to the shortcode, or do you mean editing s2Member's Profile Custom Fields?

Re: Rephrased API Question

PostPosted: May 28th, 2011, 5:18 pm
by sgtcory
Sure Christian -

I mean the actual database fields. What I was wondering is if there is a hook in the API notification (I have not dug too deep into the code yet), whereby I can :

- Hook into when a new - subsequent subscription payment is received. When this payment comes in, I will program in the hook to update my custom fields in the database directly.

On payment updates I wish to simply update my custom fields that I created in S2Member, and this seems like the logical way to keep it under S2 instead of adding an outside script.

Does that make sense?

Re: Rephrased API Question

PostPosted: May 28th, 2011, 6:01 pm
by Cristián Lávaque
You have the Payments Notification, which you can use to tell your script do what you make it do. WP Admin -> s2Member -> API / Notifications -> Payment Notifications

That said, you can try this file /wp-content/plugins/s2member/includes/classes/paypal-notify-in.inc.php and search for payment_notification.

I hope that helps.

By the way, thanks a lot for your help in the other threads, very appreciated. :)