paymentACKMemo.setText(paymentRequestData.getPaymentACK().get().getMemo());
@Override public PaymentProtocol.Ack call() throws Exception { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", PaymentProtocol.MIMETYPE_PAYMENT); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTACK); connection.setRequestProperty("Content-Length", Integer.toString(payment.getSerializedSize())); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); // Send request. DataOutputStream outStream = new DataOutputStream(connection.getOutputStream()); payment.writeTo(outStream); outStream.flush(); outStream.close(); // Get response. Protos.PaymentACK paymentAck = Protos.PaymentACK.parseFrom(connection.getInputStream()); return PaymentProtocol.parsePaymentAck(paymentAck); } });
@Override public Ack call() throws Exception { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "application/bitcoin-payment"); connection.setRequestProperty("Accept", "application/bitcoin-paymentack"); connection.setRequestProperty("Content-Length", Integer.toString(payment.getSerializedSize())); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); // Send request. DataOutputStream outStream = new DataOutputStream(connection.getOutputStream()); payment.writeTo(outStream); outStream.flush(); outStream.close(); // Get response. InputStream inStream = connection.getInputStream(); Protos.PaymentACK.Builder paymentAckBuilder = Protos.PaymentACK.newBuilder().mergeFrom(inStream); Protos.PaymentACK paymentAck = paymentAckBuilder.build(); String memo = null; if (paymentAck.hasMemo()) memo = paymentAck.getMemo(); return new Ack(memo); } });
Optional<Protos.PaymentACK> paymentACK = Optional.of(Protos.PaymentACK.parseFrom(serialisedBytes)); paymentRequestData.setPaymentACK(paymentACK);
@Override public void initialiseContent(JPanel contentPanel) { paymentSentOKSummary = Labels.newStatusLabel(Optional.<MessageKey>absent(), null, Optional.<Boolean>absent()); AccessibilityDecorator.apply(paymentSentOKSummary, CoreMessageKey.PAYMENT_SENDING_TO_REQUESTER); // BIP70 PaymentACK memo paymentACKMemo = TextBoxes.newReadOnlyTextArea(6, MultiBitUI.PASSWORD_LENGTH); // Apply any Payment Request parameters if (getWizardModel().getPaymentRequestData().isPresent()) { PaymentRequestData paymentRequestData = getWizardModel().getPaymentRequestData().get(); // Fill in the paymentACK memo if (paymentRequestData.getPaymentACK().isPresent()) { paymentACKMemo.setText(paymentRequestData.getPaymentACK().get().getMemo()); } } paymentACKMemoLabel = Labels.newBlankLabel(); paymentACKMemoLabel.setText(Languages.safeText(MessageKey.SEND_PAYMENT_ACK_MEMO_LABEL)); AccessibilityDecorator.apply(paymentACKMemoLabel, MessageKey.SEND_PAYMENT_ACK_MEMO_TITLE); contentPanel.setLayout( new MigLayout( Panels.migXYLayout(), "[]", // Column constraints "[]40[]2[]" // Row constraints )); contentPanel.add(paymentSentOKSummary, "wrap"); contentPanel.add(paymentACKMemoLabel, "wrap"); contentPanel.add(paymentACKMemo, "growx,push,wrap"); }
@Override public void onSuccess(PaymentProtocol.Ack result) { // Have successfully received a PaymentAck from the merchant log.info("Received PaymentAck from merchant. Memo: {}", result.getMemo()); getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo()); PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService(); if (finalPayment != null) { Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo()); finalPaymentRequestData.setPayment(Optional.of(finalPayment)); finalPaymentRequestData.setPaymentACK(paymentACK); log.debug("Saving PaymentMemo of {} and PaymentACKMemo of {}", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : "n/a"); WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId()); walletService.addPaymentRequestData(finalPaymentRequestData); // Write payments CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword(); if (password != null) { walletService.writePayments(password); } CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null)); } else { log.error("No payment and hence cannot save payment or paymentACK"); } }
@Override public PaymentProtocol.Ack call() throws Exception { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", PaymentProtocol.MIMETYPE_PAYMENT); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTACK); connection.setRequestProperty("Content-Length", Integer.toString(payment.getSerializedSize())); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); // Send request. DataOutputStream outStream = new DataOutputStream(connection.getOutputStream()); payment.writeTo(outStream); outStream.flush(); outStream.close(); // Get response. Protos.PaymentACK paymentAck = Protos.PaymentACK.parseFrom(connection.getInputStream()); return PaymentProtocol.parsePaymentAck(paymentAck); } });
@Override public PaymentProtocol.Ack call() throws Exception { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", PaymentProtocol.MIMETYPE_PAYMENT); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTACK); connection.setRequestProperty("Content-Length", Integer.toString(payment.getSerializedSize())); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); // Send request. DataOutputStream outStream = new DataOutputStream(connection.getOutputStream()); payment.writeTo(outStream); outStream.flush(); outStream.close(); // Get response. Protos.PaymentACK paymentAck = Protos.PaymentACK.parseFrom(connection.getInputStream()); return PaymentProtocol.parsePaymentAck(paymentAck); } });
public org.bitcoin.protocols.payments.Protos.PaymentACK buildPartial() { org.bitcoin.protocols.payments.Protos.PaymentACK result = new org.bitcoin.protocols.payments.Protos.PaymentACK(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (paymentBuilder_ == null) { result.payment_ = payment_; } else { result.payment_ = paymentBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public org.bitcoin.protocols.payments.Protos.PaymentACK buildPartial() { org.bitcoin.protocols.payments.Protos.PaymentACK result = new org.bitcoin.protocols.payments.Protos.PaymentACK(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (paymentBuilder_ == null) { result.payment_ = payment_; } else { result.payment_ = paymentBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@Override public PaymentProtocol.Ack call() throws Exception { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", PaymentProtocol.MIMETYPE_PAYMENT); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTACK); connection.setRequestProperty("Content-Length", Integer.toString(payment.getSerializedSize())); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); // Send request. DataOutputStream outStream = new DataOutputStream(connection.getOutputStream()); payment.writeTo(outStream); outStream.flush(); outStream.close(); // Get response. Protos.PaymentACK paymentAck = Protos.PaymentACK.parseFrom(connection.getInputStream()); return PaymentProtocol.parsePaymentAck(paymentAck); } });
public org.bitcoin.protocols.payments.Protos.PaymentACK buildPartial() { org.bitcoin.protocols.payments.Protos.PaymentACK result = new org.bitcoin.protocols.payments.Protos.PaymentACK(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (paymentBuilder_ == null) { result.payment_ = payment_; } else { result.payment_ = paymentBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@Override public PaymentProtocol.Ack call() throws Exception { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", PaymentProtocol.MIMETYPE_PAYMENT); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTACK); connection.setRequestProperty("Content-Length", Integer.toString(payment.getSerializedSize())); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); // Send request. DataOutputStream outStream = new DataOutputStream(connection.getOutputStream()); payment.writeTo(outStream); outStream.flush(); outStream.close(); // Get response. Protos.PaymentACK paymentAck = Protos.PaymentACK.parseFrom(connection.getInputStream()); return PaymentProtocol.parsePaymentAck(paymentAck); } });
public org.bitcoin.protocols.payments.Protos.PaymentACK buildPartial() { org.bitcoin.protocols.payments.Protos.PaymentACK result = new org.bitcoin.protocols.payments.Protos.PaymentACK(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (paymentBuilder_ == null) { result.payment_ = payment_; } else { result.payment_ = paymentBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public org.bitcoin.protocols.payments.Protos.PaymentACK buildPartial() { org.bitcoin.protocols.payments.Protos.PaymentACK result = new org.bitcoin.protocols.payments.Protos.PaymentACK(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (paymentBuilder_ == null) { result.payment_ = payment_; } else { result.payment_ = paymentBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.memo_ = memo_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder toBuilder() { return newBuilder(this); }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.PaymentACK prototype) {
public Builder toBuilder() { return newBuilder(this); }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; if (!hasPayment()) { memoizedIsInitialized = 0; return false; } if (!getPayment().isInitialized()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }