Skip to content

Commit

Permalink
Converting loyalty into points based on the exchange rate of the shop
Browse files Browse the repository at this point in the history
  • Loading branch information
danial303065 committed Aug 20, 2024
1 parent 02bba10 commit ee32595
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/relay/src/routers/StorePurchaseRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,11 @@ export class StorePurchaseRouter {
shopProvidedAmount: BigNumber.from(0),
};

let loyaltyPoint: BigNumber;
if (purchaseData.currency === "krw") {
loyaltyPoint = loyaltyValue;
} else {
loyaltyPoint = await this.contractManager.sideCurrencyRateContract.convertCurrency(
loyaltyValue,
purchaseData.currency,
"point"
);
}
const loyaltyPoint = await this.contractManager.sideCurrencyRateContract.convertCurrency(
loyaltyValue,
purchaseData.currency,
"point"
);
if (purchaseData.account === AddressZero && phone.toLowerCase() !== PHONE_NULL) {
purchaseData.account = await this.contractManager.sidePhoneLinkerContract.toAddress(phone);
}
Expand Down

0 comments on commit ee32595

Please sign in to comment.