Sending a payment

The next function is the one to pay the bill. Before sending the bitcoins, this function will check the payment request details, including the merchant's x509 certificate. We print out in the console the payment request details to let the client know whom they are going to pay:

private static void send(PaymentSession session,WalletAppKit k) {     log.info("Payment Request");     log.info("Amount to Pay: " + session.getValue().toFriendlyString());     log.info("Date: " + session.getDate());     // Probably indicates what your are paying for.     log.info("Message from merchant : " + session.getMemo());      PaymentProtocol.PkiVerificationData identity = session.verifyPki();     if (identity != null) {         // Merchant identity from the certificate log.info("Payment ...

Get Blockchain By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.