feat(M08-A): 接入权益和余额下单抵扣
This commit is contained in:
@@ -76,6 +76,15 @@ assert.equal(created.statusCode, 201);
|
||||
assert.equal(createInput.platformAppId, '9');
|
||||
assert.equal('amountCents' in createInput, false);
|
||||
|
||||
const balanceCreated = await app.inject({
|
||||
method: 'POST',
|
||||
url: '/app-api/payments',
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
payload: { orderId: '31', provider: 'BALANCE', clientRequestId: 'request-balance-0001' }
|
||||
});
|
||||
assert.equal(balanceCreated.statusCode, 201);
|
||||
assert.equal(createInput.provider, 'BALANCE');
|
||||
|
||||
const completed = await app.inject({
|
||||
method: 'POST',
|
||||
url: '/app-api/payments/51/test-complete',
|
||||
|
||||
@@ -65,6 +65,13 @@ const reserved = await app.inject({
|
||||
startAt: startAt.toISOString(),
|
||||
endAt: endAt.toISOString(),
|
||||
pricingMode: 'HOURLY',
|
||||
benefits: {
|
||||
couponGrantId: '401',
|
||||
packageHoldingId: '501',
|
||||
packageMinutes: 60,
|
||||
packageCreditCents: 2000,
|
||||
clientRequestId: 'benefit-route-0001'
|
||||
},
|
||||
totalCents: 1,
|
||||
discountCents: 999999
|
||||
}
|
||||
@@ -74,6 +81,13 @@ assert.equal(reserveInput.tenantId, '7');
|
||||
assert.equal(reserveInput.userId, '21');
|
||||
assert.equal('totalCents' in reserveInput, false);
|
||||
assert.equal('discountCents' in reserveInput, false);
|
||||
assert.deepEqual(reserveInput.benefits, {
|
||||
couponGrantId: '401',
|
||||
packageHoldingId: '501',
|
||||
packageMinutes: 60,
|
||||
packageCreditCents: 2000,
|
||||
clientRequestId: 'benefit-route-0001'
|
||||
});
|
||||
|
||||
const unauthenticated = await app.inject({
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user