@@ -22,20 +22,16 @@ import Ubuntu.Payments 0.1
23 * When clicked, this button starts the payments service.
23 * When clicked, this button starts the payments service.
24 * Then it waits until the purchase finishes or fails.
24 * Then it waits until the purchase finishes or fails.
25− * Those events trigger the corresponding signals.
25+ * Those events trigger the corresponding actions.
28PreviewWidget {
28PreviewWidget {
31− implicitHeight: paymentButton.implicitHeight
32− implicitWidth: paymentButton.implicitWidth
35 id: paymentButton
32 id: paymentButton
37− property var source: widgetData["source"]
38 objectName: "paymentButton"
33 objectName: "paymentButton"
39 color: Theme.palette.selected.foreground
35 color: Theme.palette.selected.foreground
40 text: paymentClient.formattedPrice
36 text: paymentClient.formattedPrice
41 onClicked: paymentClient.start()
37 onClicked: paymentClient.start()
@@ -44,12 +40,14 @@ PreviewWidget {
45 Payments {
41 Payments {
46 id: paymentClient
42 id: paymentClient
44+ property var source: widgetData["source"]
47− price: paymentButton.source["price"]
46+ price: source["price"]
48− currency: paymentButton.source["currency"]
47+ currency: source["currency"]
49− storeItemId: paymentButton.source["store_item_id"]
48+ storeItemId: source["store_item_id"]
50− onPurchaseCompleted: root.triggered(widgetId, "purchaseCompleted", paymentButton.source)
49+ onPurchaseCompleted: root.triggered(widgetId, "purchaseCompleted", source)
51− onPurchaseCanceled: root.triggered(widgetId, "purchaseCanceled", paymentButton.source)
52− onPurchaseError: root.triggered(widgetId, "purchaseError", paymentButton.source)
50+ onPurchaseError: root.triggered(widgetId, "purchaseError", source)