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

Handle exception when getting capabilities with invalid Omise Keys #216

Merged
merged 2 commits into from
Sep 4, 2019

Conversation

jacstn
Copy link
Contributor

@jacstn jacstn commented Sep 2, 2019

1. Objective

This fixes unhandled exception when omise keys are wrong or not set in the admin panel.

Related information:
Related issue(s): #189

2. Description of change

Added try/catch when getting capabilities.
Return particular capabilities only if the capabilities API object is not null.

3. Quality assurance

🔧 Environments:

  • Platform version: Magento CE 2.1.5.
  • Omise plugin version: Omise-Magento 2.1.
  • PHP version: 7.0.16.

✏️ Details:

Remove omise keys, make sure application does not crash when going to the checkout page.

4. Impact of the change

N/A

5. Priority of change

Normal

6. Additional Notes

N/A

@@ -8,9 +8,13 @@ class Capabilities extends BaseObject
{
private $capabilities;

public function __construct()
public function __construct(\PSR\Log\LoggerInterface $log)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is $log used?

@jacstn jacstn merged commit 5e8d4cb into master Sep 4, 2019
@jacstn jacstn deleted the 2-crash-when-invalid-omise-keys branch September 4, 2019 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants