Ejemplo n.º 1
0
        public CollectResponseType Collect(OrderResponseType order)
        {
            using (var client = new RpServicePortTypeClient())
            {
                Console.WriteLine("{0}Start the BankID application and sign in", Environment.NewLine);

                CollectResponseType result = null;

                // Wait for the client to sign in
                do
                {
                    // ...collect the response
                    result = client.Collect(order.orderRef);

                    Console.WriteLine(result.progressStatus);
                    System.Threading.Thread.Sleep(1000);
                } while (result.progressStatus != ProgressStatusType.COMPLETE);


                do
                {
                    return(result);
                } while (Console.ReadKey(true).Key != ConsoleKey.Escape);
            }
        }
Ejemplo n.º 2
0
        private static void Collect(OrderResponseType order)
        {
            using (var client = new RpServicePortTypeClient())
            {
                Console.WriteLine("{0}Start the BankID application and sign in", Environment.NewLine);

                CollectResponseType result = null;

                // Wait for the client to sign in
                do
                {
                    // ...collect the response
                    result = client.Collect(order.orderRef);

                    Console.WriteLine(result.progressStatus);
                    System.Threading.Thread.Sleep(1000);
                } while (result.progressStatus != ProgressStatusType.COMPLETE);


                do
                {
                    Console.WriteLine("Hi {0}, please press [ESC] to exit", result.userInfo.givenName);
                } while (Console.ReadKey(true).Key != ConsoleKey.Escape);
            }
        }
Ejemplo n.º 3
0
 public static OrderResponseTypeModel Map(OrderResponseType dto)
 {
     return(new OrderResponseTypeModel
     {
         AutoStartToken = dto.autoStartToken,
         OrderRef = dto.orderRef,
     });
 }
Ejemplo n.º 4
0
        public static OrderResponseType Create()
        {
            var doc = new OrderResponseType
            {
                UBLVersionID    = "2.1",
                CustomizationID = "urn:www.cenbii.eu:transaction:biicoretrdmXYZ:ver1.0",
                ProfileID       = new IdentifierType
                {
                    schemeAgencyID = "BII",
                    schemeID       = "Profile",
                    Value          = "urn:www.cenbii.eu:profile:BIIXYZ:ver1.0"
                },
                ID        = "7",
                IssueDate = "2010-01-21",
                IssueTime = "12:30:00",
                Note      = new List <TextType>()
                {
                    new TextType
                    {
                        Value = "Information text for the whole order response"
                    }
                },
                DocumentCurrencyCode = "SEK",
                OrderReference       = new List <OrderReferenceType>()
                {
                    new OrderReferenceType
                    {
                        ID = "34"
                    }
                },
                SellerSupplierParty = new SupplierPartyType
                {
                    Party = new PartyType
                    {
                        EndpointID = new IdentifierType
                        {
                            schemeAgencyID = "9",
                            schemeID       = "GLN",
                            Value          = "7302347231111"
                        },
                        PartyIdentification = new List <PartyIdentificationType>()
                        {
                            new PartyIdentificationType
                            {
                                ID = "SellerPartyID123"
                            }
                        },
                        PartyName = new List <PartyNameType>()
                        {
                            new PartyNameType
                            {
                                Name = "Moderna Produkter AB"
                            }
                        },
                    }
                },
                BuyerCustomerParty = new CustomerPartyType
                {
                    Party = new PartyType
                    {
                        EndpointID = new IdentifierType
                        {
                            schemeAgencyID = "9",
                            schemeID       = "GLN",
                            Value          = "7300072311115"
                        },
                        PartyIdentification = new List <PartyIdentificationType>()
                        {
                            new PartyIdentificationType
                            {
                                ID = new IdentifierType
                                {
                                    schemeAgencyID = "9",
                                    schemeID       = "GLN",
                                    Value          = "7300070011115"
                                }
                            },
                            new PartyIdentificationType
                            {
                                ID = "PartyID123"
                            }
                        },
                        PartyName = new List <PartyNameType>()
                        {
                            new PartyNameType
                            {
                                Name = "Johnssons byggvaror"
                            }
                        },
                    }
                },
                OrderLine = new List <OrderLineType>()
                {
                    new OrderLineType
                    {
                        LineItem = new LineItemType
                        {
                            ID             = "1",
                            LineStatusCode = new CodeType
                            {
                                listAgencyID = "UBL",
                                listName     = "Line Status",
                                Value        = "NoStatus"
                            }
                        }
                    },
                    new OrderLineType
                    {
                        LineItem = new LineItemType
                        {
                            ID             = "2",
                            LineStatusCode = new CodeType
                            {
                                listAgencyID = "UBL",
                                listName     = "Line Status",
                                Value        = "Disputed"
                            }
                        }
                    }
                },
            };

            doc.Xmlns = new System.Xml.Serialization.XmlSerializerNamespaces(new[]
            {
                new XmlQualifiedName("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"),
                new XmlQualifiedName("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"),
            });
            return(doc);
        }