Community Support Forums — WordPress® ( Users Helping Users ) — 2011-04-22T21:34:12-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=6156 2011-04-22T21:34:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13197#p13197 <![CDATA[Re: Ashop Intergration to S2member]]>

Statistics: Posted by Cristián Lávaque — April 22nd, 2011, 9:34 pm


]]>
2011-04-22T21:16:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13196#p13196 <![CDATA[Re: Ashop Intergration to S2member]]> Statistics: Posted by ashopsoftware — April 22nd, 2011, 9:16 pm


]]>
2011-04-22T20:57:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13195#p13195 <![CDATA[Re: Ashop Intergration to S2member]]>
Anyway, I read about the new proxy key IPN feature and have been trying to make that one work. According to my logs, my own custom IPNs have been accepted by my s2member and I got a confirmation email for the first one I sent, but it had this text:

Complete your registration here:
Error#www.domain.com

(where "www.domain.com" actually was the domain I run my test installation on) instead of a proper registration link. Subsequent tries with different customer details have not generated any confirmation emails at all, though the IPN log still tells me that it should have been sent. It has a message about the registration being added to a Transient Queue. Could this queue have been messed up somehow? Where do I look for it in the database so I can reset it and start over fresh? What am I missing that causes the registration link in the confirmation to become that "Error#" text?

Best regards,
Andreas Rimheden
Lead developer of AShop

Statistics: Posted by ashopsoftware — April 22nd, 2011, 8:57 pm


]]>
2011-04-22T14:58:06-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13166#p13166 <![CDATA[Re: Ashop Intergration to S2member]]>

Statistics: Posted by Cristián Lávaque — April 22nd, 2011, 2:58 pm


]]>
2011-04-22T13:51:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13160#p13160 <![CDATA[Re: Ashop Intergration to S2member]]> "I am looking into using their new IPN Proxy Key feature instead to integrate with AShop. This should make it much cleaner and easier to use and will hopefully be kept in future versions of s2member as well."

Statistics: Posted by gregtampa — April 22nd, 2011, 1:51 pm


]]>
2011-04-22T13:42:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13159#p13159 <![CDATA[Re: Ashop Intergration to S2member]]>
Code:
"s2member\includes\classes\register-access.inc.php"(22,15):            Generates registration links.
"s2member\includes\classes\register-in.inc.php"(22,13):            Handles registration links.
"s2member\includes\classes\register.inc.php"(22,13):            Handles registration links.


Tell them about that, maybe that's what they want.

Let me know if that helps. :)

Statistics: Posted by Cristián Lávaque — April 22nd, 2011, 1:42 pm


]]>
2011-04-22T10:35:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13148#p13148 <![CDATA[Re: Ashop Intergration to S2member]]> here is the email that they sent me

"Hi,
It appears that the function to generate registration links, which is required for the AShop integration, has been completely removed in newer versions of s2member. The version that was used for the AShop integration is 3.2.7. Using later versions will not currently work.

I will check with Primo Themes (the makers of s2member) if they have added a new way to do this to their software and try to get it running in AShop as soon as possible.

Thank you for bringing this to my attention!

Best regards,
Andreas Rimheden
www.ashopsoftware.com
"

Statistics: Posted by gregtampa — April 22nd, 2011, 10:35 am


]]>
2011-04-21T14:19:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13104#p13104 <![CDATA[Re: Ashop Intergration to S2member]]>

By the way, the latest release of s2Member is 3.5.8. https://wordpress.org/extend/plugins/s2 ... changelog/

Statistics: Posted by Cristián Lávaque — April 21st, 2011, 2:19 pm


]]>
2011-04-21T14:01:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13102#p13102 <![CDATA[Re: Ashop Intergration to S2member]]> I will try to figure out whats going on code behind and provide a solution if the original developers of ashop can not. I will post a link to this thread on there forums.

Statistics: Posted by gregtampa — April 21st, 2011, 2:01 pm


]]>
2011-04-21T13:49:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13100#p13100 <![CDATA[Re: Ashop Intergration to S2member]]>

I'm not familiar with Ashop, but I suggest you contact the developer that originally wrote that code you posted, so he updates it to work with the latest s2Member. Where was it posted originally? Tell him he can post in this thread if he has questions he'd like help with.

Statistics: Posted by Cristián Lávaque — April 21st, 2011, 1:49 pm


]]>
2011-04-21T13:02:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6156&p=13094#p13094 <![CDATA[Ashop Intergration to S2member]]> It appears that the function to generate registration links, which is required for the AShop integration, has been completely removed in newer versions of s2member. The version that was used for the AShop integration is 3.2.7. Using later versions will not currently work.


Below is the step by step guide on integrating with Ashop:

2.26.10 S2Member
The free s2member plugin for Wordpress can be used to run a membership site where some content is
only available to paying members. You can configure 4 different levels of memberships to give access to
different parts of your website depending on what type of membership your customers have bought.
AShop can be used to sell access to multiple s2member sites through the s2member fulfilment module.
Prepare the Wordpress site
First of all you need to install the s2member plugin on your Wordpress site and configure it. How to do
this is explained in the s2member documentation. Next, you need to prepare your Wordpress theme to
Installation & Setup make it accept calls from your AShop to register members. Inside the functions.php file for your Wordpress theme, insert a code like this:

