コード例 #1
0
        public async void SendSwishRequest()
        {
            // send swish request
            // stage 2
            DummySwishRequest swish_request = new DummySwishRequest(order.get_total_price(), order.get_phonenumber());

            Result <string> token = await swish_request.Send();

            // receive swish response
            // stage 3
            if (token.Success())
            {
                this.token = token.Value;

                // send first response
                // stage 4
                first_response.send("<client status=\"true\"><id>" + id + "</id><token>" + token.Value + "</token></client>\n");
            }
            else
            {
                // ERROR
                first_response.send("<client status=\"false\"><errormsg>" + token.Value + "</errormsg></client>\n");
                is_done = true;
            }
        }
コード例 #2
0
        private void payment_done()
        {
            // stage 6
            second_response.send(second_response_send_msg);

            if (successfull_payment)
            {
                EmailSender.SendEmail("Bord " + this.order.get_tablenumber(), this.order.toRecipt());
            }

            is_done = true;
        }