IS THERE ANY WAY TO CHARGE THE CUSTOMER WHILE CREATING A CUSTOMER ONLY ONCE, I.E. NON RECURRING.

jayasree's Avatar

jayasree

19 Dec, 2012 08:01 AM

I have created a plan with NON AUTO RECURSION(CUSTOM). Created a customer with that plan code, but still the customer is created as recurring , he has not been charged now and billing date is set afer one month. Customer code is [email blocked].

  1. 1 Posted by adam on 19 Dec, 2012 04:11 PM

    adam's Avatar

    Hi Jayasree,

    Is the goal to have a customer pay a one-time fee of $1.99 and then never be charged again, while retaining his payment information?

    If so, I'd recommend removing the charge from this plan and setting it to a Free plan.

    Then you can transact a one-time invoice for $1.99 against their payment method:
    https://cheddargetter.com/developers#one-time-invoice

    You can do that as many times as you like, if they want to purchase multiple items for $1.99 as well.

    -Adam

  2. Support Staff 2 Posted by Marc Guyer on 19 Dec, 2012 04:55 PM

    Marc Guyer's Avatar

    Hi jayasree -- What you've described is certainly odd. On a non-recurring plan, a customer shouldn't have a billingDatetime by default but it's possible to override that behavior. Can you tell me how you've created this customer? Was it via the API or GUI? Can you replicate this with a new customer?

  3. 3 Posted by jayasree on 20 Dec, 2012 04:42 AM

    jayasree's Avatar

    I have created the customers using .NET API
     
     
     
    For creating the customer, wanted to create the customer and charge 1.99 immediately, has set plan code no auto recursion(custom), but it is still treating it as monthly and the bill date is set to next month.

    urlbase :https://cheddargetter.com/xml
    urlpath : /customers/new/productCode/yupptv
    postparams : code=jayasreegarla%40gmail.com&firstName=jayasree&lastName=global&email=jayasreegarla%40gmail.com&company=&subscription[planCode]=ISHQPPV&subscription[ccFirstName]=jayasree&subscription[ccLastName]=global&subscription[ccNumber]=4741653000299018&subscription[ccExpiration]=08%2f2014&subscription[ccCardCode]=889&subscription[ccZip]=

    Update the customer with another plan i.e. love failure this plan is also set to no auto recursion(custom),and also set changebilldate to now, so that it will charged now.

    urlbase : https://cheddargetter.com/xml
    urlpath : /customers/edit/productCode/yupptv/code/[email blocked]
    postparams : firstName=jayasree&lastName=global&email=jayasreegarla%40gmail.com&company=&subscription[planCode]=LOVEFAILUREPPV&subscription[ccFirstName]=jayasree&subscription[ccLastName]=global&subscription[ccNumber]=4741653000299018&subscription[ccExpiration]=08%2f2014&subscription[ccCardCode]=889&subscription[ccZip]=&subscription[ChangeBillDate]=now
     
    but it is not charged now, only plancode has been changed from ishqppv to lovefailureppv.
     
    Thanks and Regards
     
    Jayasree

  4. 4 Posted by jayasree on 20 Dec, 2012 08:15 AM

    jayasree's Avatar

    Hello,
     
    The below parameters i have passed for creating a charge using one time invoice , but getting an error, how to rectify it.

    urlbase : https://cheddargetter.com/xml
    urlpath : /invoices/new/productCode/yupptv/code/[email blocked]
    postparams : charges[chargeCode]=123&charges[quantity]=1&charges[eachAmount]=1.99

    Error : 2879392 412 charges[chargeCode][invoicePeriod]:notInArray '1' was not found in the haystack
     
    Thanks and Regards
     
    Jayasree

  5. Support Staff 5 Posted by Marc Guyer on 20 Dec, 2012 07:24 PM

    Marc Guyer's Avatar

    I see what's wrong with your "no auto recursion(custom)" plans. They are properly set to no frequency but they're also set to initially bill 1month after signup. It seems that we have a bug there. I've fixed the config on those plans. We're researching the cause.

    The below parameters i have passed for creating a charge using one time invoice , but getting an error, how to rectify it.

    The charges must be a nested list:

    charges[0][chargeCode]=123&charges[0][quantity]=1&charges[0][eachAmount]=1.99
    
  6. 6 Posted by jayasree on 21 Dec, 2012 03:22 AM

    jayasree's Avatar

    Hello,

    The below parameters I have passed for creating a charge using one time invoice , but getting an error, how to rectify it.I have created a customer with a free plan. i.e. with charge amount to 0.

    urlbase : https://cheddargetter.com/xml
    urlpath : /invoices/new/productCode/yupptv/code/[email blocked]
    postparams : charges[chargeCode]=123&charges[quantity]=1&charges[eachAmount]=1.99

    Error : 2879392 412 charges[chargeCode][invoicePeriod]:notInArray '1' was not found in the haystack

     
    Thanks and Regards
     
    Jayasree

  7. 7 Posted by jayasree on 21 Dec, 2012 06:48 AM

    jayasree's Avatar

    Hello,
     
     
    I was able to charge the customer successfully. But while I am trying to refund I am getting error. Below are the details.
     
     
    urlBase : https://cheddargetter.com/xml
    urlPath : /invoices/new/productCode/yupptv/code/[email blocked]
    postParams : charges[0][chargeCode]=123&charges[0][quantity]=1&charges[0][eachAmount]=-2.99

    Error : 2882175 412 :0 Total amount must be greater than or equal to zero

    In the API it has been mentioned that Positive or negative integer or float with two digit decimal precision. A positive number will create a charge (debit). A negative number will create a credit.
    but still i am getting error. How to rectify it.
     
     
    Thanks and Regards
     
    Jayasree

  8. 8 Posted by jayasree on 21 Dec, 2012 10:28 AM

    jayasree's Avatar

    Hello,
     
     
    I have created another product yupptvcad in my developer account, so that I can charge the customers in cad currency. But I have not seen any setting where I can select the currency. How to set the currency as cad for the product yupptvcad.
     
    Regards
     
    Jayasree

  9. Support Staff 9 Posted by Marc Guyer on 21 Dec, 2012 01:34 PM

    Marc Guyer's Avatar

    Hi Jayasree --

    I was able to charge the customer successfully. But while I am trying to refund I am getting error.

    A one-time invoice cannot be used to issue a direct refund to a card. You can either refund an existing positive transaction or issue a credit on a recurring subscription to be settled on the next recurring invoice. Here's some more detail on the difference between credits and refunds (and voids): http://support.cheddargetter.com/kb/operational-how-tos/credits-and...

    I have created another product yupptvcad in my developer account, so that I can charge the customers in cad currency. But I have not seen any setting where I can select the currency. How to set the currency as cad for the product yupptvcad.

    I have set it to CAD for you.

  10. 10 Posted by jayasree on 24 Dec, 2012 05:59 AM

    jayasree's Avatar

    Hello,
     
     
    We are having payperview packages, where customer can watch movies by a paying one time (i.e. non recurring). As per your API I can use one time invoice to charge the customers. Which I could do successfully. But few times as per the customer request we will issue refunds also, Then how could we do refund by using your API. But you are telling that we cannot refund one time invoice, then what is the solution for it?
     
    Regards
     
    Jayasree

  11. Support Staff 11 Posted by Marc Guyer on 24 Dec, 2012 09:19 PM

    Marc Guyer's Avatar

    But you are telling that we cannot refund one time invoice, then what is the solution for it?

    You certainly can refund a one-time invoice:

    https://cheddargetter.com/developers#refund

  12. 12 Posted by jayasree on 26 Dec, 2012 10:15 AM

    jayasree's Avatar

    Hello,
     
    I have tried the refund as provided by you in the link, (i.e. invoices/refund), but I am getting the error id not found. I have passed the id as 'df222d40-4f3a-11e2-9d18-40403c39f8d9', Is this the correct id which I need to pass for refund. This was the only Id I got from your response , while creating customer with charge. I have got the same id in response while creating one time invoice also. what is the key in response , for what it is used , which I got while creating one time invoice.
     
    Thanks and Regards
     
    Jayasree

  13. Support Staff 13 Posted by Marc Guyer on 26 Dec, 2012 05:44 PM

    Marc Guyer's Avatar

    Hi Jayasree -- That is CheddarGetter's customer id. You almost never need to use any of CG's ids. You can pass the invoice number of the invoice you want to refund/void. Check out the interactive integration builder:

    http://unittest.cgdev.com/admin/setup/integration/cmd/issueVoidRefu...

  14. 14 Posted by jayasree on 27 Dec, 2012 11:49 AM

    jayasree's Avatar

    Hello,
     
     
    I have tried to refund using invoice number. It is successfully refunding but I am getting error in response.
     
    urlbase : https://cheddargetter.com/xml
    urlpath : /invoices/Refund/productCode/yupptvCAD/
    postParams : number=13&amount=-0.50

    The error I got is : The remote server returned an error: (401) Unauthorized.
     
    How to rectify it.
     
    Thanks and Regards
     
    Jayasree

  15. Support Staff 15 Posted by Marc Guyer on 27 Dec, 2012 05:42 PM

    Marc Guyer's Avatar

    Hi Jayasree -- It looks like your implementation is not sending the authentication params in the request but rather is waiting for the 401 response then subsequently sending the auth. This is a "correct" way to do it according to the HTTP spec but is inefficient. Most server-side HTTP libraries have a way to force auth on every request rather. Are you using one of the wrappers? If so, which one?

    Please try your refund request again and note the time. I'll take a close look at the logs with that information.

  16. 16 Posted by jayasree on 28 Dec, 2012 06:23 AM

    jayasree's Avatar

    Hello,
     
     
    I am using c# wrapper provided in your site. When I am creating a customer or invoice I am not getting any problem. But getting problem only with the refund. I am sending the code used to post a request. Authentication is added the request only.
     
     
    HttpWebRequest request = WebRequest.Create(urlBase + urlPath) as HttpWebRequest;

     //Add authentication
     request.Credentials = new NetworkCredential(_Username, _Password);

     //make into a post
     request.ContentType = "application/x-www-form-urlencoded";
     request.Method = "POST";

     byte[] bytes = Encoding.UTF8.GetBytes(postParams);
     request.ContentLength = bytes.Length;

     using (Stream requestStream = request.GetRequestStream())
     {
     requestStream.Write(bytes, 0, bytes.Length);

     using (WebResponse response = request.GetResponse())
     {
     using (StreamReader reader = new StreamReader(response.GetResponseStream()))
     {
     ds.ReadXml(reader);
     }
     }
     }
     
     
    Please tell me how to rectify it.
     
    Thanks and Regards
     
    Jayasree

  17. Support Staff 17 Posted by Marc Guyer on 28 Dec, 2012 09:34 PM

    Marc Guyer's Avatar

    Hi Jayasree -- The c# wrapper is provided by the community and we don't directly support it. We don't have any c# experience here so we would probably just get in the way. However, I suspect there is a solution.

    You might try this instead of the normal way of setting creds:

    string credentials = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes("user"+ ":" + "password"));
    request.Headers.Add("Authorization", "Basic " + credentials);
    

    More on this topic here:

    http://stackoverflow.com/questions/1702426/httpwebrequest-not-passi...
    http://stackoverflow.com/questions/179425/401-when-posting-using-ht...
    http://stackoverflow.com/questions/3307709/why-do-i-get-a-401-unaut...

    Please consider contributing any changes you make back to the trunk. Here's a quick how-to on that:

    https://help.github.com/articles/fork-a-repo

    Also, we don't have any record of making a recent attempt at the refund. We're unable to help further until you replicate the error you're experiencing.

  18. 18 Posted by jayasree on 31 Dec, 2012 08:22 AM

    jayasree's Avatar

    Hello,
     
     
    I have tried, what you have asked me to try, but still getting the same problem. One thing I could not understand is that, I did not get any error while creating a customer or one time invoice. Got the response properly. But getting error only with refund ,it is also refunding, but getting error only while getting response. I am using the same wrapper class for both creating and refunding.Please help me in rectifying this problem.
     
     
    Thanks and Regards
     
    Jayasree

  19. Support Staff 19 Posted by Marc Guyer on 31 Dec, 2012 01:09 PM

    Marc Guyer's Avatar

    Hi Jayasree -- I have replicated your issue and have found a solution. You are using path invoices/Refund instead of invoices/refund. Note the lowercase r. The lowercase option is what you want. Using the uppercase R results in a successful refund but a 302 redirect is returned instead of the expected 200. The wrapper correctly does not follow the redirect. Change to the lowercase r and you should see the expected result.

  20. 20 Posted by jayasree on 02 Jan, 2013 07:54 AM

    jayasree's Avatar

    Hello,
     
     
    I have changed the path to lowercase, and got the reponse. But in the response , you are sending all the details of customer. There is no clarity of the present transaction (i.e.transaction id,amount,currency ,success code etc ) in single table.
     
     
    Thanks and Regards
     
    Jayasree

  21. Support Staff 21 Posted by Marc Guyer on 02 Jan, 2013 08:37 PM

    Marc Guyer's Avatar

    Hi Jayasree -- If the response did not contain an error node, the transaction was successful. If you need to get the transaction info, you can get it from the response. I'm not sure if the c# wrapper has a convenience method for this. If it doesn't, perhaps you can add one. It is the first transaction in the first invoice in the first subscription within the response.

  22. 22 Posted by jayasree on 03 Jan, 2013 12:56 PM

    jayasree's Avatar

    Hello,
     
    I have checked the response, It is not the first `transaction` in the first `invoice` in the first `subscription` within the response , but it was the second `transaction` in the `invoice` in the first `subscription` within the response.
     
    Regards
     
    Jayasree

  23. Support Staff 23 Posted by Marc Guyer on 03 Jan, 2013 08:18 PM

    Marc Guyer's Avatar

    Sorry about the confusion. Sometimes I speak too soon. There is a convenience method in the PHP wrapper: CheddarGetter_Response::getCustomerLastTransaction(). Perhaps you could add something like it to the c# wrapper for everyone to use.

  24. 24 Posted by jayasree on 04 Jan, 2013 05:38 AM

    jayasree's Avatar

    Hello,
     
     
    For getcustomer url is https://cheddargetter.com/xml/customers/get. In a similar way if you provide me the url for getcustomerlasttransaction() , that will be helpful to me.
     
    Thanks and Regards
     
    Jayasree

  25. Support Staff 25 Posted by Marc Guyer on 04 Jan, 2013 03:47 PM

    Marc Guyer's Avatar

    Hi Jayasree -- There is no URL specifically for returning just the last transaction. The convenience method in the PHP wrapper I mentioned returns just the last transaction information from the full customers/get response. I imagine it would be trivial to add something similar to the c# wrapper.

  26. 26 Posted by jayasree on 15 Jan, 2013 11:47 AM

    jayasree's Avatar

    Hello,
     
     
    While refunding we need to use invoice number. Will the invoice number start from 0 for any account?. Invoice number will contain only numbers?.
     
     
    Thanks and Regards
     
    Jayasree

  27. Support Staff 27 Posted by Marc Guyer on 15 Jan, 2013 10:27 PM

    Marc Guyer's Avatar

    Invoice number is an unsigned integer and is sequential for a whole product. So, the invoice number cannot be duplicated within a product. The first invoice in a project is number 1.

  28. 28 Posted by jayasree on 18 Jan, 2013 09:02 AM

    jayasree's Avatar

    Hello,
     
     
    At present we are using paypal. For any customer we are maintaining only one recurring profile. Using paypal we can change the recurring amount directly , by specifying recurring amount and currency code. As we have many packages and customers can purchase any number of packages. So there will be many different recurring amounts for our customers.
     
    But using your API, I can not set directly recurring amount to customers, I have to use pricing plans, already we have more than 300 different recurring amounts set to our customers and that number goes on increasing. Then I need to create so many different plans. There is also no feature in your API to create pricing plan. Creating pricing plans has to be done manually. But for our need it is not possible for us to create pricing plan, becuase customer can purchase any number of packages at a time(so many permutations and combinations), so we cannot expect a fixed amount as pricing plan . Can you provide any feature to us where instead of pricing plans we can set recurring amount directly . So that we can implement your gateway for recurring also.
     
    Thanks and Regards
     
    Jayasree

  29. Support Staff 29 Posted by Marc Guyer on 18 Jan, 2013 02:33 PM

    Marc Guyer's Avatar

    This is what tracked items are for. Setup items for each of the different pieces of a package. You can define different pricing and item config on different plans. So, all of your different combinations are defined using pricing plans and item setup within the plans.

  30. 30 Posted by jayasree on 21 Jan, 2013 03:38 AM

    jayasree's Avatar

    Hello,
     
     
    Before also I have gone through it. But I could not understand how to use it. Our requirement is simple,
    When a customer purchases a package, there is no quantity (it is always 1) , no usage amount. We will set the recurring amount to 1st of every month and we will charge the customer in prorated basis till 1st (for example if customer purchases a package of price $9.99 on 20th then we will charge him prorated 9.99/31(no of days in month) * 12 and we will set his recurring amount to 9.99) .There are more than 100 packages . If the customer wants at a time he can purchase more than one package at a time. A customer after purchasing a package on 20th. On any other date he can again come and purchase another package (for example on 20/01/2012 he purchased 9.99 package then his recurring amount is set 9.99 later on 15/6/2012 he purchases one more package of cost 14.99 then his recurring amount will be changed and set (14.99+9.99) , and we will also charge him on prorated basis (14.99/31 * 16) .) . Can you please explain me how to use the link mentioned by you for our requirement. At present for one customer we are maintaining only one recurring profile.Our site is www.yupptv.com. Where we are selling channels.
     
     
    Thanks and Regards
     
    Jayasree

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM