From b90b0c619b910f48fb619fba2df60d8d72cb1d6c Mon Sep 17 00:00:00 2001 From: BlockChyp SDK Builder Date: Wed, 18 Sep 2024 15:34:23 +0000 Subject: [PATCH] Merge pull request #283 from blockchyp/develop Develop --- README.md | 54 +++++++ .../MerchantCredentialGenerationExample.php | 1 + examples/SubmitApplicationExample.php | 24 +++ lib/BlockChyp.php | 15 ++ tests/itests/SubmitApplicationTest.php | 143 ++++++++++++++++++ 5 files changed, 237 insertions(+) create mode 100644 examples/SubmitApplicationExample.php create mode 100644 tests/itests/SubmitApplicationTest.php diff --git a/README.md b/README.md index 185d03d..56f0721 100644 --- a/README.md +++ b/README.md @@ -4775,6 +4775,7 @@ BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY')); // Populate request values $request = [ + 'merchantId' => '', ]; @@ -4786,6 +4787,59 @@ echo 'Response: ' . print_r($response, true) . PHP_EOL; ``` +#### Submit Application + + + +* **API Credential Types:** Partner +* **Required Role:** INVITE MERCHANT + +This is a partner level API that can be used to submit applications to add new merchant accounts. The application requires a significant amount of detailed information about the merchant and their business. Rather than providing an exhaustive list of required fields, we recommend submitting as much information as possible in your initial request. + +If any required fields are missing or if there are any validation errors, the API will return specific error messages indicating which fields need to be addressed. Simply review these validation errors, fill in the missing information or correct any errors, and resubmit the application. + +Key areas of information include: +- Business details (name, type, tax information) +- Contact information +- Address information (physical and mailing) +- Owner details +- Bank account information +- Transaction volume estimates +- Operational settings (timezone, batch close time, etc.) + +**Note:** Some fields may be conditionally required based on the values of other fields. The validation process will guide you through ensuring all necessary information is provided. + + + + +```php + '', ]; diff --git a/examples/SubmitApplicationExample.php b/examples/SubmitApplicationExample.php new file mode 100644 index 0000000..a618db9 --- /dev/null +++ b/examples/SubmitApplicationExample.php @@ -0,0 +1,24 @@ +loadTestConfiguration(); + + BlockChyp::setApiKey($config->apiKey); + BlockChyp::setBearerToken($config->bearerToken); + BlockChyp::setSigningKey($config->signingKey); + BlockChyp::setGatewayHost($config->gatewayHost); + BlockChyp::setTestGatewayHost($config->testGatewayHost); + BlockChyp::setDashboardHost($config->dashboardHost); + + echo 'Running SubmitApplicationTest...' . PHP_EOL; + $profile = $config->profiles->partner; + if (!empty($profile)) { + BlockChyp::setApiKey($profile->apiKey); + BlockChyp::setBearerToken($profile->bearerToken); + BlockChyp::setSigningKey($profile->signingKey); + } + // Set request values + $request = [ + 'test' => true, + 'inviteCode' => 'asdf', + 'dbaName' => 'BlockChyp', + 'corporateName' => 'BlockChyp Inc.', + 'webSite' => 'https://www.blockchyp.com', + 'taxIdNumber' => '123456789', + 'entityType' => 'CORPORATION', + 'stateOfIncorporation' => 'UT', + 'merchantType' => 'RETAIL', + 'businessDescription' => 'Payment processing solutions', + 'yearsInBusiness' => '5', + 'businessPhoneNumber' => '5555551234', + 'physicalAddress' => [ + 'address1' => '355 S 520 W', + 'city' => 'Lindon', + 'stateOrProvince' => 'UT', + 'postalCode' => '84042', + 'countryCode' => 'US', + ], + 'mailingAddress' => [ + 'address1' => '355 S 520 W', + 'city' => 'Lindon', + 'stateOrProvince' => 'UT', + 'postalCode' => '84042', + 'countryCode' => 'US', + ], + 'contactFirstName' => 'John', + 'contactLastName' => 'Doe', + 'contactPhoneNumber' => '5555555678', + 'contactEmail' => 'john.doe@example.com', + 'contactTitle' => 'CEO', + 'contactTaxIdNumber' => '987654321', + 'contactDOB' => '1980-01-01', + 'contactDlNumber' => 'D1234567', + 'contactDlStateOrProvince' => 'NY', + 'contactDlExpiration' => '2025-12-31', + 'contactHomeAddress' => [ + 'address1' => '355 S 520 W', + 'city' => 'Lindon', + 'stateOrProvince' => 'UT', + 'postalCode' => '84042', + 'countryCode' => 'US', + ], + 'contactRole' => 'OWNER', + 'owners' => [ + [ + 'firstName' => 'John', + 'lastName' => 'Doe', + 'jobTitle' => 'CEO', + 'taxIdNumber' => '876543210', + 'phoneNumber' => '5555559876', + 'dob' => '1981-02-02', + 'ownership' => '50', + 'email' => 'john.doe@example.com', + 'dlNumber' => 'D7654321', + 'dlStateOrProvince' => 'UT', + 'dlExpiration' => '2024-12-31', + 'address' => [ + 'address1' => '355 S 520 W', + 'city' => 'Lindon', + 'stateOrProvince' => 'UT', + 'postalCode' => '84042', + 'countryCode' => 'US', + ], + ], + ], + 'manualAccount' => [ + 'name' => 'Business Checking', + 'bank' => 'Test Bank', + 'accountHolderName' => 'BlockChyp Inc.', + 'routingNumber' => '124001545', + 'accountNumber' => '987654321', + ], + 'averageTransaction' => '100.00', + 'highTransaction' => '1000.00', + 'averageMonth' => '10000.00', + 'highMonth' => '20000.00', + 'refundPolicy' => '30_DAYS', + 'refundDays' => '30', + 'timeZone' => 'America/Denver', + 'batchCloseTime' => '23:59', + 'multipleLocations' => 'false', + 'ebtRequested' => 'false', + 'ecommerce' => 'true', + 'cardPresentPercentage' => '70', + 'phoneOrderPercentage' => '10', + 'ecomPercentage' => '20', + 'signerName' => 'John Doe', + ]; + + // self::logRequest($request); + + try { + + $response = BlockChyp::submitApplication($request); + + // self::logResponse($response); + + // Response assertions + + $this->assertTrue($response['success']); + + } catch (Exception $ex) { + + echo $ex->getTraceAsString(); + $this->assertEmpty($ex); + + } + $this->processResponseDelay($request); + } +}