Merge pull request #10767 from cnohall/remove-blockonomics-secret
Remove callbackSecret from Blockonomics payments gateway
This commit is contained in:
commit
3c77e363ed
|
|
@ -92,12 +92,13 @@ class BlockonomicsPaymentDriver extends BaseDriver
|
||||||
|
|
||||||
$company = $request->getCompany();
|
$company = $request->getCompany();
|
||||||
|
|
||||||
$url_callback_secret = $request->secret;
|
// Re-introduce secret in a later stage if needed.
|
||||||
$db_callback_secret = $this->company_gateway->getConfigField('callbackSecret');
|
// $url_callback_secret = $request->secret;
|
||||||
|
// $db_callback_secret = $this->company_gateway->getConfigField('callbackSecret');
|
||||||
|
|
||||||
if ($url_callback_secret != $db_callback_secret) {
|
// if ($url_callback_secret != $db_callback_secret) {
|
||||||
throw new PaymentFailed('Secret does not match');
|
// throw new PaymentFailed('Secret does not match');
|
||||||
}
|
// }
|
||||||
|
|
||||||
$txid = $request->txid;
|
$txid = $request->txid;
|
||||||
$value = $request->value;
|
$value = $request->value;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use App\Models\Gateway;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
$gateway = Gateway::find(65);
|
||||||
|
if ($gateway) {
|
||||||
|
// Update the site_url and remove callbackSecret
|
||||||
|
$fields = json_decode($gateway->fields);
|
||||||
|
unset($fields->callbackSecret);
|
||||||
|
|
||||||
|
$gateway->fields = json_encode($fields);
|
||||||
|
$gateway->site_url = 'https://help.blockonomics.co/support/solutions/articles/33000291849';
|
||||||
|
$gateway->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -25,9 +25,6 @@ class PaymentLibrariesSeeder extends Seeder
|
||||||
{
|
{
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
|
|
||||||
// Generate a random callback secret for Blockonomics users
|
|
||||||
$callbackSecret = Str::random(32);
|
|
||||||
|
|
||||||
$gateways = [
|
$gateways = [
|
||||||
['id' => 1, 'name' => 'Authorize.Net', 'provider' => 'Authorize', 'sort_order' => 5, 'key' => '3b6621f970ab18887c4f6dca78d3f8bb', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"}
|
['id' => 1, 'name' => 'Authorize.Net', 'provider' => 'Authorize', 'sort_order' => 5, 'key' => '3b6621f970ab18887c4f6dca78d3f8bb', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"}
|
||||||
'],
|
'],
|
||||||
|
|
@ -94,7 +91,7 @@ class PaymentLibrariesSeeder extends Seeder
|
||||||
['id' => 62, 'name' => 'BTCPay', 'provider' => 'BTCPay', 'key' => 'vpyfbmdrkqcicpkjqdusgjfluebftuva', 'fields' => '{"btcpayUrl":"", "apiKey":"", "storeId":"", "webhookSecret":""}'],
|
['id' => 62, 'name' => 'BTCPay', 'provider' => 'BTCPay', 'key' => 'vpyfbmdrkqcicpkjqdusgjfluebftuva', 'fields' => '{"btcpayUrl":"", "apiKey":"", "storeId":"", "webhookSecret":""}'],
|
||||||
['id' => 63, 'name' => 'Rotessa', 'is_offsite' => false, 'sort_order' => 22, 'provider' => 'Rotessa', 'key' => '91be24c7b792230bced33e930ac61676', 'fields' => '{"apiKey":"", "testMode":false}'],
|
['id' => 63, 'name' => 'Rotessa', 'is_offsite' => false, 'sort_order' => 22, 'provider' => 'Rotessa', 'key' => '91be24c7b792230bced33e930ac61676', 'fields' => '{"apiKey":"", "testMode":false}'],
|
||||||
['id' => 64, 'name' => 'CBA PowerBoard', 'is_offsite' => false, 'sort_order' => 26, 'provider' => 'CBAPowerBoard', 'key' => 'b67581d804dbad1743b61c57285142ad', 'fields' => '{"publicKey":"", "secretKey":"", "testMode":false, "gatewayId":"", "amex":false, "ausbc":false, "discover":false, "japcb":false, "laser":false, "mastercard":true, "solo":false, "visa":true, "visa_white":false}'],
|
['id' => 64, 'name' => 'CBA PowerBoard', 'is_offsite' => false, 'sort_order' => 26, 'provider' => 'CBAPowerBoard', 'key' => 'b67581d804dbad1743b61c57285142ad', 'fields' => '{"publicKey":"", "secretKey":"", "testMode":false, "gatewayId":"", "amex":false, "ausbc":false, "discover":false, "japcb":false, "laser":false, "mastercard":true, "solo":false, "visa":true, "visa_white":false}'],
|
||||||
['id' => 65, 'name' => 'Blockonomics', 'is_offsite' => false, 'sort_order' => 27, 'provider' => 'Blockonomics', 'key' => 'wbhf02us6owgo7p4nfjd0ymssdshks4d', 'fields' => '{"apiKey":"", "callbackSecret":"' . $callbackSecret . '"}'],
|
['id' => 65, 'name' => 'Blockonomics', 'is_offsite' => false, 'sort_order' => 27, 'provider' => 'Blockonomics', 'key' => 'wbhf02us6owgo7p4nfjd0ymssdshks4d', 'fields' => '{"apiKey":""}'],
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($gateways as $gateway) {
|
foreach ($gateways as $gateway) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue