Fixes for Stripe Connect

This commit is contained in:
David Bomba 2021-04-22 21:22:55 +10:00
parent 5d4bba2609
commit 067c3cad62
5 changed files with 62 additions and 3 deletions

View File

@ -246,7 +246,7 @@ class PaymentController extends Controller
}
$payment_hash = new PaymentHash;
$payment_hash->hash = Str::random(128);
$payment_hash->hash = Str::random(32);
$payment_hash->data = $hash_data;
$payment_hash->fee_total = $fee_totals;
$payment_hash->fee_invoice_id = $first_invoice->id;

View File

@ -14,6 +14,7 @@ namespace App\Http\Controllers;
use App\Factory\CompanyGatewayFactory;
use App\Http\Requests\StripeConnect\InitializeStripeConnectRequest;
use App\Libraries\MultiDB;
use App\Models\CompanyGateway;
use App\PaymentDrivers\Stripe\Connect\Account;
use Stripe\Exception\ApiErrorException;
@ -30,6 +31,8 @@ class StripeConnectController extends BaseController
{
// Should we check if company has set country in the ap? Otherwise this will fail.
MultiDB::findAndSetDbByCompanyKey($request->getTokenContent()['company_key']);
$data = [
'type' => 'standard',
'email' => $request->getContact()->email,

View File

@ -0,0 +1,56 @@
<?php
use App\Models\CompanyGateway;
use App\Models\Gateway;
use App\Utils\Traits\AppSetup;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddPropertyToCheckoutGatewayConfig extends Migration
{
use AppSetup;
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$gateway = Gateway::where('key', '3758e7f7c6f4cecf0f4f348b9a00f456')->first();
if($gateway)
{
$fields = json_decode($gateway->fields);
$fields->threeds = false;
$gateway->fields = json_encode($fields);
$gateway->save();
}
CompanyGateway::where('gateway_key', '3758e7f7c6f4cecf0f4f348b9a00f456')->each(function ($checkout){
$config = json_decode(decrypt($checkout->config));
$config->threeds = false;
$config = encrypt(json_encode($config));
$checkout->config = $config;
$checkout->save();
});
$this->buildCache(true);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}

View File

@ -62,7 +62,7 @@ class PaymentLibrariesSeeder extends Seeder
['id' => 36, 'name' => 'AGMS', 'provider' => 'Agms', 'key' => '1b3c6f3ccfea4f5e7eadeae188cccd7f', 'fields' => '{"username":"","password":"","apiKey":"","accountNumber":""}'],
['id' => 37, 'name' => 'Barclays', 'provider' => 'BarclaysEpdq\Essential', 'key' => '7cba6ce5c125f9cb47ea8443ae671b68', 'fields' => '{"clientId":"","testMode":false,"language":"en_US","callbackMethod":"POST"}'],
['id' => 38, 'name' => 'Cardgate', 'provider' => 'Cardgate', 'key' => 'b98cfa5f750e16cee3524b7b7e78fbf6', 'fields' => '{"merchantId":"","language":"nl","apiKey":"","siteId":"","notifyUrl":"","returnUrl":"","cancelUrl":"","testMode":false}'],
['id' => 39, 'name' => 'Checkout.com', 'provider' => 'CheckoutCom', 'key' => '3758e7f7c6f4cecf0f4f348b9a00f456', 'fields' => '{"secretApiKey":"","publicApiKey":"","testMode":false}'],
['id' => 39, 'name' => 'Checkout.com', 'provider' => 'CheckoutCom', 'key' => '3758e7f7c6f4cecf0f4f348b9a00f456', 'fields' => '{"secretApiKey":"","publicApiKey":"","testMode":false,"threeds:false"}'],
['id' => 40, 'name' => 'Creditcall', 'provider' => 'Creditcall', 'key' => 'cbc7ef7c99d31ec05492fbcb37208263', 'fields' => '{"terminalId":"","transactionKey":"","testMode":false,"verifyCvv":true,"verifyAddress":false,"verifyZip":false}'],
['id' => 41, 'name' => 'Cybersource', 'provider' => 'Cybersource', 'key' => 'e186a98d3b079028a73390bdc11bdb82', 'fields' => '{"profileId":"","secretKey":"","accessKey":"","testMode":false}'],
['id' => 42, 'name' => 'ecoPayz', 'provider' => 'Ecopayz', 'key' => '761040aca40f685d1ab55e2084b30670', 'fields' => '{"merchantId":"","merchantPassword":"","merchantAccountNumber":"","testMode":false}'],

View File

@ -195,7 +195,7 @@ Route::get('token_hash_router', 'OneTimeTokenController@router');
Route::get('webcron', 'WebCronController@index');
Route::group(['middleware' => ['api_db', 'locale']], function () {
Route::group(['middleware' => ['locale']], function () {
Route::get('stripe_connect/completed', 'StripeConnectController@completed')->name('stripe_connect.return');
Route::get('stripe_connect/{token}', 'StripeConnectController@initialize')->name('stripe_connect.initialization');
});