diff --git a/README.md b/README.md index 185d03d..8e485f3 100644 --- a/README.md +++ b/README.md @@ -430,6 +430,67 @@ $request = [ $response = BlockChyp::void($request); +// View the result +echo 'Response: ' . print_r($response, true) . PHP_EOL; + +``` + +#### Card Metadata + + + +* **API Credential Types:** Merchant +* **Required Role:** Payment API Access + +This API allows you to retrieve card metadata. + +Card metadata requests can use a payment terminal to retrieve metadata or +use a previously enrolled payment token. + +**Terminal Transactions** + +For terminal transactions, make sure you pass in the terminal name using the `terminalName` property. + +**Token Transactions** + +If you have a payment token, omit the `terminalName` property and pass in the token with the `token` +property instead. + +**Card Numbers and Mag Stripes** + +You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will +put you in PCI scope and the most common vector for POS breaches is keylogging. +If you use terminals for manual card entry, you'll bypass any keyloggers that +might be maliciously running on the point-of-sale system. + + + + +```php + true, + 'terminalName' => 'Test Terminal', +]; + + +$response = BlockChyp::cardMetadata($request); + + // View the result echo 'Response: ' . print_r($response, true) . PHP_EOL; @@ -4775,6 +4836,7 @@ BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY')); // Populate request values $request = [ + 'merchantId' => '', ]; @@ -4786,6 +4848,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 + true, + 'terminalName' => 'Test Terminal', +]; + + +$response = BlockChyp::cardMetadata($request); + + +// View the result +echo 'Response: ' . print_r($response, true) . PHP_EOL; diff --git a/examples/MerchantCredentialGenerationExample.php b/examples/MerchantCredentialGenerationExample.php index 66f89df..47887b2 100644 --- a/examples/MerchantCredentialGenerationExample.php +++ b/examples/MerchantCredentialGenerationExample.php @@ -14,6 +14,7 @@ // Populate request values $request = [ + 'merchantId' => '', ]; 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); + } +}