Artifact Content
Not logged in

Artifact 24f803d0f9241e7e91da48bdb6c99c4eae1fb1ac:

package org.interledger.spsp.client;

import org.interledger.spsp.core.SpspService;
import org.interledger.spsp.core.model.PaymentRequest;
import org.interledger.spsp.core.model.Receiver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;


public class Application {

  private static final Logger log = LoggerFactory.getLogger(Application.class);

  public static void main(String[] args) {;

  public SpspService spspService(RestTemplateBuilder builder) {
    return new SpringSpspClientService(;
   * Simple command line runner for basic testing.
   * @param service
   *  The Simple Payment Setup Protocol service to use.
   * @return
   *  A commandline runner.
   * @throws Exception
   *  If there was an error using the service.
  public CommandLineRunner run(SpspService service) throws Exception {
    return args -> {
      Receiver bob = service.query(URI.create(""));"asked for receiver bob, got {}", bob);
      Receiver alice = service.query(URI.create(""));"asked for receiver alice, got {}", alice);
      PaymentRequest bobPayReq = service.setupPayment(URI.create(""), "10.40", "", "totally fake for testing");"asked bob to set up a payment, got {}", bobPayReq);
      PaymentRequest alicePayReq = service.setupPayment(URI.create(""), "10.40", "", "totally fake for testing");"asked alice to set up a payment, got {}", alicePayReq);