Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : add error handler for addProduct and addBillingPlan from subscription helper #623

Merged
merged 11 commits into from
Mar 3, 2024

Conversation

otnansirk
Copy link
Contributor

  • Added error handler for add product from subscription helper.
  • Added error handler for add billing plan from subscription helper.

This makes it easier for developers to track where errors occur.
Currently it only displays the message "Undefined key id".
This occurs because an error occurred while making a request to the PayPal API.

which resulted in product properties and billing_plan not storing data properly.

So. we need to check before store response data to product properties and billing_plan

@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.48%. Comparing base (ec50129) to head (5098de1).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               v3.0     #623      +/-   ##
============================================
+ Coverage     96.46%   96.48%   +0.01%     
- Complexity      268      270       +2     
============================================
  Files            34       34              
  Lines          1133     1139       +6     
============================================
+ Hits           1093     1099       +6     
  Misses           40       40              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ing_plan and it_throws_exception_when_get_error_for_creating_a_product
@@ -255,6 +255,52 @@ public function it_throws_exception_when_invalid_interval_is_provided_for_creati
$this->client = $this->client->addCustomPlan('Demo Plan', 'Demo Plan', 100, 'MONTHLY', 3);
}

/** @test */
public function it_throws_exception_when_get_error_for_creating_a_billing_plan()

Choose a reason for hiding this comment

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

Method name AdapterCreateSubscriptionHelpersTest::it_throws_exception_when_get_error_for_creating_a_billing_plan is not in camel caps format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srmklive should I rename it to camelCase format ? I see other code using snake_case

}

/** @test */
public function it_throws_exception_when_get_error_for_creating_a_product()

Choose a reason for hiding this comment

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

Method name AdapterCreateSubscriptionHelpersTest::it_throws_exception_when_get_error_for_creating_a_product is not in camel caps format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srmklive should I rename it to camelCase format ? I see other code using snake_case

@srmklive srmklive merged commit cf2db31 into srmklive:v3.0 Mar 3, 2024
25 checks passed
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.

None yet

4 participants