Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums on April 1st. BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
01-10-2012 03:41 PM
I just read the "Selling Digital Goods" recipe on the Blackberry Native SDK documentation website. I have one question. The code allocates memory for a purchase_params_t by calling malloc(). But there is no free() call anywhere in the sample code. Is the memory freed automatically by paymentservice_purchase()? Or is it the responsibility of the programmer to call free() (and the sample code just doesn't show it) ? Must purchase_params_t be allocated on the heap? Or can it go on the stack?
Thanks in advance!
01-10-2012 04:05 PM - edited 01-10-2012 04:07 PM
One more thing... the API reference shows the paymentservice_purchase() function as:
int paymentservice_purchase(purchase_params_t params, const char *group_id)
It looks like it takes a copy of a purchase_params_t object. But the sample code shows it as taking a pointer... I'm confused...
"Selling Digital Goods" Recipe link: https://bdsc.webapps.blackberry.com/native/documen
paymentservice_purchase() API Reference link: https://bdsc.webapps.blackberry.com/native/referen
01-10-2012 04:49 PM
@Blackberry/RIM, can you please update the sample code in the aforementioned recipe? It is showing incorrect usage of the payment API.
Thanks in advance.
01-11-2012 09:20 AM
01-11-2012 10:40 AM
Thanks for your reply. I've logged this into the Issue Tracker. If anyone wants to track its progress, you can find the issue here: