Skip to content

chore: remove Checkout.com integration#3703

Open
TaprootFreak wants to merge 1 commit into
developfrom
chore/remove-checkout-integration
Open

chore: remove Checkout.com integration#3703
TaprootFreak wants to merge 1 commit into
developfrom
chore/remove-checkout-integration

Conversation

@TaprootFreak
Copy link
Copy Markdown
Collaborator

Summary

Closes #3699. Removes the Checkout.com payment integration entirely:

  • Deletes src/integration/checkout/ (SDK wrapper, module, dto, service) and the CheckoutObserver.
  • Deletes the CheckoutTx entity, service, repository, mock and the FiatPayIn module (its only purpose was Checkout sync).
  • Drops the four live consumers of CheckoutService: createPaymentLink in BuyService, refundPayment in BuyCryptoService, getBalances in BankAdapter, and the FiatPayInSyncService itself.
  • Removes the checkoutTx relation from BuyCrypto, Transaction and Recall, plus all entity.checkoutTx branches in AML, support, gs, history mappers and transaction services.
  • Drops the last7dCheckoutVolume parameter chain through amlCheckAndFillUp / getAmlResult / getAmlErrors / amlRuleCheck.
  • Removes the dead AmlRule quote-check branches that fired only on paymentMethodIn === CARD; paymentMethodIn is no longer needed in amlRuleQuoteCheck.
  • Strips the checkout config block, CKO_* env vars, the bicep params (ckoPublicKey/ckoSecretKey/ckoEntityId) and the checkout-sdk-node dependency.
  • Cleans up corresponding test specs and the unused paymentLink field on BuyPaymentInfoDto / CustodyOrderBuyResponseDto.

Preserved on purpose

  • Existing *Checkout* migrations stay untouched (historical record).
  • AmlRule enum values 1/4/6/7/9/10/12/13 stay (DB-referenced); their cases simply have no live branch anymore.
  • TransactionTypeInternal.CHECKOUT_LTD, Blockchain.CHECKOUT, CardBankName.CHECKOUT, TransactionRequest.paymentLink and the dormant checkout_tx table remain to keep historical rows readable. A follow-up cleanup migration can be filed separately.

63 files changed, +81 / -1414.

Test plan

  • yarn lint
  • yarn format:check
  • yarn build
  • yarn test (931 passed)
  • Smoke check in DEV after deploy that BuyService/BuyCrypto/AML/Support flows still work end-to-end.

Closes #3699.

- Delete src/integration/checkout/ (SDK wrapper, module, dto, service)
  and the CheckoutObserver.
- Delete the CheckoutTx entity, service, repository, mock and the
  FiatPayIn module (its only purpose was Checkout sync).
- Drop the four live consumers of CheckoutService: createPaymentLink in
  BuyService, refundPayment in BuyCryptoService, getBalances in
  BankAdapter, and the FiatPayInSyncService itself.
- Remove the checkoutTx relation from BuyCrypto, Transaction and Recall,
  plus all entity.checkoutTx branches in AML, support, gs, history
  mappers and transaction services.
- Drop the last7dCheckoutVolume parameter chain through
  amlCheckAndFillUp / getAmlResult / getAmlErrors / amlRuleCheck.
- Remove dead AmlRule quote-check branches that fired only on
  paymentMethodIn === CARD; paymentMethodIn is no longer needed in
  amlRuleQuoteCheck.
- Strip the checkout config block, CKO_* env vars, the bicep params
  (ckoPublicKey/ckoSecretKey/ckoEntityId) and the checkout-sdk-node
  dependency.
- Clean up corresponding test specs and the unused paymentLink field
  on BuyPaymentInfoDto / CustodyOrderBuyResponseDto.

Preserved on purpose: existing *Checkout* migrations, AmlRule enum
values (DB-referenced), TransactionTypeInternal.CHECKOUT_LTD,
Blockchain.CHECKOUT, CardBankName.CHECKOUT and the dormant checkout_tx
table — historical rows must stay readable. A follow-up cleanup
migration can be filed separately.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 12, 2026 17:59
@TaprootFreak TaprootFreak requested a review from davidleomay as a code owner May 12, 2026 17:59
* !entity.user.wallet.amlRuleList.includes(AmlRule.RULE_14) &&
* !refUser?.userData?.isTrustedReferrer && // <-- This is the new condition
* (entity.bankTx || entity.checkoutTx) &&
* (entity.bankTx || entity.bankTx only) &&
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a search-and-replace artifact

});

describe('when transaction is swap (no bankTx or checkoutTx)', () => {
describe('when transaction is swap (no bankTx or bankTx only)', () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark the unused AML Rules as deprecated in src/subdomains/core/aml/enums/aml-rule.enum.ts?

Comment on lines -77 to -79
@OneToOne(() => CheckoutTx, { nullable: true })
@JoinColumn()
checkoutTx?: CheckoutTx;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the reference for history

Comment on lines -14 to -15
@ManyToOne(() => CheckoutTx)
checkoutTx: CheckoutTx;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the reference for history

Comment on lines -9 to +8
@Index((r: Recall) => [r.bankTx, r.checkoutTx, r.sequence], { unique: true })
@Index((r: Recall) => [r.bankTx, r.sequence], { unique: true })
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep for history

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep for history

Comment on lines -125 to -126
@OneToOne(() => CheckoutTx, (checkoutTx) => checkoutTx.transaction, { nullable: true })
checkoutTx?: CheckoutTx;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the reference for history

@davidleomay
Copy link
Copy Markdown
Member

  1. src/subdomains/core/buy-crypto/process/entities/buy-crypto.entity.ts — Restore get paymentMethodIn() checkout branch
  2. src/subdomains/core/buy-crypto/process/entities/buy-crypto.entity.ts — Restore get mailReturnReason() checkout suffix logic
  3. src/subdomains/core/buy-crypto/process/entities/buy-crypto.entity.ts — Restore Blockchain.CHECKOUT case in getInputAmountFor()
  4. src/subdomains/core/history/mappers/transaction-dto.mapper.ts — Restore entity.checkoutTx condition in getTransactionStateDetails() for RETURNED state
  5. src/subdomains/core/history/mappers/chain-report-history-dto.mapper.ts — Restore (buyCrypto.bankTx || buyCrypto.checkoutTx) filter and CC-{id} txid fallback
  6. src/subdomains/core/history/mappers/coin-tracking-history-dto.mapper.ts — Same as 5
  7. src/subdomains/generic/support/support.service.ts — Restore getChargebackRefundTarget() cardBin****cardLast4 display
  8. src/subdomains/core/history/controllers/transaction.controller.ts — Restore getRefundTarget() cardBin****cardLast4 display
  9. src/subdomains/supporting/payment/entities/transaction.entity.ts — Keep TransactionSourceType.CHECKOUT_TX enum value and case CHECKOUT_TX in get sourceEntity()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Checkout.com integration (no longer in use)

2 participants