diff --git a/README.md b/README.md index bc75e30..7f74a62 100644 --- a/README.md +++ b/README.md @@ -4392,6 +4392,304 @@ echo 'Response: ' . print_r($response, true) . PHP_EOL; ``` +### Partner Utilities + + +These partner only APIs give ISV partners advanced reporting and tools for managing their portfolio. + +Most of the APIs below are for portfolio reporting and range from basic partner commission statements +to individual statements with all underlying card brand data. + +We also provide a pricing policy API that enables partners to pull down the current pricing rules +in force for any merchant in their portfolio. + + + + + +#### Retrieve Pricing Policy + + + +* **API Credential Types:** Partner +* **Required Role:** Partner API Access + +The API returns the current pricing policy for a merchant. This API is valid for partner scoped API credentials +and `merchantId` is a required parameter. By default this API returns the currently in-force pricing policy for a merchant, +but other inactive policies can be returned by providing the `id` parameter. + +Buy rates for interchange plus and fixed rate pricing are always returned, but only the pricing related to the +pricing model type (flat rate or interchange plus) are actually used in fee calculation. + +Each pricing level returns three values: `buyRate`, `current`, and `limit`. The actual price the merchant will pay is +given in the `current` field. The other values reflect the contract minimum (`buyRate`) and maximum (`limit`) range +the partner can use when changing prices. + + + + +```php +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 MerchantInvoiceDetailTest...' . PHP_EOL; // Set request values + $request = [ + 'test' => true, + ]; + + // self::logRequest($request); + + try { + + $response = BlockChyp::merchantInvoiceDetail($request); + + // self::logResponse($response); + + // Response assertions + + $this->assertTrue($response['success']); + + } catch (Exception $ex) { + + echo $ex->getTraceAsString(); + $this->assertEmpty($ex); + + } + $this->processResponseDelay($request); + } +} diff --git a/tests/itests/MerchantInvoicesTest.php b/tests/itests/MerchantInvoicesTest.php new file mode 100644 index 0000000..83afa0d --- /dev/null +++ b/tests/itests/MerchantInvoicesTest.php @@ -0,0 +1,49 @@ +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 MerchantInvoicesTest...' . PHP_EOL; // Set request values + $request = [ + 'test' => true, + ]; + + // self::logRequest($request); + + try { + + $response = BlockChyp::merchantInvoices($request); + + // self::logResponse($response); + + // Response assertions + + $this->assertTrue($response['success']); + + } catch (Exception $ex) { + + echo $ex->getTraceAsString(); + $this->assertEmpty($ex); + + } + $this->processResponseDelay($request); + } +} diff --git a/tests/itests/PartnerCommissionBreakdownTest.php b/tests/itests/PartnerCommissionBreakdownTest.php new file mode 100644 index 0000000..22821c9 --- /dev/null +++ b/tests/itests/PartnerCommissionBreakdownTest.php @@ -0,0 +1,49 @@ +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 PartnerCommissionBreakdownTest...' . PHP_EOL; // Set request values + $request = [ + 'test' => true, + ]; + + // self::logRequest($request); + + try { + + $response = BlockChyp::partnerCommissionBreakdown($request); + + // self::logResponse($response); + + // Response assertions + + $this->assertTrue($response['success']); + + } catch (Exception $ex) { + + echo $ex->getTraceAsString(); + $this->assertEmpty($ex); + + } + $this->processResponseDelay($request); + } +} diff --git a/tests/itests/PartnerStatementDetailTest.php b/tests/itests/PartnerStatementDetailTest.php new file mode 100644 index 0000000..2116f8d --- /dev/null +++ b/tests/itests/PartnerStatementDetailTest.php @@ -0,0 +1,49 @@ +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 PartnerStatementDetailTest...' . PHP_EOL; // Set request values + $request = [ + 'test' => true, + ]; + + // self::logRequest($request); + + try { + + $response = BlockChyp::partnerStatementDetail($request); + + // self::logResponse($response); + + // Response assertions + + $this->assertTrue($response['success']); + + } catch (Exception $ex) { + + echo $ex->getTraceAsString(); + $this->assertEmpty($ex); + + } + $this->processResponseDelay($request); + } +} diff --git a/tests/itests/PartnerStatementsTest.php b/tests/itests/PartnerStatementsTest.php new file mode 100644 index 0000000..6d5bd8b --- /dev/null +++ b/tests/itests/PartnerStatementsTest.php @@ -0,0 +1,49 @@ +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 PartnerStatementsTest...' . PHP_EOL; // Set request values + $request = [ + 'test' => true, + ]; + + // self::logRequest($request); + + try { + + $response = BlockChyp::partnerStatements($request); + + // self::logResponse($response); + + // Response assertions + + $this->assertTrue($response['success']); + + } catch (Exception $ex) { + + echo $ex->getTraceAsString(); + $this->assertEmpty($ex); + + } + $this->processResponseDelay($request); + } +} diff --git a/tests/itests/PricingPolicyTest.php b/tests/itests/PricingPolicyTest.php new file mode 100644 index 0000000..bb756b8 --- /dev/null +++ b/tests/itests/PricingPolicyTest.php @@ -0,0 +1,50 @@ +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 PricingPolicyTest...' . PHP_EOL; // Set request values + $request = [ + 'test' => true, + 'merchantId' => '', + ]; + + // self::logRequest($request); + + try { + + $response = BlockChyp::pricingPolicy($request); + + // self::logResponse($response); + + // Response assertions + + $this->assertTrue($response['success']); + + } catch (Exception $ex) { + + echo $ex->getTraceAsString(); + $this->assertEmpty($ex); + + } + $this->processResponseDelay($request); + } +}