68 lines
1.8 KiB
JavaScript
68 lines
1.8 KiB
JavaScript
import { PAY_CHANNEL_ACCOUNT_NAME, PAY_CHANNEL_OFFLINE_NAME } from '../types/PayConfig';
|
|
const attrUpdateMatrix = {
|
|
pay: {
|
|
meta: {
|
|
actions: ['update', 'succeedPaying', 'close'],
|
|
filter: {
|
|
$or: [
|
|
{
|
|
channel: PAY_CHANNEL_OFFLINE_NAME,
|
|
},
|
|
{
|
|
iState: {
|
|
$in: ['unpaid', 'paying'],
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
accountOper$entity: {
|
|
actions: ['succeedPaying'],
|
|
filter: {
|
|
accountId: {
|
|
$exists: true,
|
|
},
|
|
channel: PAY_CHANNEL_ACCOUNT_NAME,
|
|
}
|
|
},
|
|
paid: {
|
|
actions: ['succeedPaying'],
|
|
},
|
|
refunded: {
|
|
actions: ['refundPartially', 'refundAll'],
|
|
},
|
|
refundable: {
|
|
actions: ['succeedPaying', 'closeRefund'],
|
|
},
|
|
forbidRefundAt: {
|
|
actions: ['succeedPaying'],
|
|
}
|
|
},
|
|
refund: {
|
|
externalId: {
|
|
actions: ['update'],
|
|
filter: {
|
|
iState: 'refunding',
|
|
},
|
|
},
|
|
reason: {
|
|
actions: ['failRefunding', 'makeAbnormal'],
|
|
}
|
|
},
|
|
withdraw: {
|
|
dealLoss: {
|
|
actions: ['succeed', 'fail', 'succeedPartially'],
|
|
},
|
|
dealPrice: {
|
|
actions: ['succeed', 'fail', 'succeedPartially'],
|
|
},
|
|
reason: {
|
|
actions: ['succeed', 'fail', 'succeedPartially'],
|
|
},
|
|
meta: {
|
|
actions: ['succeed', 'fail', 'succeedPartially'],
|
|
},
|
|
}
|
|
};
|
|
export default attrUpdateMatrix;
|