/** * 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(); }
subBuilder.mergeFrom(payment_); payment_ = subBuilder.buildPartial();
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()); bitField0_ = (bitField0_ & ~0x00000002); } else { ensureTransactionsIsMutable(); transactions_.addAll(other.transactions_); onChanged(); bitField0_ = (bitField0_ & ~0x00000004); } else { ensureRefundToIsMutable(); refundTo_.addAll(other.refundTo_); onChanged(); refundToBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRefundToFieldBuilder() : null; } else { refundToBuilder_.addAllMessages(other.refundTo_); bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields());
subBuilder.mergeFrom(payment_); payment_ = subBuilder.buildPartial();
subBuilder.mergeFrom(payment_); payment_ = subBuilder.buildPartial();
subBuilder.mergeFrom(payment_); payment_ = subBuilder.buildPartial();
subBuilder.mergeFrom(payment_); payment_ = subBuilder.buildPartial();
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()); bitField0_ = (bitField0_ & ~0x00000002); } else { ensureTransactionsIsMutable(); transactions_.addAll(other.transactions_); onChanged(); bitField0_ = (bitField0_ & ~0x00000004); } else { ensureRefundToIsMutable(); refundTo_.addAll(other.refundTo_); onChanged(); refundToBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRefundToFieldBuilder() : null; } else { refundToBuilder_.addAllMessages(other.refundTo_); bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields());
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()); bitField0_ = (bitField0_ & ~0x00000002); } else { ensureTransactionsIsMutable(); transactions_.addAll(other.transactions_); onChanged(); bitField0_ = (bitField0_ & ~0x00000004); } else { ensureRefundToIsMutable(); refundTo_.addAll(other.refundTo_); onChanged(); refundToBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRefundToFieldBuilder() : null; } else { refundToBuilder_.addAllMessages(other.refundTo_); bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields());
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()); bitField0_ = (bitField0_ & ~0x00000002); } else { ensureTransactionsIsMutable(); transactions_.addAll(other.transactions_); onChanged(); bitField0_ = (bitField0_ & ~0x00000004); } else { ensureRefundToIsMutable(); refundTo_.addAll(other.refundTo_); onChanged(); refundToBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRefundToFieldBuilder() : null; } else { refundToBuilder_.addAllMessages(other.refundTo_); bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields());
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()); bitField0_ = (bitField0_ & ~0x00000002); } else { ensureTransactionsIsMutable(); transactions_.addAll(other.transactions_); onChanged(); bitField0_ = (bitField0_ & ~0x00000004); } else { ensureRefundToIsMutable(); refundTo_.addAll(other.refundTo_); onChanged(); refundToBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRefundToFieldBuilder() : null; } else { refundToBuilder_.addAllMessages(other.refundTo_); bitField0_ |= 0x00000008; memo_ = other.memo_; onChanged(); this.mergeUnknownFields(other.getUnknownFields());
Protos.Payment.Builder payment = Protos.Payment.newBuilder(); if (paymentDetails.hasMerchantData()) payment.setMerchantData(paymentDetails.getMerchantData()); if (refundAddr != null) { Protos.Output.Builder refundOutput = Protos.Output.newBuilder(); refundOutput.setAmount(totalValue.longValue()); refundOutput.setScript(ByteString.copyFrom(ScriptBuilder.createOutputScript(refundAddr).getProgram())); payment.addRefundTo(refundOutput); payment.setMemo(memo); ByteArrayOutputStream o = new ByteArrayOutputStream(); txn.bitcoinSerialize(o); payment.addTransactions(ByteString.copyFrom(o.toByteArray())); return payment.build();
/** * <code>required .payments.Payment payment = 1;</code> * * <pre> * Payment message that triggered this ACK * </pre> */ public Builder mergePayment(org.bitcoin.protocols.payments.Protos.Payment value) { if (paymentBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && payment_ != org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) { payment_ = org.bitcoin.protocols.payments.Protos.Payment.newBuilder(payment_).mergeFrom(value).buildPartial(); } else { payment_ = value; } onChanged(); } else { paymentBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
/** * <code>required .payments.Payment payment = 1;</code> * * <pre> * Payment message that triggered this ACK * </pre> */ public Builder mergePayment(org.bitcoin.protocols.payments.Protos.Payment value) { if (paymentBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && payment_ != org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) { payment_ = org.bitcoin.protocols.payments.Protos.Payment.newBuilder(payment_).mergeFrom(value).buildPartial(); } else { payment_ = value; } onChanged(); } else { paymentBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
/** * <code>required .payments.Payment payment = 1;</code> * * <pre> * Payment message that triggered this ACK * </pre> */ public Builder mergePayment(org.bitcoin.protocols.payments.Protos.Payment value) { if (paymentBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && payment_ != org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) { payment_ = org.bitcoin.protocols.payments.Protos.Payment.newBuilder(payment_).mergeFrom(value).buildPartial(); } else { payment_ = value; } onChanged(); } else { paymentBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
/** * <code>required .payments.Payment payment = 1;</code> * * <pre> * Payment message that triggered this ACK * </pre> */ public Builder mergePayment(org.bitcoin.protocols.payments.Protos.Payment value) { if (paymentBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && payment_ != org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) { payment_ = org.bitcoin.protocols.payments.Protos.Payment.newBuilder(payment_).mergeFrom(value).buildPartial(); } else { payment_ = value; } onChanged(); } else { paymentBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * <code>required .payments.Payment payment = 1;</code> * * <pre> * Payment message that triggered this ACK * </pre> */ public Builder mergePayment(org.bitcoin.protocols.payments.Protos.Payment value) { if (paymentBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && payment_ != org.bitcoin.protocols.payments.Protos.Payment.getDefaultInstance()) { payment_ = org.bitcoin.protocols.payments.Protos.Payment.newBuilder(payment_).mergeFrom(value).buildPartial(); } else { payment_ = value; } onChanged(); } else { paymentBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**