Skip to content

Commit

Permalink
Added get wallet balance documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-math committed Jun 3, 2022
1 parent b48e8ec commit 679d456
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Title | Method | HTTP request | Description
*PaymentApi* | [**getRefundDetails**](docs/PendingPaymentApi.md#getRefundDetails) | **GET** /v2/refunds/{merchantRefundId} | Get refund details (Pending Payment)
*PaymentApi* | [**refundPayment**](docs/PendingPaymentApi.md#refundPayment) | **POST** /v1/requestOrder/refunds | Refund a payment (Pending Payment)
*WalletApi* | [**checkWalletBalance**](docs/WalletApi.md#checkWalletBalance) | **GET** /v2/wallet/check_balance | Check user wallet balance
*WalletApi* | [**getWalletBalance**](docs/WalletApi.md#getWalletBalance) | **GET** /v6/wallet/balance | Get user wallet balance along with preference
*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
Expand Down Expand Up @@ -127,6 +128,9 @@ Title | Method | HTTP request | Description
- [ReverseCashback](docs/ReverseCashback.md)
- [CashbackDetails](docs/CashbackDetails.md)
- [ReverseCashbackDetails](docs/ReverseCashbackDetails.md)
- [GetWalletBalance](docs/GetWalletBalance.md)
- [Preference](docs/Preference.md)
- [GetBalanceData](docs/GetBalanceData.md)



Expand Down
13 changes: 13 additions & 0 deletions docs/GetBalanceData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# GetBalanceData

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**userAuthorizationId** | **String** | user authentication id | Required
**totalBalance** | [**MoneyAmount**](MoneyAmount.md) | | Required
**preference** | [**Preference**](Preference.md) | | Required




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

# GetWalletBalance

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




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

# Preference

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**useCashback** | **Boolean** | use cashback amount for transaction | Required
**cashbackAutoInvestment** | **String** | use cashback for investment | Required



44 changes: 43 additions & 1 deletion docs/WalletApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Method | HTTP request | Description
------------- | ------------- | -------------
[**checkWalletBalance**](WalletApi.md#checkWalletBalance) | **GET** /v2/wallet/check_balance | Check user wallet balance

[**getWalletBalance**](WalletApi.md#getWalletBalance) | **GET** /v6/wallet/balance | Get user wallet balance



Expand Down Expand Up @@ -49,3 +49,45 @@ try {
Please refer to the below document for more information :
https://www.paypay.ne.jp/opa/doc/v1.0/direct_debit#operation/checkWalletBalance
```



<a name="getWalletBalance"></a>
# **getWalletBalance**
> GetWalletBalance getWalletBalance(userAuthorizationId, currency, productType)
Get user wallet balance

Get the user wallet account balance **Timeout: 15s**

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



WalletApi apiInstance = new WalletApi(apiClient);

String userAuthorizationId = "USER_AUTHORIZATION_ID";

String currency = "JPY";

ProductType productType = ProductType.VIRTUAL_BONUS_INVESTMENT OR ProductType.PAY_LATER_REPAYMENT

// productType parameter in request is optional. For some merchants that are restricted to use only certain product types, the product type must be properly set.

try {
GetWalletBalance result = apiInstance.getWalletBalance(userAuthorizationId, currency, null);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WalletApi#getWalletBalance");
e.printStackTrace();
System.out.println(e.getResponseBody());
}
```
```
Please refer to the below document for more information :
https://www.paypay.ne.jp/opa/doc/v1.0/get_balance#tag/Wallet/operation/getBalance
```
2 changes: 1 addition & 1 deletion src/main/java/jp/ne/paypay/api/WalletApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void setApiClient(ApiClient apiClient) {


/**
* Build call for checkWalletBalance
* Build call for checkWalletBalance and getWalletBalance
* @param userAuthorizationId (required)
* @param amount (required)
* @param currency (required)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/jp/ne/paypay/api/WalletApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void getWalletBalanceTest() throws ApiException {

walletBalance.setData(balanceData);

ApiResponse<GetWalletBalance> walletBalanceApiResponse = new ApiResponse<>(00001, null, walletBalance);
ApiResponse<GetWalletBalance> walletBalanceApiResponse = new ApiResponse<>(1, null, walletBalance);
Mockito.when(api.getWalletBalanceWithHttpInfo(userAuthorizationId, currency, productType)).thenReturn(walletBalanceApiResponse);
GetWalletBalance response = api.getWalletBalance(userAuthorizationId, currency, productType);
Assert.assertEquals(response.getResultInfo().getMessage(), "SUCCESS");
Expand Down

0 comments on commit 679d456

Please sign in to comment.