|
| 1 | +This repository shows how to implement a merchant server in order to successfully perform a [GooglePay](https://pay.google.com) payment using using our web-services. For more information about the web-services, please refer to the official documentation. |
| 2 | + |
| 3 | +* This example uses [Spark](http://sparkjava.com/) framework that allows to create a simple server easily |
| 4 | +* In order to call the Web Services SOAP v5 to perform the payment, this example uses the existing [Web Services SDK](https://github.com/payzen/payzen-webservices-v5-sdk-java). Feel free to use your own solution based in JAX-WS, [CXF](https://github.com/apache/cxf), [Axis](https://github.com/apache/axis2-java), etc. |
| 5 | + |
| 6 | +## Table of contents |
| 7 | + |
| 8 | +* [Getting started](#getting-started) |
| 9 | +* [What's included](#whats-included) |
| 10 | +* [Configuration](#configuration) |
| 11 | + |
| 12 | +## Getting started |
| 13 | + |
| 14 | +* Clone the repo: `git clone https://github.com/lyra/googlepay-payment-sparkjava-integration-sample.git`. |
| 15 | +* Set your shop data in the _app-configuration.properties_ file as described in [configuration instructions](#configuration). |
| 16 | +* Run `mvn package`, to build jar executable |
| 17 | +* Run `java -jar inApp-server-1.0-jar-with-dependencies.jar` |
| 18 | + |
| 19 | +The application should have and output like this: |
| 20 | + |
| 21 | + INFO org.eclipse.jetty.util.log - Logging initialized @698ms |
| 22 | + INFO spark.embeddedserver.jetty.EmbeddedJettyServer - == Spark has ignited ... |
| 23 | + INFO spark.embeddedserver.jetty.EmbeddedJettyServer - >> Listening on 0.0.0.0:9090 |
| 24 | + INFO org.eclipse.jetty.server.Server - jetty-9.3.6.v20151106 |
| 25 | + INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@30946381{HTTP/1.1,[http/1.1]}{0.0.0.0:5678} |
| 26 | + INFO org.eclipse.jetty.server.Server - Started @1065ms |
| 27 | + |
| 28 | +By default the application run on 9090 port. See [configuration instructions](#configuration) if you want to change this value. |
| 29 | + |
| 30 | +## What's included |
| 31 | + |
| 32 | +``` |
| 33 | +|---com.lyra |
| 34 | +| |-- Server.java |
| 35 | +| |-- ServerConfiguration.java |
| 36 | +|---com.lyra.googlepay |
| 37 | +| |-- GooglePayController.java |
| 38 | +| |-- GooglePayService.java |
| 39 | +|---resources |
| 40 | +| |-- app-configuration.properties |
| 41 | +``` |
| 42 | + |
| 43 | +## Configuration |
| 44 | + |
| 45 | +Server port can be easily configured via [Spark](http://sparkjava.com/) modifying the _Server.java_ file. |
| 46 | + |
| 47 | +```java |
| 48 | +port(9090); |
| 49 | +``` |
| 50 | + |
| 51 | +All the shop configuration data must be set in the _app-configuration.properties_ file: |
| 52 | + |
| 53 | +``` |
| 54 | +# |
| 55 | +# EDIT YOUR MERCHANT SETTINGS HERE |
| 56 | +# |
| 57 | +
|
| 58 | +merchantSiteId=#Your merchant Id here |
| 59 | +merchantTestKey=#Your test certificate here |
| 60 | +merchantProdKey=#Your production certificate here |
| 61 | +
|
| 62 | +# |
| 63 | +# URL of your payment platform. See official documentation for further details. |
| 64 | +# |
| 65 | +paymentPlatformUrl=#Your payment platform URL here |
| 66 | +``` |
0 commit comments