Skip to content

Commit

Permalink
Merge pull request #85 from paypay/PP-60645-cashbackapi
Browse files Browse the repository at this point in the history
Pp 60645 cashbackapi
  • Loading branch information
Shreyansh Pandey committed Feb 7, 2021
2 parents 8691490 + 5243b46 commit e5de187
Show file tree
Hide file tree
Showing 23 changed files with 1,366 additions and 94 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ Title | Method | HTTP request | Description
*UserApi* | [**getMaskedUserProfile**](docs/UserApi.md#getMaskedUserProfile) | **GET** /v2/user/profile/secure?userAuthorizationId={userAuthorizationId} | Get masked user profile
*UserApi* | [**getUserAuthorizationStatus**](docs/UserApi.md#getUserAuthorizationStatus) | **GET** /v2/user/authorizations?userAuthorizationId={userAuthorizationId} | Get user authorization status
*UserApi* | [**unlinkUser**](docs/UserApi.md#unlinkUser) | **DELETE** /v2/user/authorizations/{userAuthorizationId} | Unlink user
*PendingPaymentApi* | [**createPendingPayment**](docs/PendingPaymentApi.md#createPendingPayment) | **POST** /v1/requestOrder | Sends a push notification to the user requesting payment.
*PendingPaymentApi* | [**getPaymentDetails**](docs/PendingPaymentApi.md#getPaymentDetails) | **GET** /v1/requestOrder/{merchantPaymentId} | Get payment details.
*PendingPaymentApi* | [**cancelPendingOrder**](docs/PendingPaymentApi.md#cancelPendingOrder) | **DELETE** /v1/requestOrder/{merchantPaymentId} | This api is used delete the pending order
*PendingPaymentApi* | [**getRefundDetails**](docs/PendingPaymentApi.md#getRefundDetails) | **GET** /v2/refunds/{merchantRefundId}| Get refund details.
*PendingPaymentApi* | [**refundPayment**](docs/PendingPaymentApi.md#refundPayment) | **POST** /v2/refunds | Refund a payment.
*CashbackApi* | [**giveCashback**](docs/CashbackApi.md#giveCashback) | **POST** /v2/cashback | Transfer money from merchants campaign wallet to user wallet
*CashbackApi* | [**getCashback**](docs/CashbackApi.md#getCashback) | **GET** /v2/cashback/{merchantCashbackId} | Check the cashback details of the cashback given
*CashbackApi* | [**reverseCashback**](docs/CashbackApi.md#reverseCashback) | **POST** /v2/cashback_reversal | Transfer money back from user wallet to merchants campaign wallet.
*CashbackApi* | [**getReverseCashback**](docs/CashbackApi.md#getReverseCashback) | **GET** /v2/cashback_reversal/{merchantCashbackReversalId}/{merchantCashbackId} | Check the cashback reversal details of the cashback reversed

## Documentation for Models
- [Capture](docs/Capture.md)
Expand All @@ -104,10 +113,6 @@ Title | Method | HTTP request | Description
- [NotDataResponse](docs/NotDataResponse.md)
- [Payment](docs/Payment.md)
- [PaymentDetails](docs/PaymentDetails.md)
- [PaymentMethodDetails](docs/PaymentMethodDetails.md)
- [PaymentMethodListDetails](docs/PaymentMethodListDetails.md)
- [PaymentOrder](docs/PaymentOrder.md)
- [PaymentOrderDetails](docs/PaymentOrderDetails.md)
- [PaymentState](docs/PaymentState.md)
- [PaymentStateCaptures](docs/PaymentStateCaptures.md)
- [PaymentStateRefunds](docs/PaymentStateRefunds.md)
Expand All @@ -116,11 +121,15 @@ Title | Method | HTTP request | Description
- [QRCode](docs/QRCode.md)
- [QRCodeResponse](docs/QRCodeResponse.md)
- [Refund](docs/Refund.md)
- [RefundOrder](docs/RefundOrder.md)
- [RefundState](docs/RefundState.md)
- [ResultInfo](docs/ResultInfo.md)
- [AccountLinkQRCode](docs/AccountLinkQRCode.md)

- [Cashback](docs/Cashback.md)
- [ReverseCashback](docs/ReverseCashback.md)
- [CashbackDetails](docs/CashbackDetails.md)
- [ReverseCashbackDetails](docs/ReverseCashbackDetails.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)
18 changes: 18 additions & 0 deletions docs/Cashback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# Cashback

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**merchantCashbackId** | **String** | The unique cashback transaction id provided by merchant | Required
**userAuthorizationId** | **String** | The PayPay user reference id returned by the user authorization flow | Required
**amount** | [**MoneyAmount**](MoneyAmount.md) | | Required
**requestedAt** | **Long** | Epoch timestamp in seconds | Required
**orderDescription** | **String** | Description of the order |
**walletType** | **Enum(WalletType)** | Enum: "PREPAID" "CASHBACK" |
**expiryDate** | **String** | The date on which the Cashback Expires at midnight (format YYYY-MM-DD) |
**metadata** | **Object** | Extra information the merchant want to add |




152 changes: 152 additions & 0 deletions docs/CashbackApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# CashbackApi

Method | HTTP request | Description
------------- | ------------- | -------------
[**giveCashback**](docs/cashbackApi.md#giveCashback) | **POST** /v2/cashback | Transfer money from merchants campaign wallet to user wallet
[**getCashback**](docs/cashbackApi.md#getCashback) | **GET** /v2/cashback/{merchantCashbackId} | Check the cashback details of the cashback given
[**reverseCashback**](docs/cashbackApi.md#reverseCashback) | **POST** /v2/cashback_reversal | Transfer money back from user wallet to merchants campaign wallet.
[**getReverseCashback**](docs/cashbackApi.md#getReverseCashback) | **GET** /v2/cashback_reversal/{merchantCashbackReversalId}/{merchantCashbackId} | Check the cashback reversal details of the cashback reversed

<a name="giveCashback"></a>
# **giveCashback**
> CashbackDetails createCashbackRequest(Cashback cashback)
Give Cashback to User

Transfer money from merchants campaign wallet to user wallet.

### Example
```java
//Import classes:
import jp.ne.paypay.ApiException;
import jp.ne.paypay.api.CashbackApi;
import jp.ne.paypay.model.Cashback;
import jp.ne.paypay.model.CashbackDetails;

CashbackApi apiInstance = new CashbackApi(apiClient);

Cashback cashback = new Cashback();
cashback.setMerchantCashbackId("merchantCashbackId");
cashback.setUserAuthorizationId(userAuthorizationId);
cashback.setExpiryDate("2021-02-28"); // Optional, if set Should be with format YYYY-MM-DD
cashback.setAmount(new MoneyAmount().amount(amount).currency(MoneyAmount.CurrencyEnum.JPY));

try {
CashbackDetails result = apiInstance.createCashbackRequest(cashback);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CashbackApi#createCashbackRequest");
System.out.println(e.getResponseBody());
}
```

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

<a name="getCashback"></a>
# **getCashback**
> CashbackDetails getCashbackDetails(String merchantCashbackId)
Check Cashback Details

Check the cashback details of the cashback given.

### Example
```java
// Import classes:
import jp.ne.paypay.ApiException;
import jp.ne.paypay.api.CashbackApi;
import jp.ne.paypay.model.Cashback;
import jp.ne.paypay.model.CashbackDetails;

CashbackApi apiInstance = new CashbackApi(apiClient);

String merchantCashbackId = "MERCHANT_CASHBACK_ID";

try {
CashbackDetails result = apiInstance.getCashbackDetails(merchantCashbackId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CashbackApi#getCashbackDetails");
System.out.println(e.getResponseBody());
}
```

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

<a name="reverseCashback"></a>
# **reverseCashback**
> ReverseCashbackDetails createReverseCashbackRequest(ReverseCashback reverseCashback)
Reverse a given cashback

Transfer money back from user wallet to merchants campaign wallet.

### Example
```java
//Import classes:
import jp.ne.paypay.ApiException;
import jp.ne.paypay.api.CashbackApi;
import jp.ne.paypay.model.ReverseCashback;
import jp.ne.paypay.model.ReverseCashbackDetails;

CashbackApi apiInstance = new CashbackApi(apiClient);

ReverseCashback reverseCashback = new ReverseCashback();
reverseCashback.setMerchantCashbackReversalId("merchantCashbackReversalId");
reverseCashback.setMerchantCashbackId("merchantCashbackId");
reverseCashback.setAmount(new MoneyAmount().amount(amount).currency(MoneyAmount.CurrencyEnum.JPY));

try {
ReverseCashbackDetails result = apiInstance.createReverseCashbackRequest(reverseCashback);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CashbackApi#createReverseCashbackRequest");
System.out.println(e.getResponseBody());
}
```

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

<a name="getReverseCashback"></a>
# **getReverseCashback**
> ReverseCashbackDetails getReversedCashbackDetails(String merchantCashbackReversalId, String merchantCashbackId)
Check Cashback Reversal Details

Check the cashback reversal details of the cashback reversed

### Example
```java
// Import classes:
import jp.ne.paypay.ApiException;
import jp.ne.paypay.api.CashbackApi;
import jp.ne.paypay.model.ReverseCashback;
import jp.ne.paypay.model.ReverseCashbackDetails;

CashbackApi apiInstance = new CashbackApi(apiClient);

String merchantCashbackId = "MERCHANT_CASHBACK_ID";
String merchantCashbackReversalId = "MERCHANT_CASHBACK_REVERSAL_ID";

try {
ReverseCashbackDetails result = apiInstance.getReversedCashbackDetails(merchantCashbackReversalId, merchantCashbackId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CashbackApi#getReversedCashbackDetails");
System.out.println(e.getResponseBody());
}
```

```
Please refer to the below document for more information :
https://www.paypay.ne.jp/opa/doc/v1.0/cashback#operation/checkCashbackReversal
```
12 changes: 12 additions & 0 deletions docs/CashbackDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# CashbackDetails

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**resultInfo** | [**ResultInfo**](ResultInfo.md) | |
**data** | [**Cashback**](Cashback.md) | |




19 changes: 0 additions & 19 deletions docs/PaymentMethodDetails.md

This file was deleted.

11 changes: 0 additions & 11 deletions docs/PaymentMethodListDetails.md

This file was deleted.

22 changes: 0 additions & 22 deletions docs/PaymentOrder.md

This file was deleted.

19 changes: 0 additions & 19 deletions docs/PaymentOrderDetails.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/RefundOrder.md

This file was deleted.

16 changes: 16 additions & 0 deletions docs/ReverseCashback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# ReverseCashback

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**merchantCashbackReversalId** | **String** | The unique cashback reversal transaction id provided by merchant | Required
**merchantCashbackId** | **String** | The unique cashback transaction id provided by merchant | Required
**amount** | [**MoneyAmount**](MoneyAmount.md) | | Required
**requestedAt** | **Long** | Epoch timestamp in seconds | Required
**reason** | **String** | Reason for reversing the cashback |
**metadata** | **Object** | Extra information the merchant want to add |




12 changes: 12 additions & 0 deletions docs/ReverseCashbackDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# ReverseCashbackDetails

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**resultInfo** | [**ResultInfo**](ResultInfo.md) | |
**data** | [**ReverseCashback**](ReverseCashback.md) | |




1 change: 1 addition & 0 deletions src/main/java/jp/ne/paypay/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class ApiConstants {
public static final String APPLICATION_JSON = "application/json";
public static final String ACCEPT = "Accept";
public static final String MERCHANT_PAYMENT_ID = "merchantPaymentId";
public static final String MERCHANT_CASHBACK_ID = "merchantCashbackId";
public static final String MERCHANT_REFUND_ID = "merchantRefundId";
public static final String CODE_ID = "codeId";
public static final String HMAC_AUTH = "HmacAuth";
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/jp/ne/paypay/api/ApiNameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ public class ApiNameConstants {
public static final String CREATE_REQUEST_ORDER = "v1_createRequestOrder";
public static final String GET_REQUEST_ORDER = "v1_getRequestOrder";
public static final String CANCEL_REQUEST_ORDER = "v1_cancelRequestOrder";
public static final String REFUND_REQUEST_ORDER = "v1_createRequestOrderRefund";
public static final String GET_SECURE_USER_PROFILE = "v2_getSecureUserProfile";
public static final String CHECK_BALANCE = "v2_checkWalletBalance";
public static final String GET_USER_AUTH_STATUS = "v2_userAuthStatus";
public static final String UNLINK_USER = "v2_unlinkUser";
public static final String CREATE_QR_SESSION = "v1_qrSession";
public static final String CREATE_CASHBACK_REQUEST = "v2_createCashBackRequest";
public static final String GET_CASHBACK_DETAILS = "v2_getCashbackDetails";
public static final String CREATE_REVERSE_CASHBACK_REQUEST = "v2_createReverseCashBackRequest";
public static final String GET_REVERSED_CASHBACK_DETAILS = "v2_getReversedCashBackDetails";
}
Loading

0 comments on commit e5de187

Please sign in to comment.