Skip to content

Commit

Permalink
Merge branch 'translate-release-0.4.0' into 'release/0.4.0'
Browse files Browse the repository at this point in the history
Translate release 0.4.0

See merge request sdk_group/commerce-cocos-sdk!71
  • Loading branch information
MaryMakarova committed Feb 7, 2023
2 parents e0a692f + ba6f03e commit 62a6f64
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions assets/CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## [0.4.0] - 2023-02-07

### Added
- Settings validation
### 新增内容
- 设置验证

## [0.3.0] - 2022-08-30

Expand Down
14 changes: 7 additions & 7 deletions assets/scripts/XsollaSettingsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import { _decorator, Component, Enum, CCInteger} from 'cc';
import { XsollaSettings, Xsolla, PaymentUiTheme, PaymentUiSize, PaymentUiVersion, PaymentRedirectCondition, PaymentRedirectStatusManual, RedirectPolicySettings, PaymentUISettings } from 'db://xsolla-commerce-sdk/scripts/Xsolla';
const { ccclass, property, disallowMultiple, type } = _decorator;

@ccclass('XsollaSettingsManager')
@disallowMultiple(true)
export class XsollaSettingsManager extends Component {

@property({
displayName: 'Settings validation', //TEXTREVIEW
tooltip: 'Some settings has incorrect values', //TEXTREVIEW
displayName: 'Settings validation',
tooltip: 'Some settings have incorrect values',
group: 'General'
})
get errorField() {
Expand Down Expand Up @@ -326,15 +326,15 @@ export class XsollaSettingsManager extends Component {
getSettingsError() {
var regex = new RegExp('^(?:\\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\\}{0,1})$');
if (!regex.test(this.loginId))
return "Login ID has incorrect value"; //TEXTREVIEW
return "Login ID has incorrect value";

regex = new RegExp("^[1-9]\\d*$");
if (!regex.test(this.projectId))
return "Project Id has incorrect value"; //TEXTREVIEW
return "Project ID has incorrect value";

if (this.clientId <= 0)
return "Client Id has incorrect value"; //TEXTREVIEW
return "Client ID has incorrect value";

return "Everything is fine"; //TEXTREVIEW
return "ID format is valid";
}
}
4 changes: 2 additions & 2 deletions extensions/xsolla-commerce-sdk/assets/CHANGELOG.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## [0.4.0] - 2023-02-07

### Added
- SDK methods for ordering free items (`createOrderWithSpecifiedFreeItem` and `createOrderWithFreeCart` SDK methods)
- Ability to order free items. Use `createOrderWithSpecifiedFreeItem` and `createOrderWithFreeCart` SDK methods to implement it. The `fetchCartPaymentToken` SDK method also supports free items

### Changed
- Refinement of the payment status check (10 minutes for shortpolling and recreate websocket connection if time expired)
- Tracking order status logic. Order status is requested via a web socket. After 5 minutes, the web socket connection is re-created. If the web socket returned an error, the status is requested with a short-polling. Short-polling is expired after 10 minutes

## [0.3.0] - 2022-08-30

Expand Down
10 changes: 6 additions & 4 deletions extensions/xsolla-commerce-sdk/assets/CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

## [0.4.0] - 2023-02-07

### Added
- SDK methods for ordering free items (`createOrderWithSpecifiedFreeItem` and `createOrderWithFreeCart` SDK methods)
### 新增内容
- 支持下单免费商品。使用`createOrderWithSpecifiedFreeItem``createOrderWithFreeCart`
SDK方法进行实现。此外,`fetchCartPaymentToken` SDK方法也支持免费商品

### Changed
- Refinement of the payment status check (10 minutes for shortpolling and recreate websocket connection if time expired)
### 更新内容
- 跟踪订单状态逻辑。订单状态通过Web socket来请求。5分钟后Web socket连接将重新创建。如Web
socket返回错误,则通过短轮询进行请求。短轮询有效期为10分钟

## [0.3.0] - 2022-08-30

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@ export class XsollaCart {
request.send(JSON.stringify(body));
}

//TEXTREVIEW

/**
* @en
* Create order with free cart.
* Creates an order with all items from the free cart. The created order will get a `done` order status.
* @zh
* 使用免费购物车创建订单
* 使用免费购物车中的所有商品创建一个订单。创建的订单将具有`done`的订单状态
*/
static createOrderWithFreeCart(authToken:string, cartId:string, currency?:string, locale?:string, customParameters?:object, onComplete?:(orderId:number) => void, onError?:(error:CommerceError) => void): void {
let body = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ export class XsollaCatalog {
request.send(JSON.stringify(body));
}

//TEXTREVIEW

/**
* @en
* Create order with specified free item.
* Creates an order with a specified free item. The created order will get a `done` order status.
* @zh
* 使用指定的免费项目创建订单
* 使用指定免费商品创建订单。创建的订单将具有`done`的订单状态
*/
static createOrderWithSpecifiedFreeItem(authToken:string, itemSKU:string, quantity:number, currency?:string, locale?:string, customParameters?:object, onComplete?:(orderId:number) => void, onError?:(error:CommerceError) => void): void {

Expand Down

0 comments on commit 62a6f64

Please sign in to comment.