text: // Generated by the protocol buffer compiler.  DO NOT EDIT!
  // source: paymentrequest.proto
  
  #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  #include "paymentrequest.pb.h"
  
  #include <algorithm>
  
  #include <google/protobuf/stubs/common.h>
  #include <google/protobuf/stubs/once.h>
  #include <google/protobuf/io/coded_stream.h>
  #include <google/protobuf/wire_format_lite_inl.h>
  #include <google/protobuf/descriptor.h>
  #include <google/protobuf/generated_message_reflection.h>
  #include <google/protobuf/reflection_ops.h>
  #include <google/protobuf/wire_format.h>
  // @@protoc_insertion_point(includes)
  
  namespace payments {
  
  namespace {
  
  const ::google::protobuf::Descriptor* Output_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    Output_reflection_ = NULL;
  const ::google::protobuf::Descriptor* PaymentDetails_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    PaymentDetails_reflection_ = NULL;
  const ::google::protobuf::Descriptor* PaymentRequest_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    PaymentRequest_reflection_ = NULL;
  const ::google::protobuf::Descriptor* X509Certificates_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    X509Certificates_reflection_ = NULL;
  const ::google::protobuf::Descriptor* Payment_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    Payment_reflection_ = NULL;
  const ::google::protobuf::Descriptor* PaymentACK_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    PaymentACK_reflection_ = NULL;
  
  }  // namespace
  
  
  void protobuf_AssignDesc_paymentrequest_2eproto() {
    protobuf_AddDesc_paymentrequest_2eproto();
    const ::google::protobuf::FileDescriptor* file =
      ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
        "paymentrequest.proto");
    GOOGLE_CHECK(file != NULL);
    Output_descriptor_ = file->message_type(0);
    static const int Output_offsets_[2] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, amount_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, script_),
    };
    Output_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        Output_descriptor_,
        Output::default_instance_,
        Output_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(Output));
    PaymentDetails_descriptor_ = file->message_type(1);
    static const int PaymentDetails_offsets_[7] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, network_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, outputs_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, time_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, expires_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, memo_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, payment_url_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, merchant_data_),
    };
    PaymentDetails_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        PaymentDetails_descriptor_,
        PaymentDetails::default_instance_,
        PaymentDetails_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(PaymentDetails));
    PaymentRequest_descriptor_ = file->message_type(2);
    static const int PaymentRequest_offsets_[5] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, payment_details_version_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, pki_type_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, pki_data_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, serialized_payment_details_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, signature_),
    };
    PaymentRequest_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        PaymentRequest_descriptor_,
        PaymentRequest::default_instance_,
        PaymentRequest_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(PaymentRequest));
    X509Certificates_descriptor_ = file->message_type(3);
    static const int X509Certificates_offsets_[1] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, certificate_),
    };
    X509Certificates_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        X509Certificates_descriptor_,
        X509Certificates::default_instance_,
        X509Certificates_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(X509Certificates));
    Payment_descriptor_ = file->message_type(4);
    static const int Payment_offsets_[4] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, merchant_data_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, transactions_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, refund_to_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, memo_),
    };
    Payment_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        Payment_descriptor_,
        Payment::default_instance_,
        Payment_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(Payment));
    PaymentACK_descriptor_ = file->message_type(5);
    static const int PaymentACK_offsets_[2] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, payment_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, memo_),
    };
    PaymentACK_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        PaymentACK_descriptor_,
        PaymentACK::default_instance_,
        PaymentACK_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(PaymentACK));
  }
  
  namespace {
  
  GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  inline void protobuf_AssignDescriptorsOnce() {
    ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                   &protobuf_AssignDesc_paymentrequest_2eproto);
  }
  
  void protobuf_RegisterTypes(const ::std::string&) {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Output_descriptor_, &Output::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      PaymentDetails_descriptor_, &PaymentDetails::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      PaymentRequest_descriptor_, &PaymentRequest::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      X509Certificates_descriptor_, &X509Certificates::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Payment_descriptor_, &Payment::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      PaymentACK_descriptor_, &PaymentACK::default_instance());
  }
  
  }  // namespace
  
  void protobuf_ShutdownFile_paymentrequest_2eproto() {
    delete Output::default_instance_;
    delete Output_reflection_;
    delete PaymentDetails::default_instance_;
    delete PaymentDetails_reflection_;
    delete PaymentDetails::_default_network_;
    delete PaymentRequest::default_instance_;
    delete PaymentRequest_reflection_;
    delete PaymentRequest::_default_pki_type_;
    delete X509Certificates::default_instance_;
    delete X509Certificates_reflection_;
    delete Payment::default_instance_;
    delete Payment_reflection_;
    delete PaymentACK::default_instance_;
    delete PaymentACK_reflection_;
  }
  
  void protobuf_AddDesc_paymentrequest_2eproto() {
    static bool already_here = false;
    if (already_here) return;
    already_here = true;
    GOOGLE_PROTOBUF_VERIFY_VERSION;
  
    ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      "\n\024paymentrequest.proto\022\010payments\"+\n\006Outp"
      "ut\022\021\n\006amount\030\001 \001(\004:\0010\022\016\n\006script\030\002 \002(\014\"\243\001"
      "\n\016PaymentDetails\022\025\n\007network\030\001 \001(\t:\004main\022"
      "!\n\007outputs\030\002 \003(\0132\020.payments.Output\022\014\n\004ti"
      "me\030\003 \002(\004\022\017\n\007expires\030\004 \001(\004\022\014\n\004memo\030\005 \001(\t\022"
      "\023\n\013payment_url\030\006 \001(\t\022\025\n\rmerchant_data\030\007 "
      "\001(\014\"\225\001\n\016PaymentRequest\022\"\n\027payment_detail"
      "s_version\030\001 \001(\r:\0011\022\026\n\010pki_type\030\002 \001(\t:\004no"
      "ne\022\020\n\010pki_data\030\003 \001(\014\022\"\n\032serialized_payme"
      "nt_details\030\004 \002(\014\022\021\n\tsignature\030\005 \001(\014\"\'\n\020X"
      "509Certificates\022\023\n\013certificate\030\001 \003(\014\"i\n\007"
      "Payment\022\025\n\rmerchant_data\030\001 \001(\014\022\024\n\014transa"
      "ctions\030\002 \003(\014\022#\n\trefund_to\030\003 \003(\0132\020.paymen"
      "ts.Output\022\014\n\004memo\030\004 \001(\t\">\n\nPaymentACK\022\"\n"
      "\007payment\030\001 \002(\0132\021.payments.Payment\022\014\n\004mem"
      "o\030\002 \001(\tB$\n\032org.tgk.protocols.paymentsB\006P"
      "rotos", 645);
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
      "paymentrequest.proto", &protobuf_RegisterTypes);
    Output::default_instance_ = new Output();
    PaymentDetails::_default_network_ =
        new ::std::string("main", 4);
    PaymentDetails::default_instance_ = new PaymentDetails();
    PaymentRequest::_default_pki_type_ =
        new ::std::string("none", 4);
    PaymentRequest::default_instance_ = new PaymentRequest();
    X509Certificates::default_instance_ = new X509Certificates();
    Payment::default_instance_ = new Payment();
    PaymentACK::default_instance_ = new PaymentACK();
    Output::default_instance_->InitAsDefaultInstance();
    PaymentDetails::default_instance_->InitAsDefaultInstance();
    PaymentRequest::default_instance_->InitAsDefaultInstance();
    X509Certificates::default_instance_->InitAsDefaultInstance();
    Payment::default_instance_->InitAsDefaultInstance();
    PaymentACK::default_instance_->InitAsDefaultInstance();
    ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_paymentrequest_2eproto);
  }
  
  // Force AddDescriptors() to be called at static initialization time.
  struct StaticDescriptorInitializer_paymentrequest_2eproto {
    StaticDescriptorInitializer_paymentrequest_2eproto() {
      protobuf_AddDesc_paymentrequest_2eproto();
    }
  } static_descriptor_initializer_paymentrequest_2eproto_;
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int Output::kAmountFieldNumber;
  const int Output::kScriptFieldNumber;
  #endif  // !_MSC_VER
  
  Output::Output()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:payments.Output)
  }
  
  void Output::InitAsDefaultInstance() {
  }
  
  Output::Output(const Output& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:payments.Output)
  }
  
  void Output::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    amount_ = GOOGLE_ULONGLONG(0);
    script_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  Output::~Output() {
    // @@protoc_insertion_point(destructor:payments.Output)
    SharedDtor();
  }
  
  void Output::SharedDtor() {
    if (script_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete script_;
    }
    if (this != default_instance_) {
    }
  }
  
  void Output::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* Output::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return Output_descriptor_;
  }
  
  const Output& Output::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_paymentrequest_2eproto();
    return *default_instance_;
  }
  
  Output* Output::default_instance_ = NULL;
  
  Output* Output::New() const {
    return new Output;
  }
  
  void Output::Clear() {
    if (_has_bits_[0 / 32] & 3) {
      amount_ = GOOGLE_ULONGLONG(0);
      if (has_script()) {
        if (script_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          script_->clear();
        }
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool Output::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:payments.Output)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // optional uint64 amount = 1 [default = 0];
        case 1: {
          if (tag == 8) {
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                   input, &amount_)));
            set_has_amount();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_script;
          break;
        }
  
        // required bytes script = 2;
        case 2: {
          if (tag == 18) {
           parse_script:
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->mutable_script()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:payments.Output)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:payments.Output)
    return false;
  #undef DO_
  }
  
  void Output::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:payments.Output)
    // optional uint64 amount = 1 [default = 0];
    if (has_amount()) {
      ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->amount(), output);
    }
  
    // required bytes script = 2;
    if (has_script()) {
      ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
        2, this->script(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:payments.Output)
  }
  
  ::google::protobuf::uint8* Output::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:payments.Output)
    // optional uint64 amount = 1 [default = 0];
    if (has_amount()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->amount(), target);
    }
  
    // required bytes script = 2;
    if (has_script()) {
      target =
        ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
          2, this->script(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:payments.Output)
    return target;
  }
  
  int Output::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // optional uint64 amount = 1 [default = 0];
      if (has_amount()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::UInt64Size(
            this->amount());
      }
  
      // required bytes script = 2;
      if (has_script()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::BytesSize(
            this->script());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void Output::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const Output* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const Output*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void Output::MergeFrom(const Output& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_amount()) {
        set_amount(from.amount());
      }
      if (from.has_script()) {
        set_script(from.script());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void Output::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void Output::CopyFrom(const Output& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool Output::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000002) != 0x00000002) return false;
  
    return true;
  }
  
  void Output::Swap(Output* other) {
    if (other != this) {
      std::swap(amount_, other->amount_);
      std::swap(script_, other->script_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata Output::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = Output_descriptor_;
    metadata.reflection = Output_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  ::std::string* PaymentDetails::_default_network_ = NULL;
  #ifndef _MSC_VER
  const int PaymentDetails::kNetworkFieldNumber;
  const int PaymentDetails::kOutputsFieldNumber;
  const int PaymentDetails::kTimeFieldNumber;
  const int PaymentDetails::kExpiresFieldNumber;
  const int PaymentDetails::kMemoFieldNumber;
  const int PaymentDetails::kPaymentUrlFieldNumber;
  const int PaymentDetails::kMerchantDataFieldNumber;
  #endif  // !_MSC_VER
  
  PaymentDetails::PaymentDetails()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:payments.PaymentDetails)
  }
  
  void PaymentDetails::InitAsDefaultInstance() {
  }
  
  PaymentDetails::PaymentDetails(const PaymentDetails& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:payments.PaymentDetails)
  }
  
  void PaymentDetails::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    network_ = const_cast< ::std::string*>(_default_network_);
    time_ = GOOGLE_ULONGLONG(0);
    expires_ = GOOGLE_ULONGLONG(0);
    memo_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    payment_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    merchant_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  PaymentDetails::~PaymentDetails() {
    // @@protoc_insertion_point(destructor:payments.PaymentDetails)
    SharedDtor();
  }
  
  void PaymentDetails::SharedDtor() {
    if (network_ != _default_network_) {
      delete network_;
    }
    if (memo_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete memo_;
    }
    if (payment_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete payment_url_;
    }
    if (merchant_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete merchant_data_;
    }
    if (this != default_instance_) {
    }
  }
  
  void PaymentDetails::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* PaymentDetails::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return PaymentDetails_descriptor_;
  }
  
  const PaymentDetails& PaymentDetails::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_paymentrequest_2eproto();
    return *default_instance_;
  }
  
  PaymentDetails* PaymentDetails::default_instance_ = NULL;
  
  PaymentDetails* PaymentDetails::New() const {
    return new PaymentDetails;
  }
  
  void PaymentDetails::Clear() {
  #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \
    &reinterpret_cast<PaymentDetails*>(16)->f) - \
     reinterpret_cast<char*>(16))
  
  #define ZR_(first, last) do {                              \
      size_t f = OFFSET_OF_FIELD_(first);                    \
      size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \
      ::memset(&first, 0, n);                                \
    } while (0)
  
    if (_has_bits_[0 / 32] & 125) {
      ZR_(time_, expires_);
      if (has_network()) {
        if (network_ != _default_network_) {
          network_->assign(*_default_network_);
        }
      }
      if (has_memo()) {
        if (memo_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          memo_->clear();
        }
      }
      if (has_payment_url()) {
        if (payment_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          payment_url_->clear();
        }
      }
      if (has_merchant_data()) {
        if (merchant_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          merchant_data_->clear();
        }
      }
    }
  
  #undef OFFSET_OF_FIELD_
  #undef ZR_
  
    outputs_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool PaymentDetails::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:payments.PaymentDetails)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // optional string network = 1 [default = "main"];
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_network()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->network().data(), this->network().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "network");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_outputs;
          break;
        }
  
        // repeated .payments.Output outputs = 2;
        case 2: {
          if (tag == 18) {
           parse_outputs:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_outputs()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_outputs;
          if (input->ExpectTag(24)) goto parse_time;
          break;
        }
  
        // required uint64 time = 3;
        case 3: {
          if (tag == 24) {
           parse_time:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                   input, &time_)));
            set_has_time();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(32)) goto parse_expires;
          break;
        }
  
        // optional uint64 expires = 4;
        case 4: {
          if (tag == 32) {
           parse_expires:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                   input, &expires_)));
            set_has_expires();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(42)) goto parse_memo;
          break;
        }
  
        // optional string memo = 5;
        case 5: {
          if (tag == 42) {
           parse_memo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_memo()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->memo().data(), this->memo().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "memo");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(50)) goto parse_payment_url;
          break;
        }
  
        // optional string payment_url = 6;
        case 6: {
          if (tag == 50) {
           parse_payment_url:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_payment_url()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->payment_url().data(), this->payment_url().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "payment_url");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(58)) goto parse_merchant_data;
          break;
        }
  
        // optional bytes merchant_data = 7;
        case 7: {
          if (tag == 58) {
           parse_merchant_data:
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->mutable_merchant_data()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:payments.PaymentDetails)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:payments.PaymentDetails)
    return false;
  #undef DO_
  }
  
  void PaymentDetails::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:payments.PaymentDetails)
    // optional string network = 1 [default = "main"];
    if (has_network()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->network().data(), this->network().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "network");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        1, this->network(), output);
    }
  
    // repeated .payments.Output outputs = 2;
    for (int i = 0; i < this->outputs_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        2, this->outputs(i), output);
    }
  
    // required uint64 time = 3;
    if (has_time()) {
      ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->time(), output);
    }
  
    // optional uint64 expires = 4;
    if (has_expires()) {
      ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->expires(), output);
    }
  
    // optional string memo = 5;
    if (has_memo()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->memo().data(), this->memo().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "memo");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        5, this->memo(), output);
    }
  
    // optional string payment_url = 6;
    if (has_payment_url()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->payment_url().data(), this->payment_url().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "payment_url");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        6, this->payment_url(), output);
    }
  
    // optional bytes merchant_data = 7;
    if (has_merchant_data()) {
      ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
        7, this->merchant_data(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:payments.PaymentDetails)
  }
  
  ::google::protobuf::uint8* PaymentDetails::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:payments.PaymentDetails)
    // optional string network = 1 [default = "main"];
    if (has_network()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->network().data(), this->network().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "network");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          1, this->network(), target);
    }
  
    // repeated .payments.Output outputs = 2;
    for (int i = 0; i < this->outputs_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          2, this->outputs(i), target);
    }
  
    // required uint64 time = 3;
    if (has_time()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->time(), target);
    }
  
    // optional uint64 expires = 4;
    if (has_expires()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->expires(), target);
    }
  
    // optional string memo = 5;
    if (has_memo()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->memo().data(), this->memo().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "memo");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          5, this->memo(), target);
    }
  
    // optional string payment_url = 6;
    if (has_payment_url()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->payment_url().data(), this->payment_url().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "payment_url");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          6, this->payment_url(), target);
    }
  
    // optional bytes merchant_data = 7;
    if (has_merchant_data()) {
      target =
        ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
          7, this->merchant_data(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:payments.PaymentDetails)
    return target;
  }
  
  int PaymentDetails::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // optional string network = 1 [default = "main"];
      if (has_network()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->network());
      }
  
      // required uint64 time = 3;
      if (has_time()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::UInt64Size(
            this->time());
      }
  
      // optional uint64 expires = 4;
      if (has_expires()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::UInt64Size(
            this->expires());
      }
  
      // optional string memo = 5;
      if (has_memo()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->memo());
      }
  
      // optional string payment_url = 6;
      if (has_payment_url()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->payment_url());
      }
  
      // optional bytes merchant_data = 7;
      if (has_merchant_data()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::BytesSize(
            this->merchant_data());
      }
  
    }
    // repeated .payments.Output outputs = 2;
    total_size += 1 * this->outputs_size();
    for (int i = 0; i < this->outputs_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->outputs(i));
    }
  
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void PaymentDetails::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const PaymentDetails* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const PaymentDetails*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void PaymentDetails::MergeFrom(const PaymentDetails& from) {
    GOOGLE_CHECK_NE(&from, this);
    outputs_.MergeFrom(from.outputs_);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_network()) {
        set_network(from.network());
      }
      if (from.has_time()) {
        set_time(from.time());
      }
      if (from.has_expires()) {
        set_expires(from.expires());
      }
      if (from.has_memo()) {
        set_memo(from.memo());
      }
      if (from.has_payment_url()) {
        set_payment_url(from.payment_url());
      }
      if (from.has_merchant_data()) {
        set_merchant_data(from.merchant_data());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void PaymentDetails::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void PaymentDetails::CopyFrom(const PaymentDetails& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool PaymentDetails::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000004) != 0x00000004) return false;
  
    if (!::google::protobuf::internal::AllAreInitialized(this->outputs())) return false;
    return true;
  }
  
  void PaymentDetails::Swap(PaymentDetails* other) {
    if (other != this) {
      std::swap(network_, other->network_);
      outputs_.Swap(&other->outputs_);
      std::swap(time_, other->time_);
      std::swap(expires_, other->expires_);
      std::swap(memo_, other->memo_);
      std::swap(payment_url_, other->payment_url_);
      std::swap(merchant_data_, other->merchant_data_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata PaymentDetails::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = PaymentDetails_descriptor_;
    metadata.reflection = PaymentDetails_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  ::std::string* PaymentRequest::_default_pki_type_ = NULL;
  #ifndef _MSC_VER
  const int PaymentRequest::kPaymentDetailsVersionFieldNumber;
  const int PaymentRequest::kPkiTypeFieldNumber;
  const int PaymentRequest::kPkiDataFieldNumber;
  const int PaymentRequest::kSerializedPaymentDetailsFieldNumber;
  const int PaymentRequest::kSignatureFieldNumber;
  #endif  // !_MSC_VER
  
  PaymentRequest::PaymentRequest()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:payments.PaymentRequest)
  }
  
  void PaymentRequest::InitAsDefaultInstance() {
  }
  
  PaymentRequest::PaymentRequest(const PaymentRequest& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:payments.PaymentRequest)
  }
  
  void PaymentRequest::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    payment_details_version_ = 1u;
    pki_type_ = const_cast< ::std::string*>(_default_pki_type_);
    pki_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    serialized_payment_details_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    signature_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  PaymentRequest::~PaymentRequest() {
    // @@protoc_insertion_point(destructor:payments.PaymentRequest)
    SharedDtor();
  }
  
  void PaymentRequest::SharedDtor() {
    if (pki_type_ != _default_pki_type_) {
      delete pki_type_;
    }
    if (pki_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete pki_data_;
    }
    if (serialized_payment_details_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete serialized_payment_details_;
    }
    if (signature_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete signature_;
    }
    if (this != default_instance_) {
    }
  }
  
  void PaymentRequest::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* PaymentRequest::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return PaymentRequest_descriptor_;
  }
  
  const PaymentRequest& PaymentRequest::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_paymentrequest_2eproto();
    return *default_instance_;
  }
  
  PaymentRequest* PaymentRequest::default_instance_ = NULL;
  
  PaymentRequest* PaymentRequest::New() const {
    return new PaymentRequest;
  }
  
  void PaymentRequest::Clear() {
    if (_has_bits_[0 / 32] & 31) {
      payment_details_version_ = 1u;
      if (has_pki_type()) {
        if (pki_type_ != _default_pki_type_) {
          pki_type_->assign(*_default_pki_type_);
        }
      }
      if (has_pki_data()) {
        if (pki_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          pki_data_->clear();
        }
      }
      if (has_serialized_payment_details()) {
        if (serialized_payment_details_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          serialized_payment_details_->clear();
        }
      }
      if (has_signature()) {
        if (signature_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          signature_->clear();
        }
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool PaymentRequest::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:payments.PaymentRequest)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // optional uint32 payment_details_version = 1 [default = 1];
        case 1: {
          if (tag == 8) {
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                   input, &payment_details_version_)));
            set_has_payment_details_version();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_pki_type;
          break;
        }
  
        // optional string pki_type = 2 [default = "none"];
        case 2: {
          if (tag == 18) {
           parse_pki_type:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_pki_type()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->pki_type().data(), this->pki_type().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "pki_type");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_pki_data;
          break;
        }
  
        // optional bytes pki_data = 3;
        case 3: {
          if (tag == 26) {
           parse_pki_data:
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->mutable_pki_data()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(34)) goto parse_serialized_payment_details;
          break;
        }
  
        // required bytes serialized_payment_details = 4;
        case 4: {
          if (tag == 34) {
           parse_serialized_payment_details:
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->mutable_serialized_payment_details()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(42)) goto parse_signature;
          break;
        }
  
        // optional bytes signature = 5;
        case 5: {
          if (tag == 42) {
           parse_signature:
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->mutable_signature()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:payments.PaymentRequest)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:payments.PaymentRequest)
    return false;
  #undef DO_
  }
  
  void PaymentRequest::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:payments.PaymentRequest)
    // optional uint32 payment_details_version = 1 [default = 1];
    if (has_payment_details_version()) {
      ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->payment_details_version(), output);
    }
  
    // optional string pki_type = 2 [default = "none"];
    if (has_pki_type()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->pki_type().data(), this->pki_type().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "pki_type");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        2, this->pki_type(), output);
    }
  
    // optional bytes pki_data = 3;
    if (has_pki_data()) {
      ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
        3, this->pki_data(), output);
    }
  
    // required bytes serialized_payment_details = 4;
    if (has_serialized_payment_details()) {
      ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
        4, this->serialized_payment_details(), output);
    }
  
    // optional bytes signature = 5;
    if (has_signature()) {
      ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
        5, this->signature(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:payments.PaymentRequest)
  }
  
  ::google::protobuf::uint8* PaymentRequest::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:payments.PaymentRequest)
    // optional uint32 payment_details_version = 1 [default = 1];
    if (has_payment_details_version()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->payment_details_version(), target);
    }
  
    // optional string pki_type = 2 [default = "none"];
    if (has_pki_type()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->pki_type().data(), this->pki_type().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "pki_type");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          2, this->pki_type(), target);
    }
  
    // optional bytes pki_data = 3;
    if (has_pki_data()) {
      target =
        ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
          3, this->pki_data(), target);
    }
  
    // required bytes serialized_payment_details = 4;
    if (has_serialized_payment_details()) {
      target =
        ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
          4, this->serialized_payment_details(), target);
    }
  
    // optional bytes signature = 5;
    if (has_signature()) {
      target =
        ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
          5, this->signature(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:payments.PaymentRequest)
    return target;
  }
  
  int PaymentRequest::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // optional uint32 payment_details_version = 1 [default = 1];
      if (has_payment_details_version()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::UInt32Size(
            this->payment_details_version());
      }
  
      // optional string pki_type = 2 [default = "none"];
      if (has_pki_type()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->pki_type());
      }
  
      // optional bytes pki_data = 3;
      if (has_pki_data()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::BytesSize(
            this->pki_data());
      }
  
      // required bytes serialized_payment_details = 4;
      if (has_serialized_payment_details()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::BytesSize(
            this->serialized_payment_details());
      }
  
      // optional bytes signature = 5;
      if (has_signature()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::BytesSize(
            this->signature());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void PaymentRequest::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const PaymentRequest* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const PaymentRequest*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void PaymentRequest::MergeFrom(const PaymentRequest& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_payment_details_version()) {
        set_payment_details_version(from.payment_details_version());
      }
      if (from.has_pki_type()) {
        set_pki_type(from.pki_type());
      }
      if (from.has_pki_data()) {
        set_pki_data(from.pki_data());
      }
      if (from.has_serialized_payment_details()) {
        set_serialized_payment_details(from.serialized_payment_details());
      }
      if (from.has_signature()) {
        set_signature(from.signature());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void PaymentRequest::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void PaymentRequest::CopyFrom(const PaymentRequest& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool PaymentRequest::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000008) != 0x00000008) return false;
  
    return true;
  }
  
  void PaymentRequest::Swap(PaymentRequest* other) {
    if (other != this) {
      std::swap(payment_details_version_, other->payment_details_version_);
      std::swap(pki_type_, other->pki_type_);
      std::swap(pki_data_, other->pki_data_);
      std::swap(serialized_payment_details_, other->serialized_payment_details_);
      std::swap(signature_, other->signature_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata PaymentRequest::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = PaymentRequest_descriptor_;
    metadata.reflection = PaymentRequest_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int X509Certificates::kCertificateFieldNumber;
  #endif  // !_MSC_VER
  
  X509Certificates::X509Certificates()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:payments.X509Certificates)
  }
  
  void X509Certificates::InitAsDefaultInstance() {
  }
  
  X509Certificates::X509Certificates(const X509Certificates& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:payments.X509Certificates)
  }
  
  void X509Certificates::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  X509Certificates::~X509Certificates() {
    // @@protoc_insertion_point(destructor:payments.X509Certificates)
    SharedDtor();
  }
  
  void X509Certificates::SharedDtor() {
    if (this != default_instance_) {
    }
  }
  
  void X509Certificates::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* X509Certificates::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return X509Certificates_descriptor_;
  }
  
  const X509Certificates& X509Certificates::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_paymentrequest_2eproto();
    return *default_instance_;
  }
  
  X509Certificates* X509Certificates::default_instance_ = NULL;
  
  X509Certificates* X509Certificates::New() const {
    return new X509Certificates;
  }
  
  void X509Certificates::Clear() {
    certificate_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool X509Certificates::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:payments.X509Certificates)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // repeated bytes certificate = 1;
        case 1: {
          if (tag == 10) {
           parse_certificate:
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->add_certificate()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(10)) goto parse_certificate;
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:payments.X509Certificates)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:payments.X509Certificates)
    return false;
  #undef DO_
  }
  
  void X509Certificates::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:payments.X509Certificates)
    // repeated bytes certificate = 1;
    for (int i = 0; i < this->certificate_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteBytes(
        1, this->certificate(i), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:payments.X509Certificates)
  }
  
  ::google::protobuf::uint8* X509Certificates::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:payments.X509Certificates)
    // repeated bytes certificate = 1;
    for (int i = 0; i < this->certificate_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteBytesToArray(1, this->certificate(i), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:payments.X509Certificates)
    return target;
  }
  
  int X509Certificates::ByteSize() const {
    int total_size = 0;
  
    // repeated bytes certificate = 1;
    total_size += 1 * this->certificate_size();
    for (int i = 0; i < this->certificate_size(); i++) {
      total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
        this->certificate(i));
    }
  
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void X509Certificates::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const X509Certificates* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const X509Certificates*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void X509Certificates::MergeFrom(const X509Certificates& from) {
    GOOGLE_CHECK_NE(&from, this);
    certificate_.MergeFrom(from.certificate_);
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void X509Certificates::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void X509Certificates::CopyFrom(const X509Certificates& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool X509Certificates::IsInitialized() const {
  
    return true;
  }
  
  void X509Certificates::Swap(X509Certificates* other) {
    if (other != this) {
      certificate_.Swap(&other->certificate_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata X509Certificates::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = X509Certificates_descriptor_;
    metadata.reflection = X509Certificates_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int Payment::kMerchantDataFieldNumber;
  const int Payment::kTransactionsFieldNumber;
  const int Payment::kRefundToFieldNumber;
  const int Payment::kMemoFieldNumber;
  #endif  // !_MSC_VER
  
  Payment::Payment()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:payments.Payment)
  }
  
  void Payment::InitAsDefaultInstance() {
  }
  
  Payment::Payment(const Payment& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:payments.Payment)
  }
  
  void Payment::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    merchant_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    memo_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  Payment::~Payment() {
    // @@protoc_insertion_point(destructor:payments.Payment)
    SharedDtor();
  }
  
  void Payment::SharedDtor() {
    if (merchant_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete merchant_data_;
    }
    if (memo_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete memo_;
    }
    if (this != default_instance_) {
    }
  }
  
  void Payment::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* Payment::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return Payment_descriptor_;
  }
  
  const Payment& Payment::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_paymentrequest_2eproto();
    return *default_instance_;
  }
  
  Payment* Payment::default_instance_ = NULL;
  
  Payment* Payment::New() const {
    return new Payment;
  }
  
  void Payment::Clear() {
    if (_has_bits_[0 / 32] & 9) {
      if (has_merchant_data()) {
        if (merchant_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          merchant_data_->clear();
        }
      }
      if (has_memo()) {
        if (memo_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          memo_->clear();
        }
      }
    }
    transactions_.Clear();
    refund_to_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool Payment::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:payments.Payment)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // optional bytes merchant_data = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->mutable_merchant_data()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_transactions;
          break;
        }
  
        // repeated bytes transactions = 2;
        case 2: {
          if (tag == 18) {
           parse_transactions:
            DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                  input, this->add_transactions()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_transactions;
          if (input->ExpectTag(26)) goto parse_refund_to;
          break;
        }
  
        // repeated .payments.Output refund_to = 3;
        case 3: {
          if (tag == 26) {
           parse_refund_to:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_refund_to()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_refund_to;
          if (input->ExpectTag(34)) goto parse_memo;
          break;
        }
  
        // optional string memo = 4;
        case 4: {
          if (tag == 34) {
           parse_memo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_memo()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->memo().data(), this->memo().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "memo");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:payments.Payment)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:payments.Payment)
    return false;
  #undef DO_
  }
  
  void Payment::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:payments.Payment)
    // optional bytes merchant_data = 1;
    if (has_merchant_data()) {
      ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
        1, this->merchant_data(), output);
    }
  
    // repeated bytes transactions = 2;
    for (int i = 0; i < this->transactions_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteBytes(
        2, this->transactions(i), output);
    }
  
    // repeated .payments.Output refund_to = 3;
    for (int i = 0; i < this->refund_to_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        3, this->refund_to(i), output);
    }
  
    // optional string memo = 4;
    if (has_memo()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->memo().data(), this->memo().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "memo");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        4, this->memo(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:payments.Payment)
  }
  
  ::google::protobuf::uint8* Payment::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:payments.Payment)
    // optional bytes merchant_data = 1;
    if (has_merchant_data()) {
      target =
        ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
          1, this->merchant_data(), target);
    }
  
    // repeated bytes transactions = 2;
    for (int i = 0; i < this->transactions_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteBytesToArray(2, this->transactions(i), target);
    }
  
    // repeated .payments.Output refund_to = 3;
    for (int i = 0; i < this->refund_to_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          3, this->refund_to(i), target);
    }
  
    // optional string memo = 4;
    if (has_memo()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->memo().data(), this->memo().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "memo");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          4, this->memo(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:payments.Payment)
    return target;
  }
  
  int Payment::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // optional bytes merchant_data = 1;
      if (has_merchant_data()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::BytesSize(
            this->merchant_data());
      }
  
      // optional string memo = 4;
      if (has_memo()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->memo());
      }
  
    }
    // repeated bytes transactions = 2;
    total_size += 1 * this->transactions_size();
    for (int i = 0; i < this->transactions_size(); i++) {
      total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
        this->transactions(i));
    }
  
    // repeated .payments.Output refund_to = 3;
    total_size += 1 * this->refund_to_size();
    for (int i = 0; i < this->refund_to_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->refund_to(i));
    }
  
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void Payment::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const Payment* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const Payment*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void Payment::MergeFrom(const Payment& from) {
    GOOGLE_CHECK_NE(&from, this);
    transactions_.MergeFrom(from.transactions_);
    refund_to_.MergeFrom(from.refund_to_);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_merchant_data()) {
        set_merchant_data(from.merchant_data());
      }
      if (from.has_memo()) {
        set_memo(from.memo());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void Payment::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void Payment::CopyFrom(const Payment& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool Payment::IsInitialized() const {
  
    if (!::google::protobuf::internal::AllAreInitialized(this->refund_to())) return false;
    return true;
  }
  
  void Payment::Swap(Payment* other) {
    if (other != this) {
      std::swap(merchant_data_, other->merchant_data_);
      transactions_.Swap(&other->transactions_);
      refund_to_.Swap(&other->refund_to_);
      std::swap(memo_, other->memo_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata Payment::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = Payment_descriptor_;
    metadata.reflection = Payment_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int PaymentACK::kPaymentFieldNumber;
  const int PaymentACK::kMemoFieldNumber;
  #endif  // !_MSC_VER
  
  PaymentACK::PaymentACK()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:payments.PaymentACK)
  }
  
  void PaymentACK::InitAsDefaultInstance() {
    payment_ = const_cast< ::payments::Payment*>(&::payments::Payment::default_instance());
  }
  
  PaymentACK::PaymentACK(const PaymentACK& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:payments.PaymentACK)
  }
  
  void PaymentACK::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    payment_ = NULL;
    memo_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  PaymentACK::~PaymentACK() {
    // @@protoc_insertion_point(destructor:payments.PaymentACK)
    SharedDtor();
  }
  
  void PaymentACK::SharedDtor() {
    if (memo_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete memo_;
    }
    if (this != default_instance_) {
      delete payment_;
    }
  }
  
  void PaymentACK::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* PaymentACK::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return PaymentACK_descriptor_;
  }
  
  const PaymentACK& PaymentACK::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_paymentrequest_2eproto();
    return *default_instance_;
  }
  
  PaymentACK* PaymentACK::default_instance_ = NULL;
  
  PaymentACK* PaymentACK::New() const {
    return new PaymentACK;
  }
  
  void PaymentACK::Clear() {
    if (_has_bits_[0 / 32] & 3) {
      if (has_payment()) {
        if (payment_ != NULL) payment_->::payments::Payment::Clear();
      }
      if (has_memo()) {
        if (memo_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          memo_->clear();
        }
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool PaymentACK::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:payments.PaymentACK)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // required .payments.Payment payment = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_payment()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_memo;
          break;
        }
  
        // optional string memo = 2;
        case 2: {
          if (tag == 18) {
           parse_memo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_memo()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->memo().data(), this->memo().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "memo");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:payments.PaymentACK)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:payments.PaymentACK)
    return false;
  #undef DO_
  }
  
  void PaymentACK::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:payments.PaymentACK)
    // required .payments.Payment payment = 1;
    if (has_payment()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->payment(), output);
    }
  
    // optional string memo = 2;
    if (has_memo()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->memo().data(), this->memo().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "memo");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        2, this->memo(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:payments.PaymentACK)
  }
  
  ::google::protobuf::uint8* PaymentACK::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:payments.PaymentACK)
    // required .payments.Payment payment = 1;
    if (has_payment()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          1, this->payment(), target);
    }
  
    // optional string memo = 2;
    if (has_memo()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->memo().data(), this->memo().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "memo");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          2, this->memo(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:payments.PaymentACK)
    return target;
  }
  
  int PaymentACK::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required .payments.Payment payment = 1;
      if (has_payment()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->payment());
      }
  
      // optional string memo = 2;
      if (has_memo()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->memo());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void PaymentACK::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const PaymentACK* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const PaymentACK*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void PaymentACK::MergeFrom(const PaymentACK& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_payment()) {
        mutable_payment()->::payments::Payment::MergeFrom(from.payment());
      }
      if (from.has_memo()) {
        set_memo(from.memo());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void PaymentACK::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void PaymentACK::CopyFrom(const PaymentACK& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool PaymentACK::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
    if (has_payment()) {
      if (!this->payment().IsInitialized()) return false;
    }
    return true;
  }
  
  void PaymentACK::Swap(PaymentACK* other) {
    if (other != this) {
      std::swap(payment_, other->payment_);
      std::swap(memo_, other->memo_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata PaymentACK::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = PaymentACK_descriptor_;
    metadata.reflection = PaymentACK_reflection_;
    return metadata;
  }
  
  
  // @@protoc_insertion_point(namespace_scope)
  
  }  // namespace payments
  
  // @@protoc_insertion_point(global_scope)
  