Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/pod.git

Removes duplicate map

AuthorDave Jarvis <email>
Date2026-01-26 22:44:40 GMT-0800
Commit0058feace7f73004d84f4a1de8cdd02afc3490f7
Parentf3ef7e6
Publisher.php
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.
*/
Delta4 lines added, 8 lines removed, 4-line decrease