Question

Beanstream limits what's viewable and updatable via their web application. If for example, you want to update one of the custom reference fields, it is not possible at this time to do that via their website.

The only option is the API. Since there isn't a lot of beanstream related info on here, I thought I'd pass this solution on for anyone looking

Was it helpful?

Solution

Here's an example method, where the required fields are included in the Uri, then the optional ref2 field added with a textbox value. The response is returned as XML. You could do something with the XML if need be afterwards. In my case, I just displayed the xml in a label to check that it went thru ok.

Obviously, replace any values with XXXXXX in it, with your own.

    // formulate our request to the recurring billing api.
    string requestUri = "https://www.beanstream.com/scripts/recurring_billing.asp?merchantId=XXXXXXXXXX" +
                        "&serviceVersion=1.0" +
                        "&requestType=BACKEND" +
                        "&operationType=M" +
                        "&passCode=XXXXX - Look for this in the Order Settings page - XXXXXXXXXXXXXXX" +
                        "&rbAccountId=XXXXXX - This is the recurring account id. - XXXXXXXXX"  + 
                        "&ref2=" + Ref2TextBox.Text;

    WebRequest request = WebRequest.Create(requestUri);
    request.Method = "POST";
    request.ContentLength = 0;
    WebResponse response = request.GetResponse();
    Stream dataStream = response.GetResponseStream();
    StreamReader reader = new StreamReader(dataStream);
    string responseFromServer = reader.ReadToEnd();
    reader.Close();
    response.Close();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top