Skip to content

Comments

Fixed issues reported by Opus#31

Open
0xrafasec wants to merge 75 commits intodevelopfrom
fix/enhance-codebase
Open

Fixed issues reported by Opus#31
0xrafasec wants to merge 75 commits intodevelopfrom
fix/enhance-codebase

Conversation

@0xrafasec
Copy link
Collaborator

@0xrafasec 0xrafasec commented Feb 20, 2026

This pull request introduces a range of improvements across CI/CD workflows, integration tests, documentation, and configuration. The most notable changes include stricter CI filtering, enhanced integration test reliability, the introduction of a detailed changelog, and updates to environment and engine requirements.

The PR was created to implement changes on issue #29 and improve the quality.

CI/CD Workflow Improvements:

  • Excluded the @oaknetwork/contracts placeholder package from CI build, test, and lint steps to prevent unnecessary processing and failures. [1] [2] [3]
  • Removed continue-on-error from the lint step, making lint failures block PRs.
  • Pinned npm version to 10.9.2 in the release workflow for deterministic builds.
  • Updated engine requirement for pnpm to >=10.0.0 in package.json.

Integration Test Reliability and Configuration:

  • Added PAYMENT_CUSTOMER_ID to .env-sample and support for reading it in test config, allowing integration tests to use a stable customer for payment method tests. [1] [2] [3]
  • Refactored integration tests for PaymentMethodService to throw explicit errors instead of silently skipping tests when prerequisites are missing, improving test reporting and reliability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • Improved test data for customer creation in integration tests by adding realistic fields (first_name, last_name, document_type, document_number). [1] [2]

Documentation and Changelog:

  • Added a comprehensive CHANGELOG.md documenting all notable changes, breaking changes, new features, fixes, removals, and migration guidance.

Other Notable Changes:

  • Updated test setup to use environment-provided customer IDs when available, reducing test flakiness and setup time. [1] [2]

These changes collectively improve build reliability, test accuracy, developer experience, and documentation clarity.

… payment method management, and webhook configuration
@0xrafasec 0xrafasec changed the title Add typed environment configuration and enhance error handling Fixed issues reported Opus Feb 20, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b976f0b035

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

export type Transaction = Request & {
export interface Transaction {
provider: string;
source: Source;

Choose a reason for hiding this comment

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

P2 Badge Keep payment response typing compatible with API payloads

Payment.Transaction now hard-codes source to the shared Source type, which only allows capture_method: "automatic" and drops provider-specific fields that were previously carried through by Request & .... If the API returns valid responses for flows like PagarMe manual capture (or provider-specific response echoes), consumers will get false TypeScript errors and lose accurate typing on Payment.Response.

Useful? React with 👍 / 👎.

@0xrafasec 0xrafasec changed the title Fixed issues reported Opus Fixed issues reported by Opus Feb 20, 2026
const email = `test_${timestamp}@example.com`;
const response = await customers.create({
email,
first_name: 'John',
Copy link
Contributor

Choose a reason for hiding this comment

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

to create stripe customer we need only email, if we want to create the test for pagarme change the title of the test. I suggest keep the old test for stripe as we prioritizing this for US clients

const response = await customers.create({
email,
country_code,
first_name: 'Jane',
Copy link
Contributor

Choose a reason for hiding this comment

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

to create stripe connected account we need only email and country code. I suggest keep the old test for stripe as we prioritizing this for US clients

if (createResponse.ok) {
testCustomerId = createResponse.value.data.id as string;
// Fallback: find or create a test customer
const listResponse = await customers.list({ limit: 1 });
Copy link
Contributor

Choose a reason for hiding this comment

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

I think storing paymentCustomerId in an environment variable is unnecessary since we can fetch the customer list directly from the provider.

Instead, we could apply appropriate filters to retrieve a more specific customer when needed. This would make the implementation cleaner and reduce dependency on environment-based configuration.

const email = `pm_test_${Date.now()}@example.com`;
const createResponse = await customers.create({
email,
first_name: 'Test',
Copy link
Contributor

Choose a reason for hiding this comment

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

this will create pagarme customer

const documentNumber = `${timestamp}`.padStart(11, '0').substring(0, 11);

// Customer data
const customerData = {
Copy link
Contributor

Choose a reason for hiding this comment

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

this will create pagarme customer

Copy link

@fahmidareem3 fahmidareem3 left a comment

Choose a reason for hiding this comment

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

Thanks for all the great improvements! Just one thing to address per Tahseen's feedback: the customer test changes add document_type/document_number fields, which route to PagarMe instead of Stripe. Since we're currently focused on US clients, could we keep the original Stripe-only fields (email for customer, email + country_code for connected account)? Happy to discuss if there's a reason for the change.

"should add a PIX payment method",
async () => {
if (!testCustomerId) {
console.warn("Skipping: testCustomerId not available");

Choose a reason for hiding this comment

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

Consider using beforeAll with fail() or Jest's test.skip() conditionally instead of throwing in each test. Current approach causes all dependent tests to fail with the same error message.

@0xrafasec
Copy link
Collaborator Author

Let's discuss together

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.

3 participants