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



commit f61f4ae5093cc8e2c8560ababdf8b74187338a13
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 6464bfe..4ad484e 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]