Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

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

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 656
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Need Help with Payment Service

Trying to do in-app purchase.  Testing dialog box comes up and I select a succes event.  The app goes into the handlePurchase()  slot but the reply is always 'not finished'.  Not sure what I am missing.  

 

void myapp::purchase() {
	//Request a purchase using the ID and SKU of the digital good.
	const PurchaseReply *reply = m_paymentManager->requestPurchase(
			"232925" , "");

	// Connect the finished() signal to a slot to handle the purchase.
	connect(reply, SIGNAL(finished()), SLOT(handlePurchase()));
}

void myapp::handlePurchase() {
	fprintf(stderr, "In Handle Purchase\n");

	bb::platform::PurchaseReply *reply = qobject_cast<
	bb::platform::PurchaseReply*>(sender());
	Q_ASSERT(reply);

	// Check to see if the request finished.
			if (reply->isFinished()) {

				// Emit an error signal if there were errors.
				if (reply->isError()) {

					fprintf(stderr, "Purchase Error\n");
					//   emit infoResponseError(reply->errorCode(), reply->errorText());

					//Emit a success signal if there were no errors.
				} else {

					fprintf(stderr, "Purchase Success\n");
					setFullVersion() ;
					//  const QString displayString = receiptToString(reply->receipt());

					//   emit purchaseResponseSuccess(displayString);
				}
			} else {
				fprintf(stderr, "REply not finished\n");
				qDebug() << "Purchase request did not finish.";
			}

			reply->deleteLater();
		}

 


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Highlighted
New Contributor
Posts: 3
Registered: ‎02-21-2013
My Device: Blackberry 8520
My Carrier: Mobistar

Re: Need Help with Payment Service