Skip to content

Commit

Permalink
Merge branch 'master' into preAuthDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
javidlulu committed Sep 22, 2020
2 parents 7e954b0 + 9a77e6c commit f4e3d27
Show file tree
Hide file tree
Showing 22 changed files with 623 additions and 459 deletions.
2 changes: 1 addition & 1 deletion DynamicQRCode.md
Expand Up @@ -27,7 +27,7 @@ Before integrating with the SDK, run through this checklist:
Add this dependency to your project's build file:

```groovy
compile "jp.ne.paypay:paypayopa:0.4.0"
compile "jp.ne.paypay:paypayopa:0.5.0"
```
### Build your Client
Build your client by adding your API Key and Secret like defined below. We enable API Authentication using HMAC, however the SDK will take care of the authentication by itself. [Click here](https://www.paypay.ne.jp/opa/doc/v1.0/dynamicqrcode#tag/Api-Authentication) if you want to know more about the authentication.
Expand Down
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -2,11 +2,15 @@

[![License](https://img.shields.io/:license-apache-orange.svg)](https://opensource.org/licenses/Apache-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/jp.ne.paypay/paypayopa)](https://search.maven.org/artifact/jp.ne.paypay/paypayopa)
[![javadoc](https://javadoc.io/badge2/jp.ne.paypay/paypayopa/javadoc.svg)](https://javadoc.io/doc/jp.ne.paypay/paypayopa)
[![Build Status](https://travis-ci.org/paypay/paypayopa-sdk-java.svg?branch=master)](https://travis-ci.org/paypay/paypayopa-sdk-java)
[![Coverage Status](https://coveralls.io/repos/github/paypay/paypayopa-sdk-java/badge.svg?branch=master)](https://coveralls.io/github/paypay/paypayopa-sdk-java?branch=master)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/paypay/paypayopa-sdk-java.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/paypay/paypayopa-sdk-java/context:java)
[![Black Duck Security Risk](https://copilot.blackducksoftware.com/github/repos/paypay/paypayopa-sdk-java/branches/master/badge-risk.svg)](https://copilot.blackducksoftware.com/github/repos/paypay/paypayopa-sdk-java/branches/master)
[![Maintainability](https://api.codeclimate.com/v1/badges/64c7339473ea7711415c/maintainability)](https://codeclimate.com/github/paypay/paypayopa-sdk-java/maintainability)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fpaypay%2Fpaypayopa-sdk-java.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fpaypay%2Fpaypayopa-sdk-java?ref=badge_shield)
![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/paypay/paypayopa-sdk-java)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/701cdfe4502d48f7bb4063a94592b7ac)](https://app.codacy.com/gh/paypay/paypayopa-sdk-java?utm_source=github.com&utm_medium=referral&utm_content=paypay/paypayopa-sdk-java&utm_campaign=Badge_Grade_Dashboard)

Java SDK for interacting with PayPay APIs

Expand Down Expand Up @@ -41,7 +45,7 @@ Building the API client library requires Gradle to be installed.
Add this dependency to your project's build.gradle file:

```groovy
compile "jp.ne.paypay:paypayopa:0.4.0"
compile "jp.ne.paypay:paypayopa:0.5.0"
```

## Getting Started
Expand All @@ -65,6 +69,7 @@ Class | Method | HTTP request | Description
*PaymentApi* | [**cancelPayment**](docs/PaymentApi.md#cancelPayment) | **DELETE** /v2/payments/{merchantPaymentId} | Cancel a payment
*PaymentApi* | [**createPayment**](docs/PaymentApi.md#createPayment) | **POST** /v2/payments | Create a payment
*PaymentApi* | [**createPaymentAuthorization**](docs/PaymentApi.md#createPaymentAuthorization) | **POST** /v2/payments/preauthorize | Create a payment authorization to block the money
*PaymentApi* | [**createContinuousPayment**](docs/PaymentApi.md#createContinuousPayment) | **POST** /v1/subscription/payments | Create a continuous payment and start the money transfer
*PaymentApi* | [**revertAuth**](docs/PaymentApi.md#revertAuth) | **POST** /v2/payments/preauthorize/revert | Revert a payment authorization
*PaymentApi* | [**capturePaymentAuth**](docs/PaymentApi.md#capturePaymentAuth) | **POST** /v2/payments/capture | Capture a payment authorization
*PaymentApi* | [**createQRCode**](docs/PaymentApi.md#createQRCode) | **POST** /v2/codes | Create a Code
Expand Down Expand Up @@ -108,3 +113,7 @@ Class | Method | HTTP request | Description
- [RefundState](docs/RefundState.md)
- [ResultInfo](docs/ResultInfo.md)
- [AccountLinkQRCode](docs/AccountLinkQRCode.md)


## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fpaypay%2Fpaypayopa-sdk-java.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fpaypay%2Fpaypayopa-sdk-java?ref=badge_large)
13 changes: 9 additions & 4 deletions build.gradle
Expand Up @@ -12,7 +12,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'jp.ne.paypay'
version = '0.4.0'
version = '0.5.0'



Expand All @@ -35,6 +35,11 @@ jacocoTestReport {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['jp/ne/paypay/model/**', 'jp/ne/paypay/example/**'])
}))
}
}

def isDevBuild
Expand Down Expand Up @@ -80,10 +85,10 @@ dependencies {
compile group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
compile group: 'org.glassfish', name: 'javax.el', version: '3.0.0'

testCompile 'org.mockito:mockito-core:3.5.7'
testCompile 'org.mockito:mockito-core:3.5.11'

testCompile("org.junit.jupiter:junit-jupiter-engine:5.6.2")
testCompile("org.junit.platform:junit-platform-runner:1.6.2")
testCompile("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testCompile("org.junit.platform:junit-platform-runner:1.7.0")
}
pmd{
consoleOutput = true
Expand Down
49 changes: 49 additions & 0 deletions docs/PaymentApi.md
Expand Up @@ -6,6 +6,7 @@ Method | HTTP request | Description
[**cancelPayment**](PaymentApi.md#cancelPayment) | **DELETE** /v2/payments/{merchantPaymentId} | Cancel a payment
[**createPayment**](PaymentApi.md#createPayment) | **POST** /v2/payments | Create a payment
[**createPaymentAuthorization**](PaymentApi.md#createPaymentAuthorization) | **POST** /v2/payments/preauthorize | Create a payment authorization to block the money
[**createContinuousPayment**](docs/PaymentApi.md#createContinuousPayment) | **POST** /v1/subscription/payments | Create a continuous payment and start the money transfer
[**revertAuth**](PaymentApi.md#revertAuth) | **POST** /v2/payments/preauthorize/revert | Revert a payment authorization
[**capturePaymentAuth**](PaymentApi.md#capturePaymentAuth) | **POST** /v2/payments/capture | Capture a payment authorization
[**createQRCode**](PaymentApi.md#createQRCode) | **POST** /v2/codes | Create a Code
Expand Down Expand Up @@ -197,6 +198,54 @@ Please refer to the below document for more information :
https://www.paypay.ne.jp/opa/doc/v1.0/preauth_capture#operation/createAuth
```

<a name="createContinuousPayment"></a>
# **createContinuousPayment**
> PaymentDetails createContinuousPayment(body)
Create a continuous payment
Create a continuous payment and start the money transfer. **Timeout: 30s**

### Example
```java
//Import classes:
import jp.ne.paypay.ApiException;
import jp.ne.paypay.api.PaymentApi;


PaymentApi apiInstance = new PaymentApi(apiClient);

Payment payment = new Payment();
payment.setAmount(new MoneyAmount().amount(1).currency(MoneyAmount.CurrencyEnum.JPY));
payment.setMerchantPaymentId("MERCHANT_PAYMENT_ID");
payment.setUserAuthorizationId("USER_AUTHORIZATION_ID");// User should be with scope continuous_payments
payment.setRequestedAt(Instant.now().getEpochSecond());
payment.setStoreId("STORE_ID");
payment.setTerminalId("TERMINAL_ID");
payment.setOrderReceiptNumber("ORDER_RECEIPT_NUMBER");
payment.setOrderDescription("ORDER_DESCRIPTION");
MerchantOrderItem merchantOrderItem =
new MerchantOrderItem()
.category("pasteries").name("Moon Cake")
.productId("PRODUCT_ID").quantity(1)
.unitPrice(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));
List<MerchantOrderItem> merchantOrderItems = new ArrayList<>();
merchantOrderItems.add(merchantOrderItem);
payment.setOrderItems(new ArrayList<MerchantOrderItem>(merchantOrderItems));

try {
PaymentDetails result = apiInstance.createContinuousPayment(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentApi#createContinuousPayment");
System.out.println(e.getResponseBody());
}
```

```
Please refer to the below document for more information :
https://www.paypay.ne.jp/opa/doc/v1.0/continuous_payments#operation/createPayment
```

<a name="revertAuth"></a>
# **revertAuth**
> PaymentDetails revertAuth(body, agreeSimilarTransaction)
Expand Down

0 comments on commit f4e3d27

Please sign in to comment.