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.

API Tracking on another site

Home Forums Community Forum API Tracking on another site

This topic contains 1 reply, has 2 voices. Last updated by  Bruce 4 years, 8 months ago.

Topic Author Topic
Posted: Thursday Apr 26th, 2012 at 11:36 am #11950

Hi,

We have 2 sites. The first is an s2member wordpress subscription website and the second is is an asp.net based database website. The asp.net manages a job board – users subscribe via s2member and we are managing the # of uploads allowed onto the ASP.net site via

We wanting to a postback URL when a pays for a subscription (credits added to user’s record on the asp.net site whenever user makes a purchase.) These credits manage the number of entries allowed by that user.

<script type="text/javascript">
// <![CDATA[
  var _zfUrl = "http://www.mywebsite.com/AddCredit.aspx";
// ]]>
</script>

<script type="text/javascript" charset="utf-8">
//  <![CDATA[
  try {
    var e = ZFERRAL.CallEvent;
    e.init(_zfUrl, {
    revenue      : '%%initial%%',            // NOTE: Enter the price of your product
    customerId   : '%%payer_email%%', // NOTE: (OPTIONAL) Enter ID of customer who completed the event
    uniqueId     : '%%subscr_id%%'   // NOTE: (OPTIONAL) Enter some unique ID for extra security
  });

  e.call();
} catch (err) {}
// ]]>
</script>

The asp.net page is not being called after the successfull payment. Any possible solution?

  • This topic was modified 4 years, 8 months ago by  Jeoffrey Purnell.
  • This topic was modified 4 years, 8 months ago by  Bruce.

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Apr 26th, 2012 at 12:27 pm #11959
Bruce
Username: Bruce
Staff Member

Hi Jeoffrey, thank-you for your inquiry!

ASP is not usually a language that comes up because WordPress itself uses PHP, however according to this page this should work:

In order to work something with this, you should be using the forms within s2Member -> API / Notifications. You will notice that these forms use URLs to pass data to other places, and will not accept code such as you have above. Therefore, you will need to set up your ASP file to handle PHP $_GET variables.

Therefore, the correct way to set this up would be to put something to this effect in your Payment Notifications within API / Notifications.

http://www.yoursite.com/AddCredit.aspx/?revenue=%%amount%%&customerId=%%payer_email%%&uniqueId=%%subscr_id%%

Notice that you must use %%amount%% instead of %%initial%% within Payment Notifications.

Within your ASP file, you can use code to this effect to grab these values:


<%
revenue= Request.querystring("revenue")
customerId= Request.querystring("customerId")
uniqueId=Request.querystring("uniqueId")

'continue your query here
%>

Also, something you may want to keep in mind here,

Because you’re passing variables from one server to another, it could be possible to exploit this process. Be especially careful if you’re giving away services based on this routine. s2Member uses security features in it’s IPN / PDT from PayPal and it’s other payment gateways to verify the information it’s given by $_POSTing the data back to the site. You may need to do something similar in this situation if you’re worried about the validity of the payments that are given to this URL.

The easiest way to do this would be to post the data to another ASP/PHP file on the server you have s2Member installed on and make sure that the arguments given to your ASP file are correct.

I have replaced your URL with ‘mywebsite.com’ to help keep others from knowing your direct link.

I hope all of that makes sense, and if you have any further questions on this subject, feel free to ask in this topic. I will try to help you out as best as possible.


Also, if you would rather $_POST the data, or have it be more secure through a POST routine, you can hack into the IPN process and either use fopen() or cUrl to POST data to your ASP page. You can find info on hacking s2Member’s processes here: http://www.s2member.com/kb/hacking-s2member/

Let me know how it goes.

Best Regards,

-Bruce

  • This reply was modified 4 years, 8 months ago by  Bruce.
Viewing 1 replies (of 1 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.