#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "paymentrequest.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.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>

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;

}  

void protobuf_AssignDesc_paymentrequest_2eproto() GOOGLE_ATTRIBUTE_COLD;
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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Output_descriptor_,
      Output::default_instance_,
      Output_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, _has_bits_[0]),
      -1,
      -1,
      sizeof(Output),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      PaymentDetails_descriptor_,
      PaymentDetails::default_instance_,
      PaymentDetails_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, _has_bits_[0]),
      -1,
      -1,
      sizeof(PaymentDetails),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      PaymentRequest_descriptor_,
      PaymentRequest::default_instance_,
      PaymentRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, _has_bits_[0]),
      -1,
      -1,
      sizeof(PaymentRequest),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, _internal_metadata_),
      -1);
  X509Certificates_descriptor_ = file->message_type(3);
  static const int X509Certificates_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, certificate_),
  };
  X509Certificates_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      X509Certificates_descriptor_,
      X509Certificates::default_instance_,
      X509Certificates_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, _has_bits_[0]),
      -1,
      -1,
      sizeof(X509Certificates),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Payment_descriptor_,
      Payment::default_instance_,
      Payment_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, _has_bits_[0]),
      -1,
      -1,
      sizeof(Payment),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      PaymentACK_descriptor_,
      PaymentACK::default_instance_,
      PaymentACK_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, _has_bits_[0]),
      -1,
      -1,
      sizeof(PaymentACK),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, _internal_metadata_),
      -1);
}

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&) GOOGLE_ATTRIBUTE_COLD;
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());
}

}  

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() GOOGLE_ATTRIBUTE_COLD;
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\036org.liberta.protocols.payment"
    "sB\006Protos", 649);
  ::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);
}

struct StaticDescriptorInitializer_paymentrequest_2eproto {
  StaticDescriptorInitializer_paymentrequest_2eproto() {
    protobuf_AddDesc_paymentrequest_2eproto();
  }
} static_descriptor_initializer_paymentrequest_2eproto_;

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Output::kAmountFieldNumber;
const int Output::kScriptFieldNumber;
#endif  

Output::Output()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void Output::InitAsDefaultInstance() {
}

Output::Output(const Output& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void Output::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  amount_ = GOOGLE_ULONGLONG(0);
  script_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Output::~Output() {

  SharedDtor();
}

void Output::SharedDtor() {
  script_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  Output* n = new Output;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Output::Clear() {

  if (_has_bits_[0 / 32] & 3u) {
    amount_ = GOOGLE_ULONGLONG(0);
    if (has_script()) {
      script_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Output::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  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)) {

      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;
      }

      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:

  return true;
failure:

  return false;
#undef DO_
}

void Output::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_amount()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->amount(), output);
  }

  if (has_script()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      2, this->script(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* Output::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_amount()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->amount(), target);
  }

  if (has_script()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        2, this->script(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int Output::ByteSize() const {

  int total_size = 0;

  if (has_script()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::BytesSize(
        this->script());
  }

  if (has_amount()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt64Size(
        this->amount());
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Output* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Output>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void Output::MergeFrom(const Output& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_amount()) {
      set_amount(from.amount());
    }
    if (from.has_script()) {
      set_has_script();
      script_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.script_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    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) return;
  InternalSwap(other);
}
void Output::InternalSwap(Output* other) {
  std::swap(amount_, other->amount_);
  script_.Swap(&other->script_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool Output::has_amount() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Output::set_has_amount() {
  _has_bits_[0] |= 0x00000001u;
}
void Output::clear_has_amount() {
  _has_bits_[0] &= ~0x00000001u;
}
void Output::clear_amount() {
  amount_ = GOOGLE_ULONGLONG(0);
  clear_has_amount();
}
 ::google::protobuf::uint64 Output::amount() const {

  return amount_;
}
 void Output::set_amount(::google::protobuf::uint64 value) {
  set_has_amount();
  amount_ = value;

}

bool Output::has_script() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Output::set_has_script() {
  _has_bits_[0] |= 0x00000002u;
}
void Output::clear_has_script() {
  _has_bits_[0] &= ~0x00000002u;
}
void Output::clear_script() {
  script_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_script();
}
 const ::std::string& Output::script() const {

  return script_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Output::set_script(const ::std::string& value) {
  set_has_script();
  script_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Output::set_script(const char* value) {
  set_has_script();
  script_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Output::set_script(const void* value, size_t size) {
  set_has_script();
  script_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Output::mutable_script() {
  set_has_script();

  return script_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Output::release_script() {

  clear_has_script();
  return script_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Output::set_allocated_script(::std::string* script) {
  if (script != NULL) {
    set_has_script();
  } else {
    clear_has_script();
  }
  script_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), script);

}

#endif  

::std::string* PaymentDetails::_default_network_ = NULL;
#if !defined(_MSC_VER) || _MSC_VER >= 1900
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  

PaymentDetails::PaymentDetails()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void PaymentDetails::InitAsDefaultInstance() {
}

PaymentDetails::PaymentDetails(const PaymentDetails& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void PaymentDetails::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  network_.UnsafeSetDefault(_default_network_);
  time_ = GOOGLE_ULONGLONG(0);
  expires_ = GOOGLE_ULONGLONG(0);
  memo_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  payment_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  merchant_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PaymentDetails::~PaymentDetails() {

  SharedDtor();
}

void PaymentDetails::SharedDtor() {
  network_.DestroyNoArena(_default_network_);
  memo_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  payment_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  merchant_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  PaymentDetails* n = new PaymentDetails;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void PaymentDetails::Clear() {

#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(PaymentDetails, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<PaymentDetails*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  if (_has_bits_[0 / 32] & 125u) {
    ZR_(time_, expires_);
    if (has_network()) {
      network_.ClearToDefaultNoArena(_default_network_);
    }
    if (has_memo()) {
      memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_payment_url()) {
      payment_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_merchant_data()) {
      merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }

#undef ZR_HELPER_
#undef ZR_

  outputs_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool PaymentDetails::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  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)) {

      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,
            "payments.PaymentDetails.network");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_outputs;
        break;
      }

      case 2: {
        if (tag == 18) {
         parse_outputs:
          DO_(input->IncrementRecursionDepth());
         parse_loop_outputs:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_outputs()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_loop_outputs;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectTag(24)) goto parse_time;
        break;
      }

      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;
      }

      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;
      }

      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,
            "payments.PaymentDetails.memo");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(50)) goto parse_payment_url;
        break;
      }

      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,
            "payments.PaymentDetails.payment_url");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(58)) goto parse_merchant_data;
        break;
      }

      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:

  return true;
failure:

  return false;
#undef DO_
}

void PaymentDetails::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_network()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->network().data(), this->network().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentDetails.network");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->network(), output);
  }

  for (unsigned int i = 0, n = this->outputs_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, this->outputs(i), output);
  }

  if (has_time()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->time(), output);
  }

  if (has_expires()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->expires(), output);
  }

  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentDetails.memo");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      5, this->memo(), output);
  }

  if (has_payment_url()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->payment_url().data(), this->payment_url().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentDetails.payment_url");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      6, this->payment_url(), output);
  }

  if (has_merchant_data()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      7, this->merchant_data(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* PaymentDetails::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_network()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->network().data(), this->network().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentDetails.network");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->network(), target);
  }

  for (unsigned int i = 0, n = this->outputs_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        2, this->outputs(i), false, target);
  }

  if (has_time()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->time(), target);
  }

  if (has_expires()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->expires(), target);
  }

  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentDetails.memo");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        5, this->memo(), target);
  }

  if (has_payment_url()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->payment_url().data(), this->payment_url().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentDetails.payment_url");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        6, this->payment_url(), target);
  }

  if (has_merchant_data()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        7, this->merchant_data(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int PaymentDetails::ByteSize() const {

  int total_size = 0;

  if (has_time()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt64Size(
        this->time());
  }
  if (_has_bits_[0 / 32] & 121u) {

    if (has_network()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->network());
    }

    if (has_expires()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt64Size(
          this->expires());
    }

    if (has_memo()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->memo());
    }

    if (has_payment_url()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->payment_url());
    }

    if (has_merchant_data()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->merchant_data());
    }

  }

  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 (_internal_metadata_.have_unknown_fields()) {
    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) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const PaymentDetails* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const PaymentDetails>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void PaymentDetails::MergeFrom(const PaymentDetails& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  outputs_.MergeFrom(from.outputs_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_network()) {
      set_has_network();
      network_.AssignWithDefault(_default_network_, from.network_);
    }
    if (from.has_time()) {
      set_time(from.time());
    }
    if (from.has_expires()) {
      set_expires(from.expires());
    }
    if (from.has_memo()) {
      set_has_memo();
      memo_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.memo_);
    }
    if (from.has_payment_url()) {
      set_has_payment_url();
      payment_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.payment_url_);
    }
    if (from.has_merchant_data()) {
      set_has_merchant_data();
      merchant_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.merchant_data_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    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) return;
  InternalSwap(other);
}
void PaymentDetails::InternalSwap(PaymentDetails* other) {
  network_.Swap(&other->network_);
  outputs_.UnsafeArenaSwap(&other->outputs_);
  std::swap(time_, other->time_);
  std::swap(expires_, other->expires_);
  memo_.Swap(&other->memo_);
  payment_url_.Swap(&other->payment_url_);
  merchant_data_.Swap(&other->merchant_data_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool PaymentDetails::has_network() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void PaymentDetails::set_has_network() {
  _has_bits_[0] |= 0x00000001u;
}
void PaymentDetails::clear_has_network() {
  _has_bits_[0] &= ~0x00000001u;
}
void PaymentDetails::clear_network() {
  network_.ClearToDefaultNoArena(_default_network_);
  clear_has_network();
}
 const ::std::string& PaymentDetails::network() const {

  return network_.GetNoArena(_default_network_);
}
 void PaymentDetails::set_network(const ::std::string& value) {
  set_has_network();
  network_.SetNoArena(_default_network_, value);

}
 void PaymentDetails::set_network(const char* value) {
  set_has_network();
  network_.SetNoArena(_default_network_, ::std::string(value));

}
 void PaymentDetails::set_network(const char* value, size_t size) {
  set_has_network();
  network_.SetNoArena(_default_network_,
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentDetails::mutable_network() {
  set_has_network();

  return network_.MutableNoArena(_default_network_);
}
 ::std::string* PaymentDetails::release_network() {

  clear_has_network();
  return network_.ReleaseNoArena(_default_network_);
}
 void PaymentDetails::set_allocated_network(::std::string* network) {
  if (network != NULL) {
    set_has_network();
  } else {
    clear_has_network();
  }
  network_.SetAllocatedNoArena(_default_network_, network);

}

int PaymentDetails::outputs_size() const {
  return outputs_.size();
}
void PaymentDetails::clear_outputs() {
  outputs_.Clear();
}
const ::payments::Output& PaymentDetails::outputs(int index) const {

  return outputs_.Get(index);
}
::payments::Output* PaymentDetails::mutable_outputs(int index) {

  return outputs_.Mutable(index);
}
::payments::Output* PaymentDetails::add_outputs() {

  return outputs_.Add();
}
::google::protobuf::RepeatedPtrField< ::payments::Output >*
PaymentDetails::mutable_outputs() {

  return &outputs_;
}
const ::google::protobuf::RepeatedPtrField< ::payments::Output >&
PaymentDetails::outputs() const {

  return outputs_;
}

bool PaymentDetails::has_time() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void PaymentDetails::set_has_time() {
  _has_bits_[0] |= 0x00000004u;
}
void PaymentDetails::clear_has_time() {
  _has_bits_[0] &= ~0x00000004u;
}
void PaymentDetails::clear_time() {
  time_ = GOOGLE_ULONGLONG(0);
  clear_has_time();
}
 ::google::protobuf::uint64 PaymentDetails::time() const {

  return time_;
}
 void PaymentDetails::set_time(::google::protobuf::uint64 value) {
  set_has_time();
  time_ = value;

}

bool PaymentDetails::has_expires() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void PaymentDetails::set_has_expires() {
  _has_bits_[0] |= 0x00000008u;
}
void PaymentDetails::clear_has_expires() {
  _has_bits_[0] &= ~0x00000008u;
}
void PaymentDetails::clear_expires() {
  expires_ = GOOGLE_ULONGLONG(0);
  clear_has_expires();
}
 ::google::protobuf::uint64 PaymentDetails::expires() const {

  return expires_;
}
 void PaymentDetails::set_expires(::google::protobuf::uint64 value) {
  set_has_expires();
  expires_ = value;

}

bool PaymentDetails::has_memo() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void PaymentDetails::set_has_memo() {
  _has_bits_[0] |= 0x00000010u;
}
void PaymentDetails::clear_has_memo() {
  _has_bits_[0] &= ~0x00000010u;
}
void PaymentDetails::clear_memo() {
  memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_memo();
}
 const ::std::string& PaymentDetails::memo() const {

  return memo_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_memo(const ::std::string& value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void PaymentDetails::set_memo(const char* value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void PaymentDetails::set_memo(const char* value, size_t size) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentDetails::mutable_memo() {
  set_has_memo();

  return memo_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentDetails::release_memo() {

  clear_has_memo();
  return memo_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_allocated_memo(::std::string* memo) {
  if (memo != NULL) {
    set_has_memo();
  } else {
    clear_has_memo();
  }
  memo_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), memo);

}

bool PaymentDetails::has_payment_url() const {
  return (_has_bits_[0] & 0x00000020u) != 0;
}
void PaymentDetails::set_has_payment_url() {
  _has_bits_[0] |= 0x00000020u;
}
void PaymentDetails::clear_has_payment_url() {
  _has_bits_[0] &= ~0x00000020u;
}
void PaymentDetails::clear_payment_url() {
  payment_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_payment_url();
}
 const ::std::string& PaymentDetails::payment_url() const {

  return payment_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_payment_url(const ::std::string& value) {
  set_has_payment_url();
  payment_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void PaymentDetails::set_payment_url(const char* value) {
  set_has_payment_url();
  payment_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void PaymentDetails::set_payment_url(const char* value, size_t size) {
  set_has_payment_url();
  payment_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentDetails::mutable_payment_url() {
  set_has_payment_url();

  return payment_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentDetails::release_payment_url() {

  clear_has_payment_url();
  return payment_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_allocated_payment_url(::std::string* payment_url) {
  if (payment_url != NULL) {
    set_has_payment_url();
  } else {
    clear_has_payment_url();
  }
  payment_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), payment_url);

}

bool PaymentDetails::has_merchant_data() const {
  return (_has_bits_[0] & 0x00000040u) != 0;
}
void PaymentDetails::set_has_merchant_data() {
  _has_bits_[0] |= 0x00000040u;
}
void PaymentDetails::clear_has_merchant_data() {
  _has_bits_[0] &= ~0x00000040u;
}
void PaymentDetails::clear_merchant_data() {
  merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_merchant_data();
}
 const ::std::string& PaymentDetails::merchant_data() const {

  return merchant_data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_merchant_data(const ::std::string& value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void PaymentDetails::set_merchant_data(const char* value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void PaymentDetails::set_merchant_data(const void* value, size_t size) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentDetails::mutable_merchant_data() {
  set_has_merchant_data();

  return merchant_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentDetails::release_merchant_data() {

  clear_has_merchant_data();
  return merchant_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_allocated_merchant_data(::std::string* merchant_data) {
  if (merchant_data != NULL) {
    set_has_merchant_data();
  } else {
    clear_has_merchant_data();
  }
  merchant_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), merchant_data);

}

#endif  

::std::string* PaymentRequest::_default_pki_type_ = NULL;
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PaymentRequest::kPaymentDetailsVersionFieldNumber;
const int PaymentRequest::kPkiTypeFieldNumber;
const int PaymentRequest::kPkiDataFieldNumber;
const int PaymentRequest::kSerializedPaymentDetailsFieldNumber;
const int PaymentRequest::kSignatureFieldNumber;
#endif  

PaymentRequest::PaymentRequest()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void PaymentRequest::InitAsDefaultInstance() {
}

PaymentRequest::PaymentRequest(const PaymentRequest& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void PaymentRequest::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  payment_details_version_ = 1u;
  pki_type_.UnsafeSetDefault(_default_pki_type_);
  pki_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  serialized_payment_details_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  signature_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PaymentRequest::~PaymentRequest() {

  SharedDtor();
}

void PaymentRequest::SharedDtor() {
  pki_type_.DestroyNoArena(_default_pki_type_);
  pki_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  serialized_payment_details_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  signature_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  PaymentRequest* n = new PaymentRequest;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void PaymentRequest::Clear() {

  if (_has_bits_[0 / 32] & 31u) {
    payment_details_version_ = 1u;
    if (has_pki_type()) {
      pki_type_.ClearToDefaultNoArena(_default_pki_type_);
    }
    if (has_pki_data()) {
      pki_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_serialized_payment_details()) {
      serialized_payment_details_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_signature()) {
      signature_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool PaymentRequest::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  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)) {

      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;
      }

      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,
            "payments.PaymentRequest.pki_type");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_pki_data;
        break;
      }

      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;
      }

      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;
      }

      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:

  return true;
failure:

  return false;
#undef DO_
}

void PaymentRequest::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_payment_details_version()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->payment_details_version(), output);
  }

  if (has_pki_type()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->pki_type().data(), this->pki_type().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentRequest.pki_type");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->pki_type(), output);
  }

  if (has_pki_data()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      3, this->pki_data(), output);
  }

  if (has_serialized_payment_details()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      4, this->serialized_payment_details(), output);
  }

  if (has_signature()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      5, this->signature(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* PaymentRequest::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_payment_details_version()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->payment_details_version(), target);
  }

  if (has_pki_type()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->pki_type().data(), this->pki_type().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentRequest.pki_type");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->pki_type(), target);
  }

  if (has_pki_data()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        3, this->pki_data(), target);
  }

  if (has_serialized_payment_details()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        4, this->serialized_payment_details(), target);
  }

  if (has_signature()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        5, this->signature(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int PaymentRequest::ByteSize() const {

  int total_size = 0;

  if (has_serialized_payment_details()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::BytesSize(
        this->serialized_payment_details());
  }
  if (_has_bits_[0 / 32] & 23u) {

    if (has_payment_details_version()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->payment_details_version());
    }

    if (has_pki_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->pki_type());
    }

    if (has_pki_data()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->pki_data());
    }

    if (has_signature()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->signature());
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    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) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const PaymentRequest* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const PaymentRequest>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void PaymentRequest::MergeFrom(const PaymentRequest& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  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_has_pki_type();
      pki_type_.AssignWithDefault(_default_pki_type_, from.pki_type_);
    }
    if (from.has_pki_data()) {
      set_has_pki_data();
      pki_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.pki_data_);
    }
    if (from.has_serialized_payment_details()) {
      set_has_serialized_payment_details();
      serialized_payment_details_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialized_payment_details_);
    }
    if (from.has_signature()) {
      set_has_signature();
      signature_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.signature_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    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) return;
  InternalSwap(other);
}
void PaymentRequest::InternalSwap(PaymentRequest* other) {
  std::swap(payment_details_version_, other->payment_details_version_);
  pki_type_.Swap(&other->pki_type_);
  pki_data_.Swap(&other->pki_data_);
  serialized_payment_details_.Swap(&other->serialized_payment_details_);
  signature_.Swap(&other->signature_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool PaymentRequest::has_payment_details_version() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void PaymentRequest::set_has_payment_details_version() {
  _has_bits_[0] |= 0x00000001u;
}
void PaymentRequest::clear_has_payment_details_version() {
  _has_bits_[0] &= ~0x00000001u;
}
void PaymentRequest::clear_payment_details_version() {
  payment_details_version_ = 1u;
  clear_has_payment_details_version();
}
 ::google::protobuf::uint32 PaymentRequest::payment_details_version() const {

  return payment_details_version_;
}
 void PaymentRequest::set_payment_details_version(::google::protobuf::uint32 value) {
  set_has_payment_details_version();
  payment_details_version_ = value;

}

bool PaymentRequest::has_pki_type() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void PaymentRequest::set_has_pki_type() {
  _has_bits_[0] |= 0x00000002u;
}
void PaymentRequest::clear_has_pki_type() {
  _has_bits_[0] &= ~0x00000002u;
}
void PaymentRequest::clear_pki_type() {
  pki_type_.ClearToDefaultNoArena(_default_pki_type_);
  clear_has_pki_type();
}
 const ::std::string& PaymentRequest::pki_type() const {

  return pki_type_.GetNoArena(_default_pki_type_);
}
 void PaymentRequest::set_pki_type(const ::std::string& value) {
  set_has_pki_type();
  pki_type_.SetNoArena(_default_pki_type_, value);

}
 void PaymentRequest::set_pki_type(const char* value) {
  set_has_pki_type();
  pki_type_.SetNoArena(_default_pki_type_, ::std::string(value));

}
 void PaymentRequest::set_pki_type(const char* value, size_t size) {
  set_has_pki_type();
  pki_type_.SetNoArena(_default_pki_type_,
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentRequest::mutable_pki_type() {
  set_has_pki_type();

  return pki_type_.MutableNoArena(_default_pki_type_);
}
 ::std::string* PaymentRequest::release_pki_type() {

  clear_has_pki_type();
  return pki_type_.ReleaseNoArena(_default_pki_type_);
}
 void PaymentRequest::set_allocated_pki_type(::std::string* pki_type) {
  if (pki_type != NULL) {
    set_has_pki_type();
  } else {
    clear_has_pki_type();
  }
  pki_type_.SetAllocatedNoArena(_default_pki_type_, pki_type);

}

bool PaymentRequest::has_pki_data() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void PaymentRequest::set_has_pki_data() {
  _has_bits_[0] |= 0x00000004u;
}
void PaymentRequest::clear_has_pki_data() {
  _has_bits_[0] &= ~0x00000004u;
}
void PaymentRequest::clear_pki_data() {
  pki_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_pki_data();
}
 const ::std::string& PaymentRequest::pki_data() const {

  return pki_data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_pki_data(const ::std::string& value) {
  set_has_pki_data();
  pki_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void PaymentRequest::set_pki_data(const char* value) {
  set_has_pki_data();
  pki_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void PaymentRequest::set_pki_data(const void* value, size_t size) {
  set_has_pki_data();
  pki_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentRequest::mutable_pki_data() {
  set_has_pki_data();

  return pki_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentRequest::release_pki_data() {

  clear_has_pki_data();
  return pki_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_allocated_pki_data(::std::string* pki_data) {
  if (pki_data != NULL) {
    set_has_pki_data();
  } else {
    clear_has_pki_data();
  }
  pki_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), pki_data);

}

bool PaymentRequest::has_serialized_payment_details() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void PaymentRequest::set_has_serialized_payment_details() {
  _has_bits_[0] |= 0x00000008u;
}
void PaymentRequest::clear_has_serialized_payment_details() {
  _has_bits_[0] &= ~0x00000008u;
}
void PaymentRequest::clear_serialized_payment_details() {
  serialized_payment_details_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_serialized_payment_details();
}
 const ::std::string& PaymentRequest::serialized_payment_details() const {

  return serialized_payment_details_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_serialized_payment_details(const ::std::string& value) {
  set_has_serialized_payment_details();
  serialized_payment_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void PaymentRequest::set_serialized_payment_details(const char* value) {
  set_has_serialized_payment_details();
  serialized_payment_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void PaymentRequest::set_serialized_payment_details(const void* value, size_t size) {
  set_has_serialized_payment_details();
  serialized_payment_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentRequest::mutable_serialized_payment_details() {
  set_has_serialized_payment_details();

  return serialized_payment_details_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentRequest::release_serialized_payment_details() {

  clear_has_serialized_payment_details();
  return serialized_payment_details_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_allocated_serialized_payment_details(::std::string* serialized_payment_details) {
  if (serialized_payment_details != NULL) {
    set_has_serialized_payment_details();
  } else {
    clear_has_serialized_payment_details();
  }
  serialized_payment_details_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialized_payment_details);

}

bool PaymentRequest::has_signature() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void PaymentRequest::set_has_signature() {
  _has_bits_[0] |= 0x00000010u;
}
void PaymentRequest::clear_has_signature() {
  _has_bits_[0] &= ~0x00000010u;
}
void PaymentRequest::clear_signature() {
  signature_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_signature();
}
 const ::std::string& PaymentRequest::signature() const {

  return signature_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_signature(const ::std::string& value) {
  set_has_signature();
  signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void PaymentRequest::set_signature(const char* value) {
  set_has_signature();
  signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void PaymentRequest::set_signature(const void* value, size_t size) {
  set_has_signature();
  signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentRequest::mutable_signature() {
  set_has_signature();

  return signature_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentRequest::release_signature() {

  clear_has_signature();
  return signature_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_allocated_signature(::std::string* signature) {
  if (signature != NULL) {
    set_has_signature();
  } else {
    clear_has_signature();
  }
  signature_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), signature);

}

#endif  

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int X509Certificates::kCertificateFieldNumber;
#endif  

X509Certificates::X509Certificates()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void X509Certificates::InitAsDefaultInstance() {
}

X509Certificates::X509Certificates(const X509Certificates& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void X509Certificates::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

X509Certificates::~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(::google::protobuf::Arena* arena) const {
  X509Certificates* n = new X509Certificates;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void X509Certificates::Clear() {

  certificate_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool X509Certificates::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  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)) {

      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:

  return true;
failure:

  return false;
#undef DO_
}

void X509Certificates::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  for (int i = 0; i < this->certificate_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      1, this->certificate(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* X509Certificates::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  for (int i = 0; i < this->certificate_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteBytesToArray(1, this->certificate(i), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int X509Certificates::ByteSize() const {

  int total_size = 0;

  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 (_internal_metadata_.have_unknown_fields()) {
    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) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const X509Certificates* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const X509Certificates>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void X509Certificates::MergeFrom(const X509Certificates& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  certificate_.MergeFrom(from.certificate_);
  if (from._internal_metadata_.have_unknown_fields()) {
    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) return;
  InternalSwap(other);
}
void X509Certificates::InternalSwap(X509Certificates* other) {
  certificate_.UnsafeArenaSwap(&other->certificate_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

int X509Certificates::certificate_size() const {
  return certificate_.size();
}
void X509Certificates::clear_certificate() {
  certificate_.Clear();
}
 const ::std::string& X509Certificates::certificate(int index) const {

  return certificate_.Get(index);
}
 ::std::string* X509Certificates::mutable_certificate(int index) {

  return certificate_.Mutable(index);
}
 void X509Certificates::set_certificate(int index, const ::std::string& value) {

  certificate_.Mutable(index)->assign(value);
}
 void X509Certificates::set_certificate(int index, const char* value) {
  certificate_.Mutable(index)->assign(value);

}
 void X509Certificates::set_certificate(int index, const void* value, size_t size) {
  certificate_.Mutable(index)->assign(
    reinterpret_cast<const char*>(value), size);

}
 ::std::string* X509Certificates::add_certificate() {

  return certificate_.Add();
}
 void X509Certificates::add_certificate(const ::std::string& value) {
  certificate_.Add()->assign(value);

}
 void X509Certificates::add_certificate(const char* value) {
  certificate_.Add()->assign(value);

}
 void X509Certificates::add_certificate(const void* value, size_t size) {
  certificate_.Add()->assign(reinterpret_cast<const char*>(value), size);

}
 const ::google::protobuf::RepeatedPtrField< ::std::string>&
X509Certificates::certificate() const {

  return certificate_;
}
 ::google::protobuf::RepeatedPtrField< ::std::string>*
X509Certificates::mutable_certificate() {

  return &certificate_;
}

#endif  

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Payment::kMerchantDataFieldNumber;
const int Payment::kTransactionsFieldNumber;
const int Payment::kRefundToFieldNumber;
const int Payment::kMemoFieldNumber;
#endif  

Payment::Payment()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void Payment::InitAsDefaultInstance() {
}

Payment::Payment(const Payment& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void Payment::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  merchant_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  memo_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Payment::~Payment() {

  SharedDtor();
}

void Payment::SharedDtor() {
  merchant_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  memo_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  Payment* n = new Payment;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Payment::Clear() {

  if (_has_bits_[0 / 32] & 9u) {
    if (has_merchant_data()) {
      merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_memo()) {
      memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  transactions_.Clear();
  refund_to_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Payment::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  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)) {

      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;
      }

      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;
      }

      case 3: {
        if (tag == 26) {
         parse_refund_to:
          DO_(input->IncrementRecursionDepth());
         parse_loop_refund_to:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_refund_to()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_loop_refund_to;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectTag(34)) goto parse_memo;
        break;
      }

      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,
            "payments.Payment.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:

  return true;
failure:

  return false;
#undef DO_
}

void Payment::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_merchant_data()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      1, this->merchant_data(), output);
  }

  for (int i = 0; i < this->transactions_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      2, this->transactions(i), output);
  }

  for (unsigned int i = 0, n = this->refund_to_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->refund_to(i), output);
  }

  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.Payment.memo");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      4, this->memo(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* Payment::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_merchant_data()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        1, this->merchant_data(), target);
  }

  for (int i = 0; i < this->transactions_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteBytesToArray(2, this->transactions(i), target);
  }

  for (unsigned int i = 0, n = this->refund_to_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        3, this->refund_to(i), false, target);
  }

  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.Payment.memo");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        4, this->memo(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int Payment::ByteSize() const {

  int total_size = 0;

  if (_has_bits_[0 / 32] & 9u) {

    if (has_merchant_data()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->merchant_data());
    }

    if (has_memo()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->memo());
    }

  }

  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));
  }

  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 (_internal_metadata_.have_unknown_fields()) {
    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) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Payment* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Payment>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void Payment::MergeFrom(const Payment& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  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_has_merchant_data();
      merchant_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.merchant_data_);
    }
    if (from.has_memo()) {
      set_has_memo();
      memo_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.memo_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    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) return;
  InternalSwap(other);
}
void Payment::InternalSwap(Payment* other) {
  merchant_data_.Swap(&other->merchant_data_);
  transactions_.UnsafeArenaSwap(&other->transactions_);
  refund_to_.UnsafeArenaSwap(&other->refund_to_);
  memo_.Swap(&other->memo_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool Payment::has_merchant_data() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Payment::set_has_merchant_data() {
  _has_bits_[0] |= 0x00000001u;
}
void Payment::clear_has_merchant_data() {
  _has_bits_[0] &= ~0x00000001u;
}
void Payment::clear_merchant_data() {
  merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_merchant_data();
}
 const ::std::string& Payment::merchant_data() const {

  return merchant_data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_merchant_data(const ::std::string& value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Payment::set_merchant_data(const char* value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Payment::set_merchant_data(const void* value, size_t size) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Payment::mutable_merchant_data() {
  set_has_merchant_data();

  return merchant_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Payment::release_merchant_data() {

  clear_has_merchant_data();
  return merchant_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_allocated_merchant_data(::std::string* merchant_data) {
  if (merchant_data != NULL) {
    set_has_merchant_data();
  } else {
    clear_has_merchant_data();
  }
  merchant_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), merchant_data);

}

int Payment::transactions_size() const {
  return transactions_.size();
}
void Payment::clear_transactions() {
  transactions_.Clear();
}
 const ::std::string& Payment::transactions(int index) const {

  return transactions_.Get(index);
}
 ::std::string* Payment::mutable_transactions(int index) {

  return transactions_.Mutable(index);
}
 void Payment::set_transactions(int index, const ::std::string& value) {

  transactions_.Mutable(index)->assign(value);
}
 void Payment::set_transactions(int index, const char* value) {
  transactions_.Mutable(index)->assign(value);

}
 void Payment::set_transactions(int index, const void* value, size_t size) {
  transactions_.Mutable(index)->assign(
    reinterpret_cast<const char*>(value), size);

}
 ::std::string* Payment::add_transactions() {

  return transactions_.Add();
}
 void Payment::add_transactions(const ::std::string& value) {
  transactions_.Add()->assign(value);

}
 void Payment::add_transactions(const char* value) {
  transactions_.Add()->assign(value);

}
 void Payment::add_transactions(const void* value, size_t size) {
  transactions_.Add()->assign(reinterpret_cast<const char*>(value), size);

}
 const ::google::protobuf::RepeatedPtrField< ::std::string>&
Payment::transactions() const {

  return transactions_;
}
 ::google::protobuf::RepeatedPtrField< ::std::string>*
Payment::mutable_transactions() {

  return &transactions_;
}

int Payment::refund_to_size() const {
  return refund_to_.size();
}
void Payment::clear_refund_to() {
  refund_to_.Clear();
}
const ::payments::Output& Payment::refund_to(int index) const {

  return refund_to_.Get(index);
}
::payments::Output* Payment::mutable_refund_to(int index) {

  return refund_to_.Mutable(index);
}
::payments::Output* Payment::add_refund_to() {

  return refund_to_.Add();
}
::google::protobuf::RepeatedPtrField< ::payments::Output >*
Payment::mutable_refund_to() {

  return &refund_to_;
}
const ::google::protobuf::RepeatedPtrField< ::payments::Output >&
Payment::refund_to() const {

  return refund_to_;
}

bool Payment::has_memo() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void Payment::set_has_memo() {
  _has_bits_[0] |= 0x00000008u;
}
void Payment::clear_has_memo() {
  _has_bits_[0] &= ~0x00000008u;
}
void Payment::clear_memo() {
  memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_memo();
}
 const ::std::string& Payment::memo() const {

  return memo_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_memo(const ::std::string& value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Payment::set_memo(const char* value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Payment::set_memo(const char* value, size_t size) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Payment::mutable_memo() {
  set_has_memo();

  return memo_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Payment::release_memo() {

  clear_has_memo();
  return memo_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_allocated_memo(::std::string* memo) {
  if (memo != NULL) {
    set_has_memo();
  } else {
    clear_has_memo();
  }
  memo_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), memo);

}

#endif  

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PaymentACK::kPaymentFieldNumber;
const int PaymentACK::kMemoFieldNumber;
#endif  

PaymentACK::PaymentACK()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void PaymentACK::InitAsDefaultInstance() {
  payment_ = const_cast< ::payments::Payment*>(&::payments::Payment::default_instance());
}

PaymentACK::PaymentACK(const PaymentACK& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void PaymentACK::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  payment_ = NULL;
  memo_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PaymentACK::~PaymentACK() {

  SharedDtor();
}

void PaymentACK::SharedDtor() {
  memo_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  PaymentACK* n = new PaymentACK;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void PaymentACK::Clear() {

  if (_has_bits_[0 / 32] & 3u) {
    if (has_payment()) {
      if (payment_ != NULL) payment_->::payments::Payment::Clear();
    }
    if (has_memo()) {
      memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool PaymentACK::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  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)) {

      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;
      }

      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,
            "payments.PaymentACK.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:

  return true;
failure:

  return false;
#undef DO_
}

void PaymentACK::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_payment()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, *this->payment_, output);
  }

  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentACK.memo");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->memo(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* PaymentACK::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_payment()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        1, *this->payment_, false, target);
  }

  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentACK.memo");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->memo(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int PaymentACK::ByteSize() const {

  int total_size = 0;

  if (has_payment()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        *this->payment_);
  }

  if (has_memo()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->memo());
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const PaymentACK* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const PaymentACK>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void PaymentACK::MergeFrom(const PaymentACK& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  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_has_memo();
      memo_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.memo_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    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) return;
  InternalSwap(other);
}
void PaymentACK::InternalSwap(PaymentACK* other) {
  std::swap(payment_, other->payment_);
  memo_.Swap(&other->memo_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool PaymentACK::has_payment() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void PaymentACK::set_has_payment() {
  _has_bits_[0] |= 0x00000001u;
}
void PaymentACK::clear_has_payment() {
  _has_bits_[0] &= ~0x00000001u;
}
void PaymentACK::clear_payment() {
  if (payment_ != NULL) payment_->::payments::Payment::Clear();
  clear_has_payment();
}
const ::payments::Payment& PaymentACK::payment() const {

  return payment_ != NULL ? *payment_ : *default_instance_->payment_;
}
::payments::Payment* PaymentACK::mutable_payment() {
  set_has_payment();
  if (payment_ == NULL) {
    payment_ = new ::payments::Payment;
  }

  return payment_;
}
::payments::Payment* PaymentACK::release_payment() {

  clear_has_payment();
  ::payments::Payment* temp = payment_;
  payment_ = NULL;
  return temp;
}
void PaymentACK::set_allocated_payment(::payments::Payment* payment) {
  delete payment_;
  payment_ = payment;
  if (payment) {
    set_has_payment();
  } else {
    clear_has_payment();
  }

}

bool PaymentACK::has_memo() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void PaymentACK::set_has_memo() {
  _has_bits_[0] |= 0x00000002u;
}
void PaymentACK::clear_has_memo() {
  _has_bits_[0] &= ~0x00000002u;
}
void PaymentACK::clear_memo() {
  memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_memo();
}
 const ::std::string& PaymentACK::memo() const {

  return memo_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentACK::set_memo(const ::std::string& value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void PaymentACK::set_memo(const char* value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void PaymentACK::set_memo(const char* value, size_t size) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* PaymentACK::mutable_memo() {
  set_has_memo();

  return memo_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentACK::release_memo() {

  clear_has_memo();
  return memo_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentACK::set_allocated_memo(::std::string* memo) {
  if (memo != NULL) {
    set_has_memo();
  } else {
    clear_has_memo();
  }
  memo_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), memo);

}

#endif  

}
// 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/port.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() GOOGLE_ATTRIBUTE_COLD;
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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Output_descriptor_,
      Output::default_instance_,
      Output_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, _has_bits_[0]),
      -1,
      -1,
      sizeof(Output),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Output, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      PaymentDetails_descriptor_,
      PaymentDetails::default_instance_,
      PaymentDetails_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, _has_bits_[0]),
      -1,
      -1,
      sizeof(PaymentDetails),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentDetails, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      PaymentRequest_descriptor_,
      PaymentRequest::default_instance_,
      PaymentRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, _has_bits_[0]),
      -1,
      -1,
      sizeof(PaymentRequest),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentRequest, _internal_metadata_),
      -1);
  X509Certificates_descriptor_ = file->message_type(3);
  static const int X509Certificates_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, certificate_),
  };
  X509Certificates_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      X509Certificates_descriptor_,
      X509Certificates::default_instance_,
      X509Certificates_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, _has_bits_[0]),
      -1,
      -1,
      sizeof(X509Certificates),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(X509Certificates, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Payment_descriptor_,
      Payment::default_instance_,
      Payment_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, _has_bits_[0]),
      -1,
      -1,
      sizeof(Payment),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Payment, _internal_metadata_),
      -1);
  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_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      PaymentACK_descriptor_,
      PaymentACK::default_instance_,
      PaymentACK_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, _has_bits_[0]),
      -1,
      -1,
      sizeof(PaymentACK),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PaymentACK, _internal_metadata_),
      -1);
}

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&) GOOGLE_ATTRIBUTE_COLD;
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() GOOGLE_ATTRIBUTE_COLD;
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\036org.liberta.protocols.payment"
    "sB\006Protos", 649);
  ::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_;

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Output::kAmountFieldNumber;
const int Output::kScriptFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Output::Output()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:payments.Output)
}

void Output::InitAsDefaultInstance() {
}

Output::Output(const Output& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  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_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Output::~Output() {
  // @@protoc_insertion_point(destructor:payments.Output)
  SharedDtor();
}

void Output::SharedDtor() {
  script_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  Output* n = new Output;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Output::Clear() {
// @@protoc_insertion_point(message_clear_start:payments.Output)
  if (_has_bits_[0 / 32] & 3u) {
    amount_ = GOOGLE_ULONGLONG(0);
    if (has_script()) {
      script_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Output::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(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 (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:payments.Output)
}

::google::protobuf::uint8* Output::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::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 (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:payments.Output)
  return target;
}

int Output::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:payments.Output)
  int total_size = 0;

  // required bytes script = 2;
  if (has_script()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::BytesSize(
        this->script());
  }
  // optional uint64 amount = 1 [default = 0];
  if (has_amount()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt64Size(
        this->amount());
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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) {
// @@protoc_insertion_point(generalized_merge_from_start:payments.Output)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Output* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Output>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:payments.Output)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:payments.Output)
    MergeFrom(*source);
  }
}

void Output::MergeFrom(const Output& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:payments.Output)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_amount()) {
      set_amount(from.amount());
    }
    if (from.has_script()) {
      set_has_script();
      script_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.script_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Output::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:payments.Output)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Output::CopyFrom(const Output& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:payments.Output)
  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) return;
  InternalSwap(other);
}
void Output::InternalSwap(Output* other) {
  std::swap(amount_, other->amount_);
  script_.Swap(&other->script_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// Output

// optional uint64 amount = 1 [default = 0];
bool Output::has_amount() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Output::set_has_amount() {
  _has_bits_[0] |= 0x00000001u;
}
void Output::clear_has_amount() {
  _has_bits_[0] &= ~0x00000001u;
}
void Output::clear_amount() {
  amount_ = GOOGLE_ULONGLONG(0);
  clear_has_amount();
}
 ::google::protobuf::uint64 Output::amount() const {
  // @@protoc_insertion_point(field_get:payments.Output.amount)
  return amount_;
}
 void Output::set_amount(::google::protobuf::uint64 value) {
  set_has_amount();
  amount_ = value;
  // @@protoc_insertion_point(field_set:payments.Output.amount)
}

// required bytes script = 2;
bool Output::has_script() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Output::set_has_script() {
  _has_bits_[0] |= 0x00000002u;
}
void Output::clear_has_script() {
  _has_bits_[0] &= ~0x00000002u;
}
void Output::clear_script() {
  script_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_script();
}
 const ::std::string& Output::script() const {
  // @@protoc_insertion_point(field_get:payments.Output.script)
  return script_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Output::set_script(const ::std::string& value) {
  set_has_script();
  script_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.Output.script)
}
 void Output::set_script(const char* value) {
  set_has_script();
  script_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.Output.script)
}
 void Output::set_script(const void* value, size_t size) {
  set_has_script();
  script_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.Output.script)
}
 ::std::string* Output::mutable_script() {
  set_has_script();
  // @@protoc_insertion_point(field_mutable:payments.Output.script)
  return script_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Output::release_script() {
  // @@protoc_insertion_point(field_release:payments.Output.script)
  clear_has_script();
  return script_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Output::set_allocated_script(::std::string* script) {
  if (script != NULL) {
    set_has_script();
  } else {
    clear_has_script();
  }
  script_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), script);
  // @@protoc_insertion_point(field_set_allocated:payments.Output.script)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

::std::string* PaymentDetails::_default_network_ = NULL;
#if !defined(_MSC_VER) || _MSC_VER >= 1900
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  // !defined(_MSC_VER) || _MSC_VER >= 1900

PaymentDetails::PaymentDetails()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:payments.PaymentDetails)
}

void PaymentDetails::InitAsDefaultInstance() {
}

PaymentDetails::PaymentDetails(const PaymentDetails& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:payments.PaymentDetails)
}

void PaymentDetails::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  network_.UnsafeSetDefault(_default_network_);
  time_ = GOOGLE_ULONGLONG(0);
  expires_ = GOOGLE_ULONGLONG(0);
  memo_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  payment_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  merchant_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PaymentDetails::~PaymentDetails() {
  // @@protoc_insertion_point(destructor:payments.PaymentDetails)
  SharedDtor();
}

void PaymentDetails::SharedDtor() {
  network_.DestroyNoArena(_default_network_);
  memo_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  payment_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  merchant_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  PaymentDetails* n = new PaymentDetails;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void PaymentDetails::Clear() {
// @@protoc_insertion_point(message_clear_start:payments.PaymentDetails)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(PaymentDetails, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<PaymentDetails*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  if (_has_bits_[0 / 32] & 125u) {
    ZR_(time_, expires_);
    if (has_network()) {
      network_.ClearToDefaultNoArena(_default_network_);
    }
    if (has_memo()) {
      memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_payment_url()) {
      payment_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_merchant_data()) {
      merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }

#undef ZR_HELPER_
#undef ZR_

  outputs_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool PaymentDetails::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(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,
            "payments.PaymentDetails.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_(input->IncrementRecursionDepth());
         parse_loop_outputs:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_outputs()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_loop_outputs;
        input->UnsafeDecrementRecursionDepth();
        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,
            "payments.PaymentDetails.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,
            "payments.PaymentDetails.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,
      "payments.PaymentDetails.network");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->network(), output);
  }

  // repeated .payments.Output outputs = 2;
  for (unsigned int i = 0, n = this->outputs_size(); i < n; 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,
      "payments.PaymentDetails.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,
      "payments.PaymentDetails.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 (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:payments.PaymentDetails)
}

::google::protobuf::uint8* PaymentDetails::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::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,
      "payments.PaymentDetails.network");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->network(), target);
  }

  // repeated .payments.Output outputs = 2;
  for (unsigned int i = 0, n = this->outputs_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        2, this->outputs(i), false, 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,
      "payments.PaymentDetails.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,
      "payments.PaymentDetails.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 (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:payments.PaymentDetails)
  return target;
}

int PaymentDetails::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:payments.PaymentDetails)
  int total_size = 0;

  // required uint64 time = 3;
  if (has_time()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt64Size(
        this->time());
  }
  if (_has_bits_[0 / 32] & 121u) {
    // optional string network = 1 [default = "main"];
    if (has_network()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->network());
    }

    // 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 (_internal_metadata_.have_unknown_fields()) {
    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) {
// @@protoc_insertion_point(generalized_merge_from_start:payments.PaymentDetails)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const PaymentDetails* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const PaymentDetails>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:payments.PaymentDetails)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:payments.PaymentDetails)
    MergeFrom(*source);
  }
}

