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 –
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! |