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

Update the BCH URL structure #126

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions modules/gateways/blockonomics.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,28 @@ function blockonomics_link($params)
$blockonomics = new Blockonomics();
$order_hash = $blockonomics->getOrderHash($params['invoiceid'], $params['amount'], $params['currency'], $params['basecurrencyamount']);

$system_url = \App::getSystemURL();
$form_url = $system_url . 'modules/gateways/blockonomics/payment.php';
$order_params = [];
$active_cryptos = $blockonomics->getActiveCurrencies();
// Check how many crypto currencies are activated
if (count($active_cryptos) > 1) {
$order_params = ['select_crypto' => $order_hash];
} elseif (count($active_cryptos) === 1) {
$order_params = [
'show_order' => $order_hash,
'crypto' => array_keys($active_cryptos)[0]
];
} elseif (count($active_cryptos) === 0) {
$order_params = [
'crypto' => 'empty'
];
}

//pass only the uuid to the payment page
$form_url = \App::getSystemURL() . 'modules/gateways/blockonomics/payment.php';
//pass only the order hash to the payment page
$form = '<form action="' . $form_url . '" method="GET">';
$form .= '<input type="hidden" name="order" value="' . $order_hash . '"/>';
foreach ($order_params as $name => $param) {
$form .= '<input type="hidden" name="' . $name . '" value="' . $param . '"/>';
}
$form .= '<input type="submit" value="' . $params['langpaynow'] . '"/>';
$form .= '</form>';

Expand Down
Loading