void PaymentDetails::MergeFrom(const PaymentDetails& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:payments.PaymentDetails)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  outputs_.MergeFrom(from.outputs_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_network()) {
      set_has_network();
      network_.AssignWithDefault(_default_network_, from.network_);
    }
    if (from.has_time()) {
      set_time(from.time());
    }
    if (from.has_expires()) {
      set_expires(from.expires());
    }
    if (from.has_memo()) {
      set_has_memo();
      memo_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.memo_);
    }
    if (from.has_payment_url()) {
      set_has_payment_url();
      payment_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.payment_url_);
    }
    if (from.has_merchant_data()) {
      set_has_merchant_data();
      merchant_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.merchant_data_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void PaymentDetails::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:payments.PaymentDetails)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void PaymentDetails::CopyFrom(const PaymentDetails& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:payments.PaymentDetails)
  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) return;
  InternalSwap(other);
}
void PaymentDetails::InternalSwap(PaymentDetails* other) {
  network_.Swap(&other->network_);
  outputs_.UnsafeArenaSwap(&other->outputs_);
  std::swap(time_, other->time_);
  std::swap(expires_, other->expires_);
  memo_.Swap(&other->memo_);
  payment_url_.Swap(&other->payment_url_);
  merchant_data_.Swap(&other->merchant_data_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// PaymentDetails

// optional string network = 1 [default = "main"];
bool PaymentDetails::has_network() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void PaymentDetails::set_has_network() {
  _has_bits_[0] |= 0x00000001u;
}
void PaymentDetails::clear_has_network() {
  _has_bits_[0] &= ~0x00000001u;
}
void PaymentDetails::clear_network() {
  network_.ClearToDefaultNoArena(_default_network_);
  clear_has_network();
}
 const ::std::string& PaymentDetails::network() const {
  // @@protoc_insertion_point(field_get:payments.PaymentDetails.network)
  return network_.GetNoArena(_default_network_);
}
 void PaymentDetails::set_network(const ::std::string& value) {
  set_has_network();
  network_.SetNoArena(_default_network_, value);
  // @@protoc_insertion_point(field_set:payments.PaymentDetails.network)
}
 void PaymentDetails::set_network(const char* value) {
  set_has_network();
  network_.SetNoArena(_default_network_, ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentDetails.network)
}
 void PaymentDetails::set_network(const char* value, size_t size) {
  set_has_network();
  network_.SetNoArena(_default_network_,
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentDetails.network)
}
 ::std::string* PaymentDetails::mutable_network() {
  set_has_network();
  // @@protoc_insertion_point(field_mutable:payments.PaymentDetails.network)
  return network_.MutableNoArena(_default_network_);
}
 ::std::string* PaymentDetails::release_network() {
  // @@protoc_insertion_point(field_release:payments.PaymentDetails.network)
  clear_has_network();
  return network_.ReleaseNoArena(_default_network_);
}
 void PaymentDetails::set_allocated_network(::std::string* network) {
  if (network != NULL) {
    set_has_network();
  } else {
    clear_has_network();
  }
  network_.SetAllocatedNoArena(_default_network_, network);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentDetails.network)
}

// repeated .payments.Output outputs = 2;
int PaymentDetails::outputs_size() const {
  return outputs_.size();
}
void PaymentDetails::clear_outputs() {
  outputs_.Clear();
}
const ::payments::Output& PaymentDetails::outputs(int index) const {
  // @@protoc_insertion_point(field_get:payments.PaymentDetails.outputs)
  return outputs_.Get(index);
}
::payments::Output* PaymentDetails::mutable_outputs(int index) {
  // @@protoc_insertion_point(field_mutable:payments.PaymentDetails.outputs)
  return outputs_.Mutable(index);
}
::payments::Output* PaymentDetails::add_outputs() {
  // @@protoc_insertion_point(field_add:payments.PaymentDetails.outputs)
  return outputs_.Add();
}
::google::protobuf::RepeatedPtrField< ::payments::Output >*
PaymentDetails::mutable_outputs() {
  // @@protoc_insertion_point(field_mutable_list:payments.PaymentDetails.outputs)
  return &outputs_;
}
const ::google::protobuf::RepeatedPtrField< ::payments::Output >&
PaymentDetails::outputs() const {
  // @@protoc_insertion_point(field_list:payments.PaymentDetails.outputs)
  return outputs_;
}

// required uint64 time = 3;
bool PaymentDetails::has_time() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void PaymentDetails::set_has_time() {
  _has_bits_[0] |= 0x00000004u;
}
void PaymentDetails::clear_has_time() {
  _has_bits_[0] &= ~0x00000004u;
}
void PaymentDetails::clear_time() {
  time_ = GOOGLE_ULONGLONG(0);
  clear_has_time();
}
 ::google::protobuf::uint64 PaymentDetails::time() const {
  // @@protoc_insertion_point(field_get:payments.PaymentDetails.time)
  return time_;
}
 void PaymentDetails::set_time(::google::protobuf::uint64 value) {
  set_has_time();
  time_ = value;
  // @@protoc_insertion_point(field_set:payments.PaymentDetails.time)
}

// optional uint64 expires = 4;
bool PaymentDetails::has_expires() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void PaymentDetails::set_has_expires() {
  _has_bits_[0] |= 0x00000008u;
}
void PaymentDetails::clear_has_expires() {
  _has_bits_[0] &= ~0x00000008u;
}
void PaymentDetails::clear_expires() {
  expires_ = GOOGLE_ULONGLONG(0);
  clear_has_expires();
}
 ::google::protobuf::uint64 PaymentDetails::expires() const {
  // @@protoc_insertion_point(field_get:payments.PaymentDetails.expires)
  return expires_;
}
 void PaymentDetails::set_expires(::google::protobuf::uint64 value) {
  set_has_expires();
  expires_ = value;
  // @@protoc_insertion_point(field_set:payments.PaymentDetails.expires)
}

// optional string memo = 5;
bool PaymentDetails::has_memo() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void PaymentDetails::set_has_memo() {
  _has_bits_[0] |= 0x00000010u;
}
void PaymentDetails::clear_has_memo() {
  _has_bits_[0] &= ~0x00000010u;
}
void PaymentDetails::clear_memo() {
  memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_memo();
}
 const ::std::string& PaymentDetails::memo() const {
  // @@protoc_insertion_point(field_get:payments.PaymentDetails.memo)
  return memo_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_memo(const ::std::string& value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.PaymentDetails.memo)
}
 void PaymentDetails::set_memo(const char* value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentDetails.memo)
}
 void PaymentDetails::set_memo(const char* value, size_t size) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentDetails.memo)
}
 ::std::string* PaymentDetails::mutable_memo() {
  set_has_memo();
  // @@protoc_insertion_point(field_mutable:payments.PaymentDetails.memo)
  return memo_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentDetails::release_memo() {
  // @@protoc_insertion_point(field_release:payments.PaymentDetails.memo)
  clear_has_memo();
  return memo_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_allocated_memo(::std::string* memo) {
  if (memo != NULL) {
    set_has_memo();
  } else {
    clear_has_memo();
  }
  memo_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), memo);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentDetails.memo)
}

// optional string payment_url = 6;
bool PaymentDetails::has_payment_url() const {
  return (_has_bits_[0] & 0x00000020u) != 0;
}
void PaymentDetails::set_has_payment_url() {
  _has_bits_[0] |= 0x00000020u;
}
void PaymentDetails::clear_has_payment_url() {
  _has_bits_[0] &= ~0x00000020u;
}
void PaymentDetails::clear_payment_url() {
  payment_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_payment_url();
}
 const ::std::string& PaymentDetails::payment_url() const {
  // @@protoc_insertion_point(field_get:payments.PaymentDetails.payment_url)
  return payment_url_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_payment_url(const ::std::string& value) {
  set_has_payment_url();
  payment_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.PaymentDetails.payment_url)
}
 void PaymentDetails::set_payment_url(const char* value) {
  set_has_payment_url();
  payment_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentDetails.payment_url)
}
 void PaymentDetails::set_payment_url(const char* value, size_t size) {
  set_has_payment_url();
  payment_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentDetails.payment_url)
}
 ::std::string* PaymentDetails::mutable_payment_url() {
  set_has_payment_url();
  // @@protoc_insertion_point(field_mutable:payments.PaymentDetails.payment_url)
  return payment_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentDetails::release_payment_url() {
  // @@protoc_insertion_point(field_release:payments.PaymentDetails.payment_url)
  clear_has_payment_url();
  return payment_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_allocated_payment_url(::std::string* payment_url) {
  if (payment_url != NULL) {
    set_has_payment_url();
  } else {
    clear_has_payment_url();
  }
  payment_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), payment_url);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentDetails.payment_url)
}

