Skip to content

Commit

Permalink
2.5.10 correctly search for merchant on revoke
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljonescodes committed Nov 21, 2023
1 parent a7b6dc6 commit 6905ea4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/moa-square/services/merchants.square.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ export class MerchantsSquareService {
payload: SquareOauthAuthorizationRevokedEventPayload,
) {
if (payload.merchant_id) {
await this.deleteOauth({ merchantId: payload.merchant_id });
const merchant = await this.service.findOneOrFail({
where: { squareId: payload.merchant_id },
});
if (merchant.id) {
await this.deleteOauth({ merchantId: merchant.id });
}
}
}

Expand Down

0 comments on commit 6905ea4

Please sign in to comment.