feat(payment): implement secure 1:1 Polar customer binding system
- Add polar_cust_id column to users table for direct customer mapping - Rewrite PolarProvider customer logic to use stored customer IDs - Eliminate email-based customer lookup to prevent cross-user contamination - Implement self-healing mechanism for invalid customer IDs - Maintain external_id binding for Polar's reference system - Add comprehensive logging for customer lookup operations
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
// Add polar_cust_id column after 'id' for 1:1 Polar customer binding
|
||||
$table->string('polar_cust_id')->nullable()->after('id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('polar_cust_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user