/** * Parse a payment request. * * @param paymentRequest payment request to parse * @return instance of {@link PaymentSession}, used as a value object * @throws PaymentProtocolException */ public static PaymentSession parsePaymentRequest(Protos.PaymentRequest paymentRequest) throws PaymentProtocolException { return new PaymentSession(paymentRequest, false, null); }
/** * Parse a payment request. * * @param paymentRequest payment request to parse * @return instance of {@link PaymentSession}, used as a value object * @throws PaymentProtocolException */ public static PaymentSession parsePaymentRequest(Protos.PaymentRequest paymentRequest) throws PaymentProtocolException { return new PaymentSession(paymentRequest, false, null); }
/** * Parse a payment request. * * @param paymentRequest payment request to parse * @return instance of {@link PaymentSession}, used as a value object * @throws PaymentProtocolException */ public static PaymentSession parsePaymentRequest(Protos.PaymentRequest paymentRequest) throws PaymentProtocolException { return new PaymentSession(paymentRequest, false, null); }
/** * Parse a payment request. * * @param paymentRequest payment request to parse * @return instance of {@link PaymentSession}, used as a value object * @throws PaymentProtocolException */ public static PaymentSession parsePaymentRequest(Protos.PaymentRequest paymentRequest) throws PaymentProtocolException { return new PaymentSession(paymentRequest, false, null); }
@Override public PaymentSession call() throws Exception { HttpURLConnection connection = (HttpURLConnection)uri.toURL().openConnection(); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTREQUEST); connection.setUseCaches(false); Protos.PaymentRequest paymentRequest = Protos.PaymentRequest.parseFrom(connection.getInputStream()); return new PaymentSession(paymentRequest, verifyPki, trustStoreLoader); } });
@Override public PaymentSession call() throws Exception { HttpURLConnection connection = (HttpURLConnection)uri.toURL().openConnection(); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTREQUEST); connection.setUseCaches(false); Protos.PaymentRequest paymentRequest = Protos.PaymentRequest.parseFrom(connection.getInputStream()); return new PaymentSession(paymentRequest, verifyPki, trustStoreLoader); } });
@Override public PaymentSession call() throws Exception { HttpURLConnection connection = (HttpURLConnection)uri.toURL().openConnection(); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTREQUEST); connection.setUseCaches(false); Protos.PaymentRequest paymentRequest = Protos.PaymentRequest.parseFrom(connection.getInputStream()); return new PaymentSession(paymentRequest, verifyPki, trustStoreLoader); } });
@Override public PaymentSession call() throws Exception { HttpURLConnection connection = (HttpURLConnection)uri.toURL().openConnection(); connection.setRequestProperty("Accept", PaymentProtocol.MIMETYPE_PAYMENTREQUEST); connection.setUseCaches(false); Protos.PaymentRequest paymentRequest = Protos.PaymentRequest.parseFrom(connection.getInputStream()); return new PaymentSession(paymentRequest, verifyPki, trustStoreLoader); } });
session = new PaymentSession(paymentRequest, verifyPki); } catch (PaymentProtocolException e) { System.err.println("Error creating payment session " + e.getMessage());
Protos.PaymentRequest request = Protos.PaymentRequest.parseFrom(stream); stream.close(); session = new PaymentSession(request); } else if ("http".equals(uri.getScheme())) { session = PaymentSession.createFromUrl(arg).get();
byte[] paymentRequestBytes = Resources.toByteArray(paymentRequestUri.toURL()); paymentRequest = Protos.PaymentRequest.parseFrom(paymentRequestBytes); paymentSession = new PaymentSession(paymentRequest, checkPKI, trustStoreLoader); InputStream inputStream = PaymentProtocolService.class.getResourceAsStream(paymentRequestUri.toString()); paymentRequest = Protos.PaymentRequest.parseFrom(inputStream); paymentSession = new PaymentSession(paymentRequest, checkPKI, trustStoreLoader);
try { if (paymentRequestData.get().getPaymentRequest().isPresent()) { paymentSession = new PaymentSession(paymentRequestData.get().getPaymentRequest().get(), false); } else { log.error("No PaymentRequest in PaymentRequestData - cannot create a paymentSession");