// optional bytes merchant_data = 7;
bool PaymentDetails::has_merchant_data() const {
  return (_has_bits_[0] & 0x00000040u) != 0;
}
void PaymentDetails::set_has_merchant_data() {
  _has_bits_[0] |= 0x00000040u;
}
void PaymentDetails::clear_has_merchant_data() {
  _has_bits_[0] &= ~0x00000040u;
}
void PaymentDetails::clear_merchant_data() {
  merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_merchant_data();
}
 const ::std::string& PaymentDetails::merchant_data() const {
  // @@protoc_insertion_point(field_get:payments.PaymentDetails.merchant_data)
  return merchant_data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_merchant_data(const ::std::string& value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.PaymentDetails.merchant_data)
}
 void PaymentDetails::set_merchant_data(const char* value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentDetails.merchant_data)
}
 void PaymentDetails::set_merchant_data(const void* value, size_t size) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentDetails.merchant_data)
}
 ::std::string* PaymentDetails::mutable_merchant_data() {
  set_has_merchant_data();
  // @@protoc_insertion_point(field_mutable:payments.PaymentDetails.merchant_data)
  return merchant_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentDetails::release_merchant_data() {
  // @@protoc_insertion_point(field_release:payments.PaymentDetails.merchant_data)
  clear_has_merchant_data();
  return merchant_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentDetails::set_allocated_merchant_data(::std::string* merchant_data) {
  if (merchant_data != NULL) {
    set_has_merchant_data();
  } else {
    clear_has_merchant_data();
  }
  merchant_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), merchant_data);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentDetails.merchant_data)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

