[gnome-software/wip/rancell/paid: 62/63] Purchase dialog WIP (snap plugin)



commit ff9bf3286711f6488479b8f661e0d6eb3e01fcf5
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Aug 12 15:11:41 2016 +1200

    Purchase dialog WIP (snap plugin)

 src/plugins/gs-plugin-snap.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/plugins/gs-plugin-snap.c b/src/plugins/gs-plugin-snap.c
index 6ddd0de..80d2877 100644
--- a/src/plugins/gs-plugin-snap.c
+++ b/src/plugins/gs-plugin-snap.c
@@ -605,7 +605,7 @@ send_package_action (GsPlugin *plugin,
 
 gboolean
 gs_plugin_add_payment_methods (GsPlugin *plugin,
-                              GsPaymentMethodList *payment_methods,
+                              GPtrArray *payment_methods,
                               GCancellable *cancellable,
                               GError **error)
 {
@@ -656,7 +656,7 @@ gs_plugin_add_payment_methods (GsPlugin *plugin,
                GsPaymentMethod *payment_method;
 
                payment_method = gs_payment_method_new ();
-               gs_payment_method_list_add (payment_methods, payment_method);
+               g_ptr_array_add (payment_methods, payment_method);
 
                description = json_object_get_string_member (method, "description");
                gs_payment_method_set_description (payment_method, description);
@@ -719,25 +719,17 @@ gs_plugin_app_purchase (GsPlugin *plugin,
                return FALSE;
        }
 
-       if (!gs_snapd_request ("POST", "/v2/buy/methods", NULL,
+       if (!gs_snapd_request ("POST", "/v2/buy", data,
                               NULL, NULL,
                               &status_code, &reason_phrase,
                               &response_type, &response, NULL,
                               cancellable, error))
                return FALSE;
 
-       /*if (!gs_snapd_request ("POST", "/v2/buy", data,
-                              NULL, NULL,
-                              &status_code, &reason_phrase,
-                              &response_type, &response, NULL,
-                              cancellable, error))
-               return FALSE;*/
-
        if (status_code != SOUP_STATUS_OK) {
                // FIXME
                return FALSE;
        }
-  g_printerr ("'%s'\n", response);
 
        gs_app_set_state (app, AS_APP_STATE_PURCHASING);
        gs_app_set_state (app, AS_APP_STATE_AVAILABLE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]