-
Notifications
You must be signed in to change notification settings - Fork 10
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
(add) Log 'New Order Created' in Gateway Log on Address Creation #140
Conversation
@@ -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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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']
…inside processOrderHash
Updated. |
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:
Addresses #120