::std::string* PaymentRequest::_default_pki_type_ = NULL;
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PaymentRequest::kPaymentDetailsVersionFieldNumber;
const int PaymentRequest::kPkiTypeFieldNumber;
const int PaymentRequest::kPkiDataFieldNumber;
const int PaymentRequest::kSerializedPaymentDetailsFieldNumber;
const int PaymentRequest::kSignatureFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

PaymentRequest::PaymentRequest()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:payments.PaymentRequest)
}

void PaymentRequest::InitAsDefaultInstance() {
}

PaymentRequest::PaymentRequest(const PaymentRequest& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  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_.UnsafeSetDefault(_default_pki_type_);
  pki_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  serialized_payment_details_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  signature_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PaymentRequest::~PaymentRequest() {
  // @@protoc_insertion_point(destructor:payments.PaymentRequest)
  SharedDtor();
}

void PaymentRequest::SharedDtor() {
  pki_type_.DestroyNoArena(_default_pki_type_);
  pki_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  serialized_payment_details_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  signature_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  PaymentRequest* n = new PaymentRequest;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void PaymentRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:payments.PaymentRequest)
  if (_has_bits_[0 / 32] & 31u) {
    payment_details_version_ = 1u;
    if (has_pki_type()) {
      pki_type_.ClearToDefaultNoArena(_default_pki_type_);
    }
    if (has_pki_data()) {
      pki_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_serialized_payment_details()) {
      serialized_payment_details_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_signature()) {
      signature_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool PaymentRequest::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(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,
            "payments.PaymentRequest.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,
      "payments.PaymentRequest.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 (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:payments.PaymentRequest)
}

::google::protobuf::uint8* PaymentRequest::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::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,
      "payments.PaymentRequest.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 (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:payments.PaymentRequest)
  return target;
}

int PaymentRequest::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:payments.PaymentRequest)
  int total_size = 0;

  // required bytes serialized_payment_details = 4;
  if (has_serialized_payment_details()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::BytesSize(
        this->serialized_payment_details());
  }
  if (_has_bits_[0 / 32] & 23u) {
    // 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());
    }

    // optional bytes signature = 5;
    if (has_signature()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->signature());
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    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) {
// @@protoc_insertion_point(generalized_merge_from_start:payments.PaymentRequest)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const PaymentRequest* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const PaymentRequest>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:payments.PaymentRequest)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:payments.PaymentRequest)
    MergeFrom(*source);
  }
}

void PaymentRequest::MergeFrom(const PaymentRequest& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:payments.PaymentRequest)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  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_has_pki_type();
      pki_type_.AssignWithDefault(_default_pki_type_, from.pki_type_);
    }
    if (from.has_pki_data()) {
      set_has_pki_data();
      pki_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.pki_data_);
    }
    if (from.has_serialized_payment_details()) {
      set_has_serialized_payment_details();
      serialized_payment_details_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialized_payment_details_);
    }
    if (from.has_signature()) {
      set_has_signature();
      signature_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.signature_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void PaymentRequest::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:payments.PaymentRequest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void PaymentRequest::CopyFrom(const PaymentRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:payments.PaymentRequest)
  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) return;
  InternalSwap(other);
}
void PaymentRequest::InternalSwap(PaymentRequest* other) {
  std::swap(payment_details_version_, other->payment_details_version_);
  pki_type_.Swap(&other->pki_type_);
  pki_data_.Swap(&other->pki_data_);
  serialized_payment_details_.Swap(&other->serialized_payment_details_);
  signature_.Swap(&other->signature_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// PaymentRequest

// optional uint32 payment_details_version = 1 [default = 1];
bool PaymentRequest::has_payment_details_version() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void PaymentRequest::set_has_payment_details_version() {
  _has_bits_[0] |= 0x00000001u;
}
void PaymentRequest::clear_has_payment_details_version() {
  _has_bits_[0] &= ~0x00000001u;
}
void PaymentRequest::clear_payment_details_version() {
  payment_details_version_ = 1u;
  clear_has_payment_details_version();
}
 ::google::protobuf::uint32 PaymentRequest::payment_details_version() const {
  // @@protoc_insertion_point(field_get:payments.PaymentRequest.payment_details_version)
  return payment_details_version_;
}
 void PaymentRequest::set_payment_details_version(::google::protobuf::uint32 value) {
  set_has_payment_details_version();
  payment_details_version_ = value;
  // @@protoc_insertion_point(field_set:payments.PaymentRequest.payment_details_version)
}

// optional string pki_type = 2 [default = "none"];
bool PaymentRequest::has_pki_type() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void PaymentRequest::set_has_pki_type() {
  _has_bits_[0] |= 0x00000002u;
}
void PaymentRequest::clear_has_pki_type() {
  _has_bits_[0] &= ~0x00000002u;
}
void PaymentRequest::clear_pki_type() {
  pki_type_.ClearToDefaultNoArena(_default_pki_type_);
  clear_has_pki_type();
}
 const ::std::string& PaymentRequest::pki_type() const {
  // @@protoc_insertion_point(field_get:payments.PaymentRequest.pki_type)
  return pki_type_.GetNoArena(_default_pki_type_);
}
 void PaymentRequest::set_pki_type(const ::std::string& value) {
  set_has_pki_type();
  pki_type_.SetNoArena(_default_pki_type_, value);
  // @@protoc_insertion_point(field_set:payments.PaymentRequest.pki_type)
}
 void PaymentRequest::set_pki_type(const char* value) {
  set_has_pki_type();
  pki_type_.SetNoArena(_default_pki_type_, ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentRequest.pki_type)
}
 void PaymentRequest::set_pki_type(const char* value, size_t size) {
  set_has_pki_type();
  pki_type_.SetNoArena(_default_pki_type_,
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentRequest.pki_type)
}
 ::std::string* PaymentRequest::mutable_pki_type() {
  set_has_pki_type();
  // @@protoc_insertion_point(field_mutable:payments.PaymentRequest.pki_type)
  return pki_type_.MutableNoArena(_default_pki_type_);
}
 ::std::string* PaymentRequest::release_pki_type() {
  // @@protoc_insertion_point(field_release:payments.PaymentRequest.pki_type)
  clear_has_pki_type();
  return pki_type_.ReleaseNoArena(_default_pki_type_);
}
 void PaymentRequest::set_allocated_pki_type(::std::string* pki_type) {
  if (pki_type != NULL) {
    set_has_pki_type();
  } else {
    clear_has_pki_type();
  }
  pki_type_.SetAllocatedNoArena(_default_pki_type_, pki_type);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentRequest.pki_type)
}

// optional bytes pki_data = 3;
bool PaymentRequest::has_pki_data() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void PaymentRequest::set_has_pki_data() {
  _has_bits_[0] |= 0x00000004u;
}
void PaymentRequest::clear_has_pki_data() {
  _has_bits_[0] &= ~0x00000004u;
}
void PaymentRequest::clear_pki_data() {
  pki_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_pki_data();
}
 const ::std::string& PaymentRequest::pki_data() const {
  // @@protoc_insertion_point(field_get:payments.PaymentRequest.pki_data)
  return pki_data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_pki_data(const ::std::string& value) {
  set_has_pki_data();
  pki_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.PaymentRequest.pki_data)
}
 void PaymentRequest::set_pki_data(const char* value) {
  set_has_pki_data();
  pki_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentRequest.pki_data)
}
 void PaymentRequest::set_pki_data(const void* value, size_t size) {
  set_has_pki_data();
  pki_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentRequest.pki_data)
}
 ::std::string* PaymentRequest::mutable_pki_data() {
  set_has_pki_data();
  // @@protoc_insertion_point(field_mutable:payments.PaymentRequest.pki_data)
  return pki_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentRequest::release_pki_data() {
  // @@protoc_insertion_point(field_release:payments.PaymentRequest.pki_data)
  clear_has_pki_data();
  return pki_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_allocated_pki_data(::std::string* pki_data) {
  if (pki_data != NULL) {
    set_has_pki_data();
  } else {
    clear_has_pki_data();
  }
  pki_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), pki_data);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentRequest.pki_data)
}

