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.

Help with Custom / Success URL customization

Home Forums Community Forum Help with Custom / Success URL customization

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

Topic Author Topic
Posted: Tuesday May 28th, 2013 at 6:14 pm #50770

Okay, so I am reading the API integration documentation on the WP-Admin and on this website. Let me start by saying you guys are awesome and this plugin is extremely flexible and easy to learn because of the excellent documentation.

I am stuck on one final (hopefully) part of my integration with WP-Courseware, I hope i can say that…

Anyway, what I did is create a custom success page using the paypal pro form shortcode executed through a custom PHP template, which is all fine and dandy.

What I am trying to do is pass back my ccaps code in the URL so that it can be grabbed by the success page and then I can do some further processing that needs to take place after a successful purchase. The processing is a simple WPDB -> Insert function that automates some things that WP-Courseware would normally require be done manually. The only way to get some sort of “relationship” information so that I can grab the parts out of the correct tables would be the ccaps variable…Basically my ccaps variable is the course number that will always consist of a letter and 4-5 numbers, so when the client inserts the course number, they are inadvertently setting up restricted access to the courses…

Now correct me if I’m wrong, but wouldn’t the %%item_number%% tag be what I’m looking for?

This is what I had setup –

success="success-thank-you/?cid=%%item_number%%"

So when I go through the checkout process on Paypal Pro…everything goes great, access is given to the proper course but my function is not being executed because it needs to match the course ID with the ccap in order to run…this is basically a security measure? Maybe I don’t need it?

The URL that comes back is –

http://mydomain.com/success-thank-you/?cid=1%3Am5645&s2p-v=XXXX <–you get the point….there are a bunch of digits/numbers where the XXXX is….

ok, so if we look at the 1%3Am5645 – the only part of that string I need is the "m5645" – from reading the description of the item number special replacement code…the "1" is the capability but what is the "%3A"?

Can I write some php to strip out the 1% and then do a substr or something to remove to characters from the front? Will that format always be consistent like that? Basically 4 characters needing to be removed all the time? Or is there an easier way?

Just a little more background info – the function that I have created does two things, it grants access to the course automatically and also inserts the servers "current date" in m-d-Y format so we can track the "purchase date / course price / course id and user id" of each course, because the State that my client resides in requires this information be sent to them in an excel spreadsheet…

If I could get that ccapp string I would be so happy! Oh, and I'm grabbing it with $_GET['coursenumber'];

Thank you all for your time!

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Wednesday May 29th, 2013 at 8:47 am #50827
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

Can I write some php to strip out the 1% and then do a substr or something to remove to characters from the front? Will that format always be consistent like that? Basically 4 characters needing to be removed all the time? Or is there an easier way?

I believe you’re looking for urldecode.

See: http://php.net/manual/en/function.urldecode.php

Posted: Wednesday May 29th, 2013 at 3:38 pm #50867

Okay, so how would i apply that to my situation?

I’m not decoding anything as the information I need is in plain view…

This is the return URL that I am landing on after successful purchase –

http://mydomain.com/?cid=1%3Am748&s2p-v=13698XXXXXXXXXXXXXXXXXXXXXXXXX

the part I need (shown in bold) is here –

/?cid=1%3Am748&s2p-v=13698

The characters in italics ( 1%3A ) , I know the “1” is always going to be there because that’s the user level…but what about the percent sign, the number 3 and the letter A….what are those?

Posted: Wednesday May 29th, 2013 at 4:45 pm #50872

ok, so I figured it out…when I echoed the variable, it turns out that only “1:XXXXX” being captured so thats a good thing…because I did a substr and just removed the 1st two characters to get the information that I wanted…

I probably should have done that from the start, but didn’t think of it…

Posted: Thursday May 30th, 2013 at 12:37 am #50891

The characters in italics ( 1%3A ) , I know the “1″ is always going to be there because that’s the user level…but what about the percent sign, the number 3 and the letter A….what are those?

That’s the colon encoded for the URL:
http://mydomain.com/success-thank-you/?cid=1:m5645&s2p-v=XXXX

Viewing 4 replies - 1 through 4 (of 4 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.