Code:
/* AShop remote registration payment */
add_action("init", "make_registrationlink");
function make_registrationlink(){
    $secretkey = "myownsecrectkey";
    if($_GET["make_registrationlink"]){
        $subscr_id = $_GET["orderid"];
        $custom = $_SERVER["HTTP_HOST"];
        $item_number = $_GET["item"];
        $reg = $_GET["reg"];
        $checkreg = md5($subscr_id.$item_number.$secretkey);
        if ($checkreg == $reg) {
            $link = ws_plugin__s2member_register_link_gen ($subscr_id, $custom,
            $item_number, TRUE);
            echo "<!-- StartAShopS2Member-$link-EndAShopS2Member -->";
            exit;
        }
    }
}
 



Make sure to change the $secretkey variable to your own personal key for this site.
Prepare your AShop
1. Add a fulfilment option on the page Configuration->Fulfilment in your AShop admin panel. Use the
S2Member Registration method.
2. Set the URL field to the URL of your s2member site.
3. Set the Password field to the value of your $secretkey, which you previously added to the functions.
php page of your s2member site.
4. Create or locate a product on the Edit Catalog page and click Attributes.
5. Add an attribute for the membership level, for example labeled "Level". If you want this to be customer
selectable so your customers can buy different membership levels through the same product, add 4
alternatives, otherwise add just 1.
6. Set the attribute alternative(s) to the s2member membership level(s), for example "1" or "4".
7. Click the Fulfilment button for the product you just prepared and select the s2member fulfilment option
you created previously.
8. Set the name of the level attribute to: level
Note: The name of the attribute on the fulfilment configuration page is case sensitive and must be
exactly "level", not "Level" or "LEVEL" or "membershiplevel".
Now your customers will be given a temporary link that allows them to sign up at your s2member site
when they buy
the product. It will be included in the receipt that is emailed to the customer after successful payment.
By setting up
multiple fulfilment options and/or products you can sell different membership levels or even memberships
at different s2member sites.


----------------------------------------------

here is the code for s2member.ff from ashop/admin/fulfilment

Code:
<?php
// S2Member Registration...
$fulfilmentname = "S2Member Registration";
   
$ff_parameters
['fulfilemail'] = "false";
$ff_parameters['fulfilmessage'] = "false";
$ff_parameters['userid'] = "false";
$ff_parameters['password'] = "true";
$ff_parameters['url'] = "true";
$ff_parameters['parameternames'] = "false";
$ff_parameters['extrafields'] = "false";
$ff_parameters['returnresult'] = "true";
$ff_parameters['discount'] = "false";
$ff_parameters['ecardimage'] = "false";
$ff_parameters['ecardfont'] = "false";
$ff_parameters['ecardtextcolor'] = "false";
$ff_parameters['ecardtexttop'] = "false";
$ff_parameters['ecardtextleft'] = "false";
$ff_parameters['ecardtextright'] = "false";

$ff_prodparameters['productid'] = "false";
$ff_prodparameters['productidlist'] = "false";
$ff_prodparameters['labelnumber'] = "false";
$ff_prodparameters['packagenumber'] = "false";
$ff_prodparameters['parameternames'] = "true";

if ($dofulfilment) {
    $returnmessages["$fulfilmentoptionid"] = "";
    if($productsinfo) foreach($productsinfo as $productnumber => $productinfo) {
        $quantity = $productinfo["quantity"];
        $paramquerystring = $productinfo["ffparamquerystring"];
        $paramarray = explode("&",$paramquerystring);
        if (!empty($paramarray) && is_array($paramarray)) foreach ($paramarray as $thisparameter) {
            $thisparameterarray = explode("=",$thisparameter);
            if ($thisparameterarray[0] == "level") $s2member_level = $thisparameterarray[1];
        }

        $s2member_reg = md5($parsed_invoice.$s2member_level.$fulfilmentpassword);
        $s2member_data = "make_registrationlink=1&orderid=$parsed_invoice&item=$s2member_level&reg=$s2member_reg";

        if (!empty($parsed_invoice) && !empty($s2member_level) && !empty($fulfilmenturl) && !empty($fulfilmentpassword)) {
            for ($item = 0; $item < $quantity; $item++) {
                $ch = curl_init ($fulfilmenturl);
                curl_setopt ($ch, CURLOPT_POST, true);
                curl_setopt ($ch, CURLOPT_POSTFIELDS, $s2member_data);
                curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
                $res = curl_exec ($ch);

                // Process return value...
                $res = explode("<!-- StartAShopS2Member-",$res);
                $res = explode("-EndAShopS2Member -->",$res[1]);
                $registrationurl = $res[0];

                // Check the result...
                if (!empty($registrationurl) && (strstr($registrationurl,"http://tinyurl.com") || strstr($registrationurl,$s2memberurl))) {
                    // Return message with URL...
                    if ($receiptformat == "html") $returnmessages["$fulfilmentoptionid"] .= "<tr><td colspan=\"2\"><table width=\"100%\" cellpadding=\"5\"><tr><td bgcolor=\"#ffffff\" align=\"left\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><a href=\"$registrationurl\">Click here</a> to activate your membership at: $fulfilmenturl</font></td></tr></table></td></tr>";
                    else $returnmessages["$fulfilmentoptionid"] .= "
                    Go to: $registrationurl to activate your membership.
                    "
;
                } else $returnmessages["$fulfilmentoptionid"] .= "The membership signup was unsuccessful! Call the shop owner to get your membership activated manually.";
            } 
        
} else $returnmessages["$fulfilmentoptionid"] .= "The membership signup was unsuccessful! Call the shop owner to get your membership activated manually.";
    }
}
?>



Any assistance in making a new method on doing this would be awesome!

Statistics: Posted by gregtampa — April 21st, 2011, 1:02 pm


]]>