// required bytes serialized_payment_details = 4;
bool PaymentRequest::has_serialized_payment_details() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void PaymentRequest::set_has_serialized_payment_details() {
  _has_bits_[0] |= 0x00000008u;
}
void PaymentRequest::clear_has_serialized_payment_details() {
  _has_bits_[0] &= ~0x00000008u;
}
void PaymentRequest::clear_serialized_payment_details() {
  serialized_payment_details_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_serialized_payment_details();
}
 const ::std::string& PaymentRequest::serialized_payment_details() const {
  // @@protoc_insertion_point(field_get:payments.PaymentRequest.serialized_payment_details)
  return serialized_payment_details_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_serialized_payment_details(const ::std::string& value) {
  set_has_serialized_payment_details();
  serialized_payment_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.PaymentRequest.serialized_payment_details)
}
 void PaymentRequest::set_serialized_payment_details(const char* value) {
  set_has_serialized_payment_details();
  serialized_payment_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentRequest.serialized_payment_details)
}
 void PaymentRequest::set_serialized_payment_details(const void* value, size_t size) {
  set_has_serialized_payment_details();
  serialized_payment_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentRequest.serialized_payment_details)
}
 ::std::string* PaymentRequest::mutable_serialized_payment_details() {
  set_has_serialized_payment_details();
  // @@protoc_insertion_point(field_mutable:payments.PaymentRequest.serialized_payment_details)
  return serialized_payment_details_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentRequest::release_serialized_payment_details() {
  // @@protoc_insertion_point(field_release:payments.PaymentRequest.serialized_payment_details)
  clear_has_serialized_payment_details();
  return serialized_payment_details_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_allocated_serialized_payment_details(::std::string* serialized_payment_details) {
  if (serialized_payment_details != NULL) {
    set_has_serialized_payment_details();
  } else {
    clear_has_serialized_payment_details();
  }
  serialized_payment_details_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialized_payment_details);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentRequest.serialized_payment_details)
}

// optional bytes signature = 5;
bool PaymentRequest::has_signature() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void PaymentRequest::set_has_signature() {
  _has_bits_[0] |= 0x00000010u;
}
void PaymentRequest::clear_has_signature() {
  _has_bits_[0] &= ~0x00000010u;
}
void PaymentRequest::clear_signature() {
  signature_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_signature();
}
 const ::std::string& PaymentRequest::signature() const {
  // @@protoc_insertion_point(field_get:payments.PaymentRequest.signature)
  return signature_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_signature(const ::std::string& value) {
  set_has_signature();
  signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.PaymentRequest.signature)
}
 void PaymentRequest::set_signature(const char* value) {
  set_has_signature();
  signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentRequest.signature)
}
 void PaymentRequest::set_signature(const void* value, size_t size) {
  set_has_signature();
  signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentRequest.signature)
}
 ::std::string* PaymentRequest::mutable_signature() {
  set_has_signature();
  // @@protoc_insertion_point(field_mutable:payments.PaymentRequest.signature)
  return signature_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentRequest::release_signature() {
  // @@protoc_insertion_point(field_release:payments.PaymentRequest.signature)
  clear_has_signature();
  return signature_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentRequest::set_allocated_signature(::std::string* signature) {
  if (signature != NULL) {
    set_has_signature();
  } else {
    clear_has_signature();
  }
  signature_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), signature);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentRequest.signature)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int X509Certificates::kCertificateFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

X509Certificates::X509Certificates()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:payments.X509Certificates)
}

void X509Certificates::InitAsDefaultInstance() {
}

X509Certificates::X509Certificates(const X509Certificates& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  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(::google::protobuf::Arena* arena) const {
  X509Certificates* n = new X509Certificates;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void X509Certificates::Clear() {
// @@protoc_insertion_point(message_clear_start:payments.X509Certificates)
  certificate_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool X509Certificates::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(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 (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:payments.X509Certificates)
}

::google::protobuf::uint8* X509Certificates::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::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 (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:payments.X509Certificates)
  return target;
}

int X509Certificates::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:payments.X509Certificates)
  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 (_internal_metadata_.have_unknown_fields()) {
    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) {
// @@protoc_insertion_point(generalized_merge_from_start:payments.X509Certificates)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const X509Certificates* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const X509Certificates>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:payments.X509Certificates)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:payments.X509Certificates)
    MergeFrom(*source);
  }
}

void X509Certificates::MergeFrom(const X509Certificates& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:payments.X509Certificates)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  certificate_.MergeFrom(from.certificate_);
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void X509Certificates::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:payments.X509Certificates)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void X509Certificates::CopyFrom(const X509Certificates& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:payments.X509Certificates)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool X509Certificates::IsInitialized() const {

  return true;
}

void X509Certificates::Swap(X509Certificates* other) {
  if (other == this) return;
  InternalSwap(other);
}
void X509Certificates::InternalSwap(X509Certificates* other) {
  certificate_.UnsafeArenaSwap(&other->certificate_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// X509Certificates

// repeated bytes certificate = 1;
int X509Certificates::certificate_size() const {
  return certificate_.size();
}
void X509Certificates::clear_certificate() {
  certificate_.Clear();
}
 const ::std::string& X509Certificates::certificate(int index) const {
  // @@protoc_insertion_point(field_get:payments.X509Certificates.certificate)
  return certificate_.Get(index);
}
 ::std::string* X509Certificates::mutable_certificate(int index) {
  // @@protoc_insertion_point(field_mutable:payments.X509Certificates.certificate)
  return certificate_.Mutable(index);
}
 void X509Certificates::set_certificate(int index, const ::std::string& value) {
  // @@protoc_insertion_point(field_set:payments.X509Certificates.certificate)
  certificate_.Mutable(index)->assign(value);
}
 void X509Certificates::set_certificate(int index, const char* value) {
  certificate_.Mutable(index)->assign(value);
  // @@protoc_insertion_point(field_set_char:payments.X509Certificates.certificate)
}
 void X509Certificates::set_certificate(int index, const void* value, size_t size) {
  certificate_.Mutable(index)->assign(
    reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_set_pointer:payments.X509Certificates.certificate)
}
 ::std::string* X509Certificates::add_certificate() {
  // @@protoc_insertion_point(field_add_mutable:payments.X509Certificates.certificate)
  return certificate_.Add();
}
 void X509Certificates::add_certificate(const ::std::string& value) {
  certificate_.Add()->assign(value);
  // @@protoc_insertion_point(field_add:payments.X509Certificates.certificate)
}
 void X509Certificates::add_certificate(const char* value) {
  certificate_.Add()->assign(value);
  // @@protoc_insertion_point(field_add_char:payments.X509Certificates.certificate)
}
 void X509Certificates::add_certificate(const void* value, size_t size) {
  certificate_.Add()->assign(reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_add_pointer:payments.X509Certificates.certificate)
}
 const ::google::protobuf::RepeatedPtrField< ::std::string>&
X509Certificates::certificate() const {
  // @@protoc_insertion_point(field_list:payments.X509Certificates.certificate)
  return certificate_;
}
 ::google::protobuf::RepeatedPtrField< ::std::string>*
X509Certificates::mutable_certificate() {
  // @@protoc_insertion_point(field_mutable_list:payments.X509Certificates.certificate)
  return &certificate_;
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Payment::kMerchantDataFieldNumber;
const int Payment::kTransactionsFieldNumber;
const int Payment::kRefundToFieldNumber;
const int Payment::kMemoFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Payment::Payment()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:payments.Payment)
}

void Payment::InitAsDefaultInstance() {
}

Payment::Payment(const Payment& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:payments.Payment)
}

void Payment::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  merchant_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  memo_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Payment::~Payment() {
  // @@protoc_insertion_point(destructor:payments.Payment)
  SharedDtor();
}

void Payment::SharedDtor() {
  merchant_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  memo_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  Payment* n = new Payment;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Payment::Clear() {
// @@protoc_insertion_point(message_clear_start:payments.Payment)
  if (_has_bits_[0 / 32] & 9u) {
    if (has_merchant_data()) {
      merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_memo()) {
      memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  transactions_.Clear();
  refund_to_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Payment::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(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_(input->IncrementRecursionDepth());
         parse_loop_refund_to:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_refund_to()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_loop_refund_to;
        input->UnsafeDecrementRecursionDepth();
        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,
            "payments.Payment.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 (unsigned int i = 0, n = this->refund_to_size(); i < n; 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,
      "payments.Payment.memo");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      4, this->memo(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:payments.Payment)
}

::google::protobuf::uint8* Payment::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::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 (unsigned int i = 0, n = this->refund_to_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        3, this->refund_to(i), false, target);
  }

  // optional string memo = 4;
  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.Payment.memo");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        4, this->memo(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:payments.Payment)
  return target;
}

int Payment::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:payments.Payment)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 9u) {
    // 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 (_internal_metadata_.have_unknown_fields()) {
    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) {
// @@protoc_insertion_point(generalized_merge_from_start:payments.Payment)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Payment* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Payment>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:payments.Payment)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:payments.Payment)
    MergeFrom(*source);
  }
}

void Payment::MergeFrom(const Payment& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:payments.Payment)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  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_has_merchant_data();
      merchant_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.merchant_data_);
    }
    if (from.has_memo()) {
      set_has_memo();
      memo_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.memo_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Payment::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:payments.Payment)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Payment::CopyFrom(const Payment& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:payments.Payment)
  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) return;
  InternalSwap(other);
}
void Payment::InternalSwap(Payment* other) {
  merchant_data_.Swap(&other->merchant_data_);
  transactions_.UnsafeArenaSwap(&other->transactions_);
  refund_to_.UnsafeArenaSwap(&other->refund_to_);
  memo_.Swap(&other->memo_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// Payment

// optional bytes merchant_data = 1;
bool Payment::has_merchant_data() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Payment::set_has_merchant_data() {
  _has_bits_[0] |= 0x00000001u;
}
void Payment::clear_has_merchant_data() {
  _has_bits_[0] &= ~0x00000001u;
}
void Payment::clear_merchant_data() {
  merchant_data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_merchant_data();
}
 const ::std::string& Payment::merchant_data() const {
  // @@protoc_insertion_point(field_get:payments.Payment.merchant_data)
  return merchant_data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_merchant_data(const ::std::string& value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.Payment.merchant_data)
}
 void Payment::set_merchant_data(const char* value) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.Payment.merchant_data)
}
 void Payment::set_merchant_data(const void* value, size_t size) {
  set_has_merchant_data();
  merchant_data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.Payment.merchant_data)
}
 ::std::string* Payment::mutable_merchant_data() {
  set_has_merchant_data();
  // @@protoc_insertion_point(field_mutable:payments.Payment.merchant_data)
  return merchant_data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Payment::release_merchant_data() {
  // @@protoc_insertion_point(field_release:payments.Payment.merchant_data)
  clear_has_merchant_data();
  return merchant_data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_allocated_merchant_data(::std::string* merchant_data) {
  if (merchant_data != NULL) {
    set_has_merchant_data();
  } else {
    clear_has_merchant_data();
  }
  merchant_data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), merchant_data);
  // @@protoc_insertion_point(field_set_allocated:payments.Payment.merchant_data)
}

// repeated bytes transactions = 2;
int Payment::transactions_size() const {
  return transactions_.size();
}
void Payment::clear_transactions() {
  transactions_.Clear();
}
 const ::std::string& Payment::transactions(int index) const {
  // @@protoc_insertion_point(field_get:payments.Payment.transactions)
  return transactions_.Get(index);
}
 ::std::string* Payment::mutable_transactions(int index) {
  // @@protoc_insertion_point(field_mutable:payments.Payment.transactions)
  return transactions_.Mutable(index);
}
 void Payment::set_transactions(int index, const ::std::string& value) {
  // @@protoc_insertion_point(field_set:payments.Payment.transactions)
  transactions_.Mutable(index)->assign(value);
}
 void Payment::set_transactions(int index, const char* value) {
  transactions_.Mutable(index)->assign(value);
  // @@protoc_insertion_point(field_set_char:payments.Payment.transactions)
}
 void Payment::set_transactions(int index, const void* value, size_t size) {
  transactions_.Mutable(index)->assign(
    reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_set_pointer:payments.Payment.transactions)
}
 ::std::string* Payment::add_transactions() {
  // @@protoc_insertion_point(field_add_mutable:payments.Payment.transactions)
  return transactions_.Add();
}
 void Payment::add_transactions(const ::std::string& value) {
  transactions_.Add()->assign(value);
  // @@protoc_insertion_point(field_add:payments.Payment.transactions)
}
 void Payment::add_transactions(const char* value) {
  transactions_.Add()->assign(value);
  // @@protoc_insertion_point(field_add_char:payments.Payment.transactions)
}
 void Payment::add_transactions(const void* value, size_t size) {
  transactions_.Add()->assign(reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_add_pointer:payments.Payment.transactions)
}
 const ::google::protobuf::RepeatedPtrField< ::std::string>&
Payment::transactions() const {
  // @@protoc_insertion_point(field_list:payments.Payment.transactions)
  return transactions_;
}
 ::google::protobuf::RepeatedPtrField< ::std::string>*
Payment::mutable_transactions() {
  // @@protoc_insertion_point(field_mutable_list:payments.Payment.transactions)
  return &transactions_;
}

// repeated .payments.Output refund_to = 3;
int Payment::refund_to_size() const {
  return refund_to_.size();
}
void Payment::clear_refund_to() {
  refund_to_.Clear();
}
const ::payments::Output& Payment::refund_to(int index) const {
  // @@protoc_insertion_point(field_get:payments.Payment.refund_to)
  return refund_to_.Get(index);
}
::payments::Output* Payment::mutable_refund_to(int index) {
  // @@protoc_insertion_point(field_mutable:payments.Payment.refund_to)
  return refund_to_.Mutable(index);
}
::payments::Output* Payment::add_refund_to() {
  // @@protoc_insertion_point(field_add:payments.Payment.refund_to)
  return refund_to_.Add();
}
::google::protobuf::RepeatedPtrField< ::payments::Output >*
Payment::mutable_refund_to() {
  // @@protoc_insertion_point(field_mutable_list:payments.Payment.refund_to)
  return &refund_to_;
}
const ::google::protobuf::RepeatedPtrField< ::payments::Output >&
Payment::refund_to() const {
  // @@protoc_insertion_point(field_list:payments.Payment.refund_to)
  return refund_to_;
}

// optional string memo = 4;
bool Payment::has_memo() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void Payment::set_has_memo() {
  _has_bits_[0] |= 0x00000008u;
}
void Payment::clear_has_memo() {
  _has_bits_[0] &= ~0x00000008u;
}
void Payment::clear_memo() {
  memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_memo();
}
 const ::std::string& Payment::memo() const {
  // @@protoc_insertion_point(field_get:payments.Payment.memo)
  return memo_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_memo(const ::std::string& value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.Payment.memo)
}
 void Payment::set_memo(const char* value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.Payment.memo)
}
 void Payment::set_memo(const char* value, size_t size) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.Payment.memo)
}
 ::std::string* Payment::mutable_memo() {
  set_has_memo();
  // @@protoc_insertion_point(field_mutable:payments.Payment.memo)
  return memo_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Payment::release_memo() {
  // @@protoc_insertion_point(field_release:payments.Payment.memo)
  clear_has_memo();
  return memo_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Payment::set_allocated_memo(::std::string* memo) {
  if (memo != NULL) {
    set_has_memo();
  } else {
    clear_has_memo();
  }
  memo_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), memo);
  // @@protoc_insertion_point(field_set_allocated:payments.Payment.memo)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PaymentACK::kPaymentFieldNumber;
const int PaymentACK::kMemoFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

PaymentACK::PaymentACK()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  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(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:payments.PaymentACK)
}

void PaymentACK::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  payment_ = NULL;
  memo_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PaymentACK::~PaymentACK() {
  // @@protoc_insertion_point(destructor:payments.PaymentACK)
  SharedDtor();
}

void PaymentACK::SharedDtor() {
  memo_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  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(::google::protobuf::Arena* arena) const {
  PaymentACK* n = new PaymentACK;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void PaymentACK::Clear() {
// @@protoc_insertion_point(message_clear_start:payments.PaymentACK)
  if (_has_bits_[0 / 32] & 3u) {
    if (has_payment()) {
      if (payment_ != NULL) payment_->::payments::Payment::Clear();
    }
    if (has_memo()) {
      memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool PaymentACK::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(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,
            "payments.PaymentACK.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,
      "payments.PaymentACK.memo");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->memo(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:payments.PaymentACK)
}

::google::protobuf::uint8* PaymentACK::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::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::
      InternalWriteMessageNoVirtualToArray(
        1, *this->payment_, false, target);
  }

  // optional string memo = 2;
  if (has_memo()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->memo().data(), this->memo().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "payments.PaymentACK.memo");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->memo(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:payments.PaymentACK)
  return target;
}

int PaymentACK::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:payments.PaymentACK)
  int total_size = 0;

  // 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 (_internal_metadata_.have_unknown_fields()) {
    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) {
// @@protoc_insertion_point(generalized_merge_from_start:payments.PaymentACK)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const PaymentACK* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const PaymentACK>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:payments.PaymentACK)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:payments.PaymentACK)
    MergeFrom(*source);
  }
}

void PaymentACK::MergeFrom(const PaymentACK& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:payments.PaymentACK)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  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_has_memo();
      memo_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.memo_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void PaymentACK::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:payments.PaymentACK)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void PaymentACK::CopyFrom(const PaymentACK& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:payments.PaymentACK)
  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) return;
  InternalSwap(other);
}
void PaymentACK::InternalSwap(PaymentACK* other) {
  std::swap(payment_, other->payment_);
  memo_.Swap(&other->memo_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  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;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// PaymentACK

// required .payments.Payment payment = 1;
bool PaymentACK::has_payment() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void PaymentACK::set_has_payment() {
  _has_bits_[0] |= 0x00000001u;
}
void PaymentACK::clear_has_payment() {
  _has_bits_[0] &= ~0x00000001u;
}
void PaymentACK::clear_payment() {
  if (payment_ != NULL) payment_->::payments::Payment::Clear();
  clear_has_payment();
}
const ::payments::Payment& PaymentACK::payment() const {
  // @@protoc_insertion_point(field_get:payments.PaymentACK.payment)
  return payment_ != NULL ? *payment_ : *default_instance_->payment_;
}
::payments::Payment* PaymentACK::mutable_payment() {
  set_has_payment();
  if (payment_ == NULL) {
    payment_ = new ::payments::Payment;
  }
  // @@protoc_insertion_point(field_mutable:payments.PaymentACK.payment)
  return payment_;
}
::payments::Payment* PaymentACK::release_payment() {
  // @@protoc_insertion_point(field_release:payments.PaymentACK.payment)
  clear_has_payment();
  ::payments::Payment* temp = payment_;
  payment_ = NULL;
  return temp;
}
void PaymentACK::set_allocated_payment(::payments::Payment* payment) {
  delete payment_;
  payment_ = payment;
  if (payment) {
    set_has_payment();
  } else {
    clear_has_payment();
  }
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentACK.payment)
}

// optional string memo = 2;
bool PaymentACK::has_memo() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void PaymentACK::set_has_memo() {
  _has_bits_[0] |= 0x00000002u;
}
void PaymentACK::clear_has_memo() {
  _has_bits_[0] &= ~0x00000002u;
}
void PaymentACK::clear_memo() {
  memo_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_memo();
}
 const ::std::string& PaymentACK::memo() const {
  // @@protoc_insertion_point(field_get:payments.PaymentACK.memo)
  return memo_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentACK::set_memo(const ::std::string& value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:payments.PaymentACK.memo)
}
 void PaymentACK::set_memo(const char* value) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:payments.PaymentACK.memo)
}
 void PaymentACK::set_memo(const char* value, size_t size) {
  set_has_memo();
  memo_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:payments.PaymentACK.memo)
}
 ::std::string* PaymentACK::mutable_memo() {
  set_has_memo();
  // @@protoc_insertion_point(field_mutable:payments.PaymentACK.memo)
  return memo_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* PaymentACK::release_memo() {
  // @@protoc_insertion_point(field_release:payments.PaymentACK.memo)
  clear_has_memo();
  return memo_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void PaymentACK::set_allocated_memo(::std::string* memo) {
  if (memo != NULL) {
    set_has_memo();
  } else {
    clear_has_memo();
  }
  memo_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), memo);
  // @@protoc_insertion_point(field_set_allocated:payments.PaymentACK.memo)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

}  // namespace payments

// @@protoc_insertion_point(global_scope)
