| | private const PATH_COST = "print-job-cost-calculations/"; |
| | |
| | - private const CURRENCY_MAP = [ |
| | - 'AU'=>'AUD','CA'=>'CAD','GB'=>'GBP','AT'=>'EUR','BE'=>'EUR','CY'=>'EUR', |
| | - 'EE'=>'EUR','FI'=>'EUR','FR'=>'EUR','DE'=>'EUR','GR'=>'EUR','IE'=>'EUR', |
| | - 'IT'=>'EUR','LV'=>'EUR','LT'=>'EUR','LU'=>'EUR','MT'=>'EUR','NL'=>'EUR', |
| | - 'PT'=>'EUR','SK'=>'EUR','SI'=>'EUR','ES'=>'EUR' |
| | - ]; |
| | - |
| | /** |
| | * Sets up the publisher with API credentials and order specifications. |
 |
| | * |
| | * @param Address $address Address object to configure. |
| | + * |
| | * @return array The formatted API payload. |
| | */ |
 |
| | ]; |
| | $country = $address->configure( $payload ); |
| | - $payload[ 'currency' ] = self::CURRENCY_MAP[ $country ] ?? 'USD'; |
| | + $payload[ 'currency' ] = Currency::fromCountry( $country )->toString(); |
| | |
| | return $payload; |
 |
| | * @param array $data The payload to send. |
| | * @param string $token The bearer token. |
| | + * |
| | * @return array Response body and HTTP status code. |
| | */ |
 |
| | * @param string $content The raw request body. |
| | * @param string $header The HTTP headers. |
| | + * |
| | * @return array Decoded JSON body and status code. |
| | */ |