|
@@ -49,6 +49,11 @@ export class MerchantService extends BaseService {
|
|
|
...param,
|
|
|
userId,
|
|
|
apiSecret: apiSecretParams,
|
|
|
+ apikey: crypto
|
|
|
+ .createHash('md5')
|
|
|
+ .update(apiSecretParams)
|
|
|
+ .digest('hex')
|
|
|
+ .toUpperCase()
|
|
|
});
|
|
|
|
|
|
return param.id;
|
|
@@ -119,6 +124,11 @@ export class MerchantService extends BaseService {
|
|
|
mchId: params.mchId
|
|
|
})
|
|
|
merchant.apiSecret = this.generateSignature(`${JSON.stringify(params)}`)
|
|
|
+ merchant.apikey = crypto
|
|
|
+ .createHash('md5')
|
|
|
+ .update(merchant.apiSecret)
|
|
|
+ .digest('hex')
|
|
|
+ .toUpperCase();
|
|
|
await this.merchantEntity.save(merchant)
|
|
|
return merchant
|
|
|
}
|