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

(add) Log 'New Order Created' in Gateway Log on Address Creation #140

Conversation

thisisayush
Copy link
Collaborator

@thisisayush thisisayush commented Mar 4, 2022

Adds a Gateway log with Status "New Order Created" whenever an order is created. Adding to Gateway Log allows user to search/filter based on Bitcoin Address for Debugging.

Screenshots:
image

Addresses #120

@@ -521,6 +521,13 @@ public function processOrderHash($order_hash, $blockonomics_currency)
}
// Process a new order for the id and blockonomics currency
$new_order = $this->createNewCryptoOrder($order_info, $blockonomics_currency);
$log_data = array(
'order_id' => $new_order->id_order,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We save this as id_order, however this matches a WHMCS invoice id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

$log_data = array(
'order_id' => $new_order->id_order,
'address' => $new_order->addr,
'amount' => $new_order->value,
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no need to log the amount as this can be found on the invoice itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

'address' => $new_order->addr,
'crypto' => $new_order->blockonomics_currency
);
logTransaction('blockonomics', $log_data, 'New Order Created');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of 'blockonomics' as the module name, we should collect it from the gateway variables as in the callback logs:

$gatewayModuleName = 'blockonomics';
// Fetch gateway configuration parameters.
$gatewayParams = getGatewayVariables($gatewayModuleName);

and use as follows:

$gatewayParams['name']

@thisisayush
Copy link
Collaborator Author

Updated.

@thisisayush thisisayush self-assigned this Mar 23, 2022
@DarrenWestwood DarrenWestwood merged commit c0aab85 into blockonomics:master Apr 15, 2022
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.

2 participants