Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Payments and Payment Gateway / APIs /

This is a forum for discussing SilverStripe can-do payments and their APIs / Gateways.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

members, paypal subscriptions and IPN


Go to End


6 Posts   4451 Views

Avatar
CHD

Community Member, 219 Posts

29 July 2011 at 12:43pm

evening all,

im currently working on a "listing" style website.
users will be able to sign up and list their holiday homes/properties similar to what you see here: http://www.ownersdirect.co.uk/brazil-north-east-2bed.htm

ideally, i plan to have users create a profile on my site, then subscribe with paypal to "publish" their listing.
so far I have installed the "memberprofiles" module which i THIK will work fine. I will just add lots more fields to the members page, and a has_many for all of the property images.

paypals subscription/recurring payments seems easy enough, i just need to tweak it all a little to get it working.

basically i wondered if anybody has any experience at all with this? will the memberprofiles module be suffice? what about if my users have more than 1 property? will they have to create a profile for each one? (thats not ideal!)

also, i was thinking of just listing the "profiles" in a loop on the front end to browse the property listings, and have the IPN write to the database with either a 0 or 1 for paid or unpaid, with an IF statement in the loop which queries the database, to ensure only paid listings are displayed.

i have NO experience at all with subscriptions, or the best way to deal with listings like this, is any of the above feasible or am i way off the mark here for how this should be done....

thanks in advance for any help you can share!

Avatar
CHD

Community Member, 219 Posts

7 August 2011 at 7:07am

nobody can help then? :(

to update, I have the paypal subscription working fine now. when a user pays, paypal send the IPN and it all writes to the database fine.
however, how do i query that database when listing the properties in the front end?
it needs to lookup the table, and check the payment status, if its failed then the product/property should be marked as offline and not be listed on the site, it its all paid OK then it should be marked as live and be online...

can anybody help with this part?

Avatar
MarcusDalgren

Community Member, 288 Posts

7 August 2011 at 7:58am

What are you storing the data as? Are you storing it as a data object linked to a member profile? In that case just show that in the template. As for the listings just add them as a has_many-relationship to the member profiles if you haven't already.

Avatar
CHD

Community Member, 219 Posts

7 August 2011 at 8:00am

well, currently paypal is just writing the data to a table called "payments" it adds the username, email address and payment status etc.
i need to find the best way to lookup the payment status when displaying the listings in the front end...

can you point me in the right direction or how to setup the has_many correctly?
thanks a lot!

Avatar
MarcusDalgren

Community Member, 288 Posts

7 August 2011 at 8:06am

Umm yes and no. If you don't know how to setup a has_many-relationship then you really need to read the basic tutorials, they cover all of this. They're available here: http://doc.silverstripe.org/sapphire/en/. Pay special attention to chapter 5 about relationships. What you want to do is either add the paypal stuff directly to the member profile or add that as a has_one so that the paypal info gets connected to a member.

I really recommend that you let them register on your site first and then sending them to paypal so you know who they are when you get the IPN data from paypal.

Avatar
CHD

Community Member, 219 Posts

7 August 2011 at 8:09am

cool thanks.
yeah currently they register on my site, then use a paypal button to subscribe.
the button grabs their username and passes it though to the payment process.

i'll have good look at the tutorials on relationships then. thanks again.