latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

PayPal completed browser message

Home Forums Community Forum PayPal completed browser message

Tagged: 

This topic contains 9 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 7 months ago.

Topic Author Topic
Posted: Sunday May 27th, 2012 at 12:16 am #14736
Marko
Username: mtomic

Hi,

When I complete a PayPal payment I get redirected back to my site, which is fine. I was wondering if there was a way to change the message that gets displayed in the browser after the payment is completed.

For example, the default message will say:
“Thank you. Your account has been approved.
— Please login.”

My question is, where does that message get set and how do I change it?

Thanks

  • This topic was modified 4 years, 7 months ago by  Marko.
  • This topic was modified 4 years, 7 months ago by  Marko.

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Sunday May 27th, 2012 at 6:40 am #14761

You can use the success attribute for the shortcode to show another page with a custom message:

[hilite path]Dashboard -› s2Member® -› PayPal® Buttons -› Shortcode Attributes -> success[/hilite]
[hilite path]Dashboard -› s2Member® -› PayPal® Pro Forms -› Custom Return URLs Upon Success[/hilite]

I hope that helps!

Posted: Sunday May 27th, 2012 at 6:51 am #14762
Marko
Username: mtomic

Thanks for your reply Cristian,

Ideally, I’d like to be able to only change the default message and let s2member do the rest under the hood. If that’s not possible, I’ll go with your option.

Marko

Posted: Sunday May 27th, 2012 at 5:43 pm #14771

Oh, s2Member will still do everything it has to do under the hood, and when it’s done it’ll redirect the person to the URL you specified in the [hilite mono]success[/hilite] attribute. :)

Posted: Sunday May 27th, 2012 at 6:26 pm #14776
Marko
Username: mtomic

Awesome. Thanks for the tip!

Posted: Sunday May 27th, 2012 at 7:12 pm #14778

:)

Posted: Sunday May 27th, 2012 at 9:12 pm #14786
Paul Foster
Username: PAFoster

Hi There, on a related issue, I too have the return from paypal. This is for a specific page access, there is no membership involed and no user created. The visitor clicks a buy button.

PayPal returns the PDT info and s2Member deals with this under the hood. I can set a success url, but I need those PDT variables as listed in the section regarding sending them to another url as well if I want.

Either I use default-return.php and user clicks continue to go to the locked page, or I use success=”http”//…”
I’m not understanding the success url though. I set it to be the url of the protected page, but since it is protected, and the user is not logged in (they will never have an account anyway) s2member redirects to the members options page.

I think I see now the success=”http://..” as being a simple thank you page, which is not what I want

The restricted page has a form on it. The vistor who has paid for access to that page will then enter two pieces of information allowing us to complete their order.

I need the PDT info as well, so it can be put into the form as prefilled data – name, paypal email etc and also hidden data, tractaion data etc. The buyer can then change the email if neccessary, enter the other requested inform and send, thus being redirected to a thank you page, and the data being put in to a databse ready for us to extract and fullfill the service ordered.

I used %%variable%% etc in the form, but it just printed that, rather than the data. I have used this free plugin before (Formbuilder) using the s2Member short codes for name email etc and it has worked brillanty for that.

My only current option as I see it now is to create a form with all those feilds, and then have the customer cut an paste that data from their specific page acess email -data I can easily put into the email using the %%variables%%.

Obviously, thats seems a totally silly way to do it.

Any ideas?

Also, no luck creating my own paypal-return.php with in wordpress theme – could do with an example if its been done by anybody – ie the page will be something akin to: &get_header(); s2Member stuff &get_footer; etc.

I get the page, but no s2member data in it.

Ideally i would like to do achieve the following:

buy button–>paypal–>paypal-return.php–>restricted page on which is a form using the %%variables%%

Any help appreciated, I’ve been going in circles trying different things, but no luck.

Thank you!

Posted: Sunday May 27th, 2012 at 11:34 pm #14798
Marko
Username: mtomic

You can store PayPal order info in the DB by using s2member hooks and filters. I’d say you’d probably want to hook one of PayPal IPN scripts (depending on your PayPal transaction type) and capture some of that info.

Then you should be able to retrieve and pre-populate your form with data.

Obviously, the key is to hook into the right method – i.e. before, during or after the payment is complete.

Posted: Monday May 28th, 2012 at 5:06 am #14800
Paul Foster
Username: PAFoster

Thanks @Marco

http://www.s2member.com/codex/stable/source/s2member/includes/classes/paypal-return-in.inc.php/#src_doc_line_183

I think I see from here that s2Member gets the paypal return data I need, and deals with it ‘under the hood’.

eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action ("ws_plugin__s2member_after_paypal_return", get_defined_vars ());
unset ($__refs, $__v); /* Unset defined __refs, __v. */

Am I to assume that

get_defined_vars ();

will return an array of the PDT? So in a page template that is the url of success=http://www.mysite.com/complete-order/ I can use

get_defined_vars ();

to get that data into the page, to then use in a form?

Any help appreciated, I understand some php, but am not a ‘coder’, lol. ;)

Posted: Thursday May 31st, 2012 at 6:15 am #15021

s2Member does the get_defined_vars thing to provide the hook with all the vars available, for your use in the customization if you need it.

You can do something like this to see what vars you have at the point of that hook:

[hilite pre_code]

[/hilite]

Then find the var you need and use it in your hack.

I hope that helps. :)

Viewing 9 replies - 1 through 9 (of 9 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.