Beispiel #1
0
        public void WriteTo(Stream output)
        {
            var req = OriginalData == null ? new Proto.PaymentRequest() : (Proto.PaymentRequest)Serializer.DeepClone(OriginalData);

            req.pki_type = ToPKITypeString(PKIType);

            var certs = new Proto.X509Certificates();

            if (this.MerchantCertificate != null)
            {
                certs.certificate.Add(MerchantCertificate.Export(X509ContentType.Cert));
            }
            foreach (var cert in AdditionalCertificates)
            {
                certs.certificate.Add(cert.Export(X509ContentType.Cert));
            }
            MemoryStream ms = new MemoryStream();

            Serializer.Serialize(ms, certs);
            req.pki_data = ms.ToArray();
            req.serialized_payment_details = Details.ToBytes();
            req.signature = Signature;
            if (Details.Version != 1)
            {
                req.payment_details_version = Details.Version;
            }
            Serializer.Serialize(output, req);
        }
Beispiel #2
0
 public HomeController(
     ApplePayClient client,
     MerchantCertificate certificate,
     IOptions <ApplePayOptions> options)
 {
     _client      = client;
     _certificate = certificate;
     _options     = options.Value;
 }