'REGISTRATION_ADDRESS', 'address' => 'Moscow, Lenina st, 10', 'country' => 'RU' ] ], DataCollection::class), digestSignatures: DigestSignatureData::collect([ [ 'base64Encoded' => 'MOCK_SIGNATURE', // In real life, use CmsSigner::sign() 'signatureType' => 'cms' ] ], DataCollection::class) ); // 2. Login and send request // For Nominal Accounts, use H2H Auth (Refresh Token) // See examples/13_h2h_auth_service.php for setting this up. // CREDENTIALS SOURCE: // - client-id: Developer Portal -> App -> Overview // - client-secret: Developer Portal -> App -> Keys (Click Eye Icon) OR SDK Generator $auth = AlfaBank::auth( 'client-id', 'client-secret', 'https://callback', 'path/to/cert.pem', 'path/to/key.pem', Environment::SANDBOX ); $auth->refreshToken('saved-refresh-token'); // Authenticates the connector $response = $baas->send(new CreateBeneficiaryRequest($payload)); if ($response->successful()) { $data = $response->dto(); // BeneficiaryResponseData echo "Beneficiary creation accepted. ID: {$data->id}, Status: {$data->status}\n"; } else { echo "Error: " . $response->body() . "\n"; }