コード例 #1
0
  protected final void parseAndHandlePaymentRequest(@Nonnull final byte[] serializedPaymentRequest)
      throws PaymentRequestException {
    final PaymentIntent paymentIntent =
        PaymentProtocol.parsePaymentRequest(serializedPaymentRequest);

    handlePaymentIntent(paymentIntent);
  }
コード例 #2
0
  private byte[] determinePaymentRequest(final boolean includeBluetoothMac) {
    final ECKey key = (ECKey) addressView.getSelectedItem();
    final Address address = key.toAddress(Constants.NETWORK_PARAMETERS);

    return PaymentProtocol.createPaymentRequest(
            amountCalculatorLink.getAmount(),
            address,
            null,
            includeBluetoothMac && bluetoothMac != null ? "bt:" + bluetoothMac : null)
        .toByteArray();
  }