1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-16 14:32:26 +02:00

Fixes for migrating online payment gateways

This commit is contained in:
= 2020-12-25 14:15:43 +11:00
parent 00718d15df
commit de40281e22
16 changed files with 145 additions and 1 deletions

View File

@ -1038,7 +1038,7 @@ trait GenerateMigrationResources
foreach ($gateway_types as $gateway_type_id) {
$transformed[] = [
'id' => $account_gateway->id,
'id' => $this->translateGatewaysId($account_gateway->id),
'user_id' => $account_gateway->user_id,
'gateway_key' => $this->getGatewayKeyById($account_gateway->gateway_id),
'accepted_credit_cards' => $account_gateway->accepted_credit_cards,
@ -1059,6 +1059,150 @@ trait GenerateMigrationResources
return $transformed;
}
/*converts the gateway ID to the new v5 list*/
private function translateGatewaysId($gateway_id)
{
switch ($gateway_id) {
case 1:
case 2:
return 1;
case 3:
return 2;
case 4:
return 3;
case 5:
return 4;
case 6:
return 52;
case 7:
return 5;
case 8:
return 6;
case 9:
return 7;
case 10:
return 8;
case 11:
return 9;
case 12:
return 10;
case 13:
return 11;
case 14:
return 12;
case 15:
return 13;
case 16:
return 14;
case 17:
return 15;
case 18:
return 16;
case 19:
return 17;
case 20:
return 18;
case 21:
return 0; //
case 22:
return 19;
case 23:
return 20;
case 24:
return 21;
case 25:
return 22;
case 26:
return 23;
case 27:
return 24;
case 28:
return 25;
case 29:
case 30:
return 0; //
case 31:
return 26;
case 32:
return 27;
case 33:
return 28;
case 34:
return 29;
case 35:
return 30;
case 36:
return 0; //
case 37:
return 31;
case 38:
return 0;
case 39:
return 32;
case 40:
return 33;
case 41:
return 34;
case 42:
return 35;
case 43:
return 0;
case 44:
return 36;
case 45:
return 37;
case 46:
return 38;
case 47:
return 39;
case 48:
return 40;
case 49:
return 41;
case 50:
return 42;
case 51:
return 43;
case 52:
return 44;
case 53:
case 54:
return 0;
case 55:
return 45;
case 56:
return 46;
case 57:
return 47;
case 58:
return 48;
case 59:
return 0;
case 60:
return 49;
case 61:
return 50;
case 62:
return 55;
case 63:
return 51;
case 64:
return 52;
case 65:
return 53;
case 66:
return 54;
case 67:
case 68:
return 55;
default:
return 0;
break;
}
}
private function getClientGatewayTokens()
{
$payment_methods = PaymentMethod::where('account_id', $this->account->id)->withTrashed()->get();

0
storage/framework/.DS_Store vendored Normal file → Executable file
View File

0
storage/import/.gitignore vendored Normal file → Executable file
View File

0
storage/migrations/.gitignore vendored Normal file → Executable file
View File

0
storage/templates/bold.js Normal file → Executable file
View File

0
storage/templates/business.js Normal file → Executable file
View File

0
storage/templates/clean.css vendored Normal file → Executable file
View File

0
storage/templates/clean.html Normal file → Executable file
View File

0
storage/templates/clean.js Normal file → Executable file
View File

0
storage/templates/creative.js Normal file → Executable file
View File

0
storage/templates/elegant.js Normal file → Executable file
View File

0
storage/templates/hipster.js Normal file → Executable file
View File

0
storage/templates/modern.js Normal file → Executable file
View File

0
storage/templates/photo.js Normal file → Executable file
View File

0
storage/templates/plain.js Normal file → Executable file
View File

0
storage/templates/playful.js Normal file → Executable file
View File