Beispiel #1
0
        // Convenience method to poll a Payment node with paymentId till its ready property is True
        private void PollPaymentReady(string paymentId, PaymentPollFinishedHandler callback)
        {
            PollUpdatedHandler isReady = (updatedQueryRoot) => {
                var payment = (Payment)updatedQueryRoot.node();
                return(payment.ready());
            };

            PollPaymentNode(paymentId, isReady, callback);
        }
Beispiel #2
0
        // Polls a Payment node, till isReady returns True.
        private void PollPaymentNode(string paymentId, PollUpdatedHandler isReady, PaymentPollFinishedHandler callback)
        {
            QueryRootQuery query = new QueryRootQuery();

            DefaultQueries.checkout.PaymentPoll(query, paymentId);

            Client.PollQuery(isReady, query, (response, error) => {
                if (error != null)
                {
                    callback(null, error);
                }
                else
                {
                    Payment payment = (Payment)response.node();
                    callback(payment, null);
                }
            });
        }