How does the refund tag look like in the ClickBank API in this example

Discussion in 'ClickBank' started by Clicking, Mar 16, 2011.

  1. #1
    Hi,

    I have succeded to retreive the information from a TEST purchase through the API.
    The information I got looks like below.

    If this person does a refund of this product, I beleive that an additional refund tag should be avaliable then?

    If that is true, exactly how does this look like. It is impossible to find this information anywhere. I have googled for 12 hours.

    
    <orderData xmlns:cb="http://www.clickbank.com/api">
    <date>2011-03-14T08:23:03-07:00</date>
    <receipt>6RBJRLEH</receipt>
    <promo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <pmtType>TEST</pmtType>
    <txnType>TEST_SALE</txnType>
    <item>1</item>
    <amount>84.63</amount>
    <site>USERNAME</site>
    <affi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <country>SE</country>
    <state xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <lastName>NAME2</lastName>
    <firstName>NAME1</firstName>
    <currency>SEK</currency>
    <email>email@hotmail.com</email>
    <zip>11129</zip>
    <rebillAmount xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <processedPayments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <futurePayments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <nextPaymentDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <status xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    <accountAmount>57.22</accountAmount>
    <role>VENDOR</role>
    <customerDisplayName>Peter Andersson</customerDisplayName>
    </orderData>
    
    Code (markup):

     
    Clicking, Mar 16, 2011 IP
  2. Clicking

    Clicking Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does anyone know how the refund tag look like. It is impossible to find anywhere on google.

    I have sent an email to the support of Clickbank but haven´t got any answer for 2 days. I wonder if they even answer this question?
     
    Clicking, Mar 17, 2011 IP
  3. floodrod

    floodrod Well-Known Member

    Messages:
    829
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    135
    #3
    floodrod, Mar 17, 2011 IP
  4. Clicking

    Clicking Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am happy for your reponse. I do have very good programming skills so I will be able to extract the RFND, CHBK etc from the querystring they send.

    But there is one thing I dont understand. They say that you will put an URL where they send FORM parameters. I dont really understand how this works
    in practic?

    "ClickBank posts FORM parameters to a URL you specify"

    Will I specify a folder on my website like below for instance and they will send files to this folder. I am not sure how they send and in what format?
    If my website is this: mywebsite.com/parameters
     
    Clicking, Mar 18, 2011 IP
  5. floodrod

    floodrod Well-Known Member

    Messages:
    829
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    135
    #5
    floodrod, Mar 18, 2011 IP
  6. Clicking

    Clicking Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks floodrod, (I do use C# to mention)

    I have enabled this service now. But still there is no real information what this is that I have to specify. I dont understand what kind of URL this is:?

    Instant Notification URL 1:

    Is it an URL on my server, a file that I must create on my server, or an URL somewhere else?

    I beleive I need a litte real time example of what this URL is. As I did understand this URL does contain all the parameters needed that I am able to extract.
    Then I wonder, if I have 50 customers and one of the is doing a refund, how is it possible for me to know which customer this is, from just one URL?
    I know I can match the email together with the RFND variable. But all 50 customers in one URL. I dont know how it looks like and are delivered exactly?

    I beleive I haven´t seen any realtime example of how this is forward and how this looks like in order to continue from here.
    I will be very happy for any help.
     
    Last edited: Mar 18, 2011
    Clicking, Mar 18, 2011 IP
  7. floodrod

    floodrod Well-Known Member

    Messages:
    829
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    135
    #7
     
    floodrod, Mar 18, 2011 IP
  8. Clicking

    Clicking Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks floodrod.. Now I do understand the procedure.. I have set up an .aspx page with its .cs file. which then is: mysite.com/Listener.aspx

    I am sure there is just 1 to 3 lines missing from this code to see if ipnValid == true from the request. But I dont know how to use the function in the Page_Load.
    Clickbank does not respond on this type of question so I get really frustrated how to understand how to check if ipnValid is true from the HttpRequest request?

    All other logic after this, I will have no problem to implement. If you have any idéas of how to do this, please let me know. I am checking here all the time. Thanks :)

    
        using System.Security.Cryptography;  
        using System.Text;  
      
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if( ipnValid == true )  
            {  
                //Do stuff ??  
            }  
        }  
      
        public static bool ipnValid(HttpRequest request)  
        {  
      
            string secretKey = "YOUR SECRET KEY";  
            List<String> ipnFields = new List<String>();  
      
            foreach (string param in request.Form.Keys)  
            {  
                if (param.Equals("cverify"))  
                {  
                    continue;  
                }  
                ipnFields.Add(param);  
            }  
            ipnFields.Sort();  
      
            string pop = "";  
            foreach (String field in ipnFields)  
            {  
                pop += request.Form.Get(field) + "|";  
            }  
            pop += secretKey;  
            string cverify = request.Form.Get("cverify");  
            byte[] hashedData = new SHA1Managed().ComputeHash(Encoding.UTF8.GetBytes(pop));  
            string calced_verification = BitConverter.ToString(hashedData).Replace("-", "").ToUpper().Substring(0, 8);  
            return calced_verification.Equals(cverify);  
        } 
    
    Code (markup):
     
    Clicking, Mar 19, 2011 IP
  9. Clicking

    Clicking Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I managed to fix this and got a positive response from clickbank during a test. In my page_load:

    
       protected void Page_Load(object sender, EventArgs e)
        {
            HttpRequest request = HttpContext.Current.Request;
            if (Response.StatusCode != 200)
            {
                Response.Write("There was a problem accessing the web resource" +
                    "<br />" + Response.StatusDescription);
            }
    
    
            //Here check if ipnValid is true
            bool IsThisTrue = ipnValid(request);
    
            if (IsThisTrue == true)
            {
                Response.Write("This is Okay!");
            }
            if (IsThisTrue == false)
            {
                Response.Write("This is not Okay!");
            }
    }
            
    
    Code (markup):
     
    Clicking, Mar 20, 2011 IP