@jetthai/cuora 1.0.95 → 1.0.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.0.96](https://github.com/jetthai/cuora-module/compare/v1.0.95...v1.0.96) (2022-03-09)
6
+
5
7
  ### [1.0.95](https://github.com/jetthai/cuora-module/compare/v1.0.94...v1.0.95) (2022-03-03)
6
8
 
7
9
  ### [1.0.94](https://github.com/jetthai/cuora-module/compare/v1.0.93...v1.0.94) (2022-03-01)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,62 @@
1
+ import { assign, createMachine } from 'xstate'
2
+ import api from '../../api/activity'
3
+
4
+ export default function (request) {
5
+ const { appSecret } = request.config
6
+ return createMachine(
7
+ {
8
+ id: 'mini_game_activity',
9
+ context: {
10
+ activityNo: null,
11
+ activityDetail: null,
12
+ callback: () => {},
13
+ },
14
+ initial: 'idle',
15
+ states: {
16
+ idle: {
17
+ on: {
18
+ SET_ACTIVITY_NO: {
19
+ target: 'loading',
20
+ actions: 'setActivityNo',
21
+ },
22
+ },
23
+ },
24
+ loading: {
25
+ invoke: {
26
+ src: 'fetchActivityDetail',
27
+ onDone: {
28
+ target: 'loaded',
29
+ actions: 'setActivityDetail',
30
+ },
31
+ onError: {
32
+ target: 'idle',
33
+ },
34
+ },
35
+ },
36
+ loaded: {},
37
+ },
38
+ },
39
+ {
40
+ actions: {
41
+ setActivityNo: assign((context, event) => {
42
+ return {
43
+ activityNo: event.data,
44
+ }
45
+ }),
46
+ setActivityDetail: assign((context, event) => {
47
+ return {
48
+ activityDetail: event.data,
49
+ }
50
+ }),
51
+ },
52
+ guards: {},
53
+ services: {
54
+ fetchActivityDetail: async (context, event) => {
55
+ const { activityNo } = context
56
+ const { data } = await request.send(api.getActivityDetail({ activityNo, appSecret }))
57
+ return data
58
+ },
59
+ },
60
+ }
61
+ )
62
+ }
@@ -107,7 +107,7 @@ export default function (request) {
107
107
  return await request.send(
108
108
  payment.updatePaymentInfo({
109
109
  bankCode: bank.bankCode,
110
- branch,
110
+ branch: branch === 'IGNORE' ? undefined : branch, // 如果不需要送branch給後端時,前端設定branch為IGNORE即可
111
111
  bankAccount: accountNumber,
112
112
  holderName,
113
113
  })