paymentMemo.setText(paymentRequestData.getPayment().get().getMemo());
/** * Create a payment message. This wraps up transaction data along with anything else useful for making a payment. * * @param transactions transactions to include with the payment message * @param refundOutputs list of outputs to refund coins to, or null * @param memo arbitrary, user readable memo, or null if none * @param merchantData arbitrary merchant data, or null if none * @return created payment message */ public static Protos.Payment createPaymentMessage(List<Transaction> transactions, @Nullable List<Protos.Output> refundOutputs, @Nullable String memo, @Nullable byte[] merchantData) { Protos.Payment.Builder builder = Protos.Payment.newBuilder(); for (Transaction transaction : transactions) { transaction.verify(); builder.addTransactions(ByteString.copyFrom(transaction.unsafeBitcoinSerialize())); } if (refundOutputs != null) { for (Protos.Output output : refundOutputs) builder.addRefundTo(output); } if (memo != null) builder.setMemo(memo); if (merchantData != null) builder.setMerchantData(ByteString.copyFrom(merchantData)); return builder.build(); }
public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Payment other) { if (other == org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) return this; if (other.hasMerchantData()) { setMerchantData(other.getMerchantData()); if (other.hasMemo()) { bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Payment other) { if (other == org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) return this; if (other.hasMerchantData()) { setMerchantData(other.getMerchantData()); if (other.hasMemo()) { bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Payment other) { if (other == org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) return this; if (other.hasMerchantData()) { setMerchantData(other.getMerchantData()); if (other.hasMemo()) { bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Payment other) { if (other == org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) return this; if (other.hasMerchantData()) { setMerchantData(other.getMerchantData()); if (other.hasMemo()) { bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Payment other) { if (other == org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) return this; if (other.hasMerchantData()) { setMerchantData(other.getMerchantData()); if (other.hasMemo()) { bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields()); return this;
if (!txns.get(0).getParams().equals(params)) throw new PaymentRequestException.InvalidNetwork(params.getPaymentProtocolId()); Protos.Payment.Builder payment = Protos.Payment.newBuilder(); if (paymentDetails.hasMerchantData()) payment.setMerchantData(paymentDetails.getMerchantData());
public org.bitcoin.protocols.payments.Protos.Payment buildPartial() { org.bitcoin.protocols.payments.Protos.Payment result = new org.bitcoin.protocols.payments.Protos.Payment(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.merchantData_ = merchantData_; if (((bitField0_ & 0x00000002) == 0x00000002)) { transactions_ = java.util.Collections.unmodifiableList(transactions_); bitField0_ = (bitField0_ & ~0x00000002); } result.transactions_ = transactions_; if (refundToBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { refundTo_ = java.util.Collections.unmodifiableList(refundTo_); bitField0_ = (bitField0_ & ~0x00000004); } result.refundTo_ = refundTo_; } else { result.refundTo_ = refundToBuilder_.build(); } if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, merchantData_); } { int dataSize = 0; for (int i = 0; i < transactions_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(transactions_.get(i)); } size += dataSize; size += 1 * getTransactionsList().size(); } for (int i = 0; i < refundTo_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, refundTo_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(4, getMemoBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public org.bitcoin.protocols.payments.Protos.Payment buildPartial() { org.bitcoin.protocols.payments.Protos.Payment result = new org.bitcoin.protocols.payments.Protos.Payment(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.merchantData_ = merchantData_; if (((bitField0_ & 0x00000002) == 0x00000002)) { transactions_ = java.util.Collections.unmodifiableList(transactions_); bitField0_ = (bitField0_ & ~0x00000002); } result.transactions_ = transactions_; if (refundToBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { refundTo_ = java.util.Collections.unmodifiableList(refundTo_); bitField0_ = (bitField0_ & ~0x00000004); } result.refundTo_ = refundTo_; } else { result.refundTo_ = refundToBuilder_.build(); } if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public org.bitcoin.protocols.payments.Protos.Payment buildPartial() { org.bitcoin.protocols.payments.Protos.Payment result = new org.bitcoin.protocols.payments.Protos.Payment(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.merchantData_ = merchantData_; if (((bitField0_ & 0x00000002) == 0x00000002)) { transactions_ = java.util.Collections.unmodifiableList(transactions_); bitField0_ = (bitField0_ & ~0x00000002); } result.transactions_ = transactions_; if (refundToBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { refundTo_ = java.util.Collections.unmodifiableList(refundTo_); bitField0_ = (bitField0_ & ~0x00000004); } result.refundTo_ = refundTo_; } else { result.refundTo_ = refundToBuilder_.build(); } if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public org.bitcoin.protocols.payments.Protos.Payment buildPartial() { org.bitcoin.protocols.payments.Protos.Payment result = new org.bitcoin.protocols.payments.Protos.Payment(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.merchantData_ = merchantData_; if (((bitField0_ & 0x00000002) == 0x00000002)) { transactions_ = java.util.Collections.unmodifiableList(transactions_); bitField0_ = (bitField0_ & ~0x00000002); } result.transactions_ = transactions_; if (refundToBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { refundTo_ = java.util.Collections.unmodifiableList(refundTo_); bitField0_ = (bitField0_ & ~0x00000004); } result.refundTo_ = refundTo_; } else { result.refundTo_ = refundToBuilder_.build(); } if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, merchantData_); } { int dataSize = 0; for (int i = 0; i < transactions_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(transactions_.get(i)); } size += dataSize; size += 1 * getTransactionsList().size(); } for (int i = 0; i < refundTo_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, refundTo_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(4, getMemoBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, merchantData_); } { int dataSize = 0; for (int i = 0; i < transactions_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(transactions_.get(i)); } size += dataSize; size += 1 * getTransactionsList().size(); } for (int i = 0; i < refundTo_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, refundTo_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(4, getMemoBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, merchantData_); } { int dataSize = 0; for (int i = 0; i < transactions_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(transactions_.get(i)); } size += dataSize; size += 1 * getTransactionsList().size(); } for (int i = 0; i < refundTo_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, refundTo_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(4, getMemoBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public org.bitcoin.protocols.payments.Protos.Payment buildPartial() { org.bitcoin.protocols.payments.Protos.Payment result = new org.bitcoin.protocols.payments.Protos.Payment(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.merchantData_ = merchantData_; if (((bitField0_ & 0x00000002) == 0x00000002)) { transactions_ = java.util.Collections.unmodifiableList(transactions_); bitField0_ = (bitField0_ & ~0x00000002); } result.transactions_ = transactions_; if (refundToBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { refundTo_ = java.util.Collections.unmodifiableList(refundTo_); bitField0_ = (bitField0_ & ~0x00000004); } result.refundTo_ = refundTo_; } else { result.refundTo_ = refundToBuilder_.build(); } if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * Create a payment message. This wraps up transaction data along with anything else useful for making a payment. * * @param transactions transactions to include with the payment message * @param refundOutputs list of outputs to refund coins to, or null * @param memo arbitrary, user readable memo, or null if none * @param merchantData arbitrary merchant data, or null if none * @return created payment message */ public static Protos.Payment createPaymentMessage(List<Transaction> transactions, @Nullable List<Protos.Output> refundOutputs, @Nullable String memo, @Nullable byte[] merchantData) { Protos.Payment.Builder builder = Protos.Payment.newBuilder(); for (Transaction transaction : transactions) { transaction.verify(); builder.addTransactions(ByteString.copyFrom(transaction.unsafeBitcoinSerialize())); } if (refundOutputs != null) { for (Protos.Output output : refundOutputs) builder.addRefundTo(output); } if (memo != null) builder.setMemo(memo); if (merchantData != null) builder.setMerchantData(ByteString.copyFrom(merchantData)); return builder.build(); }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, merchantData_); } { int dataSize = 0; for (int i = 0; i < transactions_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream .computeBytesSizeNoTag(transactions_.get(i)); } size += dataSize; size += 1 * getTransactionsList().size(); } for (int i = 0; i < refundTo_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, refundTo_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(4, getMemoBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
/** * Create a payment message. This wraps up transaction data along with anything else useful for making a payment. * * @param transactions transactions to include with the payment message * @param refundOutputs list of outputs to refund coins to, or null * @param memo arbitrary, user readable memo, or null if none * @param merchantData arbitrary merchant data, or null if none * @return created payment message */ public static Protos.Payment createPaymentMessage(List<Transaction> transactions, @Nullable List<Protos.Output> refundOutputs, @Nullable String memo, @Nullable byte[] merchantData) { Protos.Payment.Builder builder = Protos.Payment.newBuilder(); for (Transaction transaction : transactions) { transaction.verify(); builder.addTransactions(ByteString.copyFrom(transaction.unsafeBitcoinSerialize())); } if (refundOutputs != null) { for (Protos.Output output : refundOutputs) builder.addRefundTo(output); } if (memo != null) builder.setMemo(memo); if (merchantData != null) builder.setMerchantData(ByteString.copyFrom(merchantData)); return builder.build(); }