Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Qt on BlackBerry and QNX
  4. Payment Service with Qt
Forum Updated to NodeBB v4.3 + New Features

Payment Service with Qt

Scheduled Pinned Locked Moved Qt on BlackBerry and QNX
2 Posts 1 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daliusd
    wrote on last edited by
    #1

    Hi,

    Has anyone managed to use payment service with Qt? I have managed to show payment dialog but it looks like disabled (see image). In paymentservice_purchase_request I have tried using window group id from QApplication::topLevelWidgets().first() (there is only in QtQuick app), tried creating separate window (basically copy-pasted setup_screen() from https://github.com/blackberry/NDK-Samples/blob/next/PaymentService/main.c) and it still looks disabled.

    What disables that dialog?

    !http://i.imgur.com/wJ0Zq.png!

    Maybe I shouldn't use native API and do purchases in other way?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      daliusd
      wrote on last edited by
      #2

      I have "solved" problem myself. Instead of using native solution I have based my code on https://github.com/blackberry/Cascades-Samples/tree/master/paymentservice and it works very nice. Actually I like it better because I have to write less code and "bb::platform" code does not look cascades specific (I hope it will remain so). Just as help to others here what you should take into account by adopting this cascades solution for Qt app:

      1. Don't forget to add some extra "using namespace bb::platform" or use "bb::platform::" before specific functions.

      2. Add following line to pro file: LIBS += -lbbplatform

      3. If you are writing QtQuick app here is how you should set Window Group id (it works for me so I guess that's correct way):

      @QPlatformNativeInterface * const nativeInterface = QApplication::platformNativeInterface();

      const QString windowGroupId = static_cast<const char *>(nativeInterface->nativeResourceForWidget("windowGroup", QApplication::topLevelWidgets().first()));

      m_paymentManager->setWindowGroupId(windowGroupId);@

      If someone from RIM team is reading and has to add any corrections please do it. While it is working (for me) I don't want incorrect solution to float around.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved