TLD & Pricing Sync
In WHASOLS the Registrar TLD & Pricing Sync Utility allows for a registrar module to support importing TLDs and pricing.
Users can use the Sync Utility to import TLDs and automatically apply a defined margin markup.
To integrate this functionality into your registrar module, you must define a
GetTldPricing
function that builds and returns a ResultList object containing ImportItems defining TLDs and their cost pricing.Method | Type | Required/Optional | Notes |
---|---|---|---|
Extension | string | Required | The extension to import. Example: .com, .net, or .co.uk |
MinYears | int | Optional | The minimum number of years that the extension can be registered for. Default: 1 |
MaxYears | int | Optional | The maximum number of years that the extension can be registered for. Default: 10 |
YearsStep | int | Optional | The number of years between each registration period. Default: 1 |
RegisterPrice | float | Required | The registration cost price for the minimum registration period term. |
RenewPrice | float | Optional | The renewal cost price for the minimum registration period term. Pass null if renewals are not supported. |
TransferPrice | float | Optional | The transfer cost price for the minimum registration period term. Pass null if transfers are not supported. |
GraceFeeDays | int | Optional | The grace period for the extension. |
GraceFeePrice | float | Optional | The grace fee cost price for the extension. Pass null if grace periods are not supported. |
RedemptionFeeDays | int | Optional | The redemption period for the extension. |
RedemptionFeePrice | float | Optional | The redemption fee cost price for the extension. Pass null if redemption periods are not supported. |
Currency | string | Required | The ISO4217 three letter currency code that registrar cost prices are defined in. This currency must exist within the WHASOLS installation. eg. USD, GBP, etc |
EppRequired | boolean | Optional | Does the extension require an EPP code for transfer requests |
Years | array | Optional | Use in place of MinYears , MaxYears , and YearsStep for extensions with more specialised pricing. Default:array() |
Example Usage
<?php
function yourmodule_GetTldPricing($params)
{
try {
$api = yourmodule_getApiClient($params);
$extensionData = $api->GetTldPrices();
$results = [];
foreach ($extensionData as $extension)
{
// All the set methods can be chained and utilised together.
$results[] = [
"Extension"=>$extension['tld'],
"YearsStep"=>$extension['YearsStep'],
"MinYears"=>$extension['minPeriod'],
"MaxYears"=>$extension['maxPeriod'],
"RegisterPrice"=>$extension['registrationPrice'],
"RenewPrice"=>$extension['renewalPrice'],
"TransferPrice"=>$extension['transferPrice'],
"RedemptionFeeDays"=>$extension['redemptionDays'],
"RedemptionFeePrice"=>$extension['redemptionFee'],
"GraceFeeDays"=>$extension['GraceFeeDays'],
"GraceFeePrice"=>$extension['GraceFeePrice'],
"Currency"=>$extension['currencyCode'],
"EppRequired"=>$extension['transferSecretRequired'],
"Years"=>["YearsStep"=>$extension['YearsStep'],"MinYears"=>$extension['minPeriod'],"MaxYears"=>$extension['maxPeriod']],
];
}
return ['status'=>'success','message'=>'Your Message Here','response'=>$results];
} catch (\Exception $e) {
return ['status'=>'error','message'=> 'Your Custom Error Message Here:' . $e->getMessage()];
}
}