@@ -39,31 +39,31 @@ discard block |
||
| 39 | 39 | * @throws ClubCollectApiException |
| 40 | 40 | */ |
| 41 | 41 | public function create(string $importId, |
| 42 | - string $externalInvoiceNumber, |
|
| 42 | + string $externalInvoiceNumber, |
|
| 43 | 43 | ?string $reference, |
| 44 | 44 | ?string $directDebitIban, |
| 45 | 45 | ?string $federationMembershipNumber, |
| 46 | 46 | ?string $clubMembershipNumber, |
| 47 | 47 | ?string $locale, |
| 48 | - array $customerName, |
|
| 49 | - array $customerAddress, |
|
| 50 | - array $customerEmail, |
|
| 51 | - array $customerPhone, |
|
| 52 | - array $invoiceLines, |
|
| 53 | - int $amountTotalCents): Invoice |
|
| 48 | + array $customerName, |
|
| 49 | + array $customerAddress, |
|
| 50 | + array $customerEmail, |
|
| 51 | + array $customerPhone, |
|
| 52 | + array $invoiceLines, |
|
| 53 | + int $amountTotalCents): Invoice |
|
| 54 | 54 | { |
| 55 | 55 | /** @var Invoice $resource */ |
| 56 | 56 | $resource = parent::restPost( |
| 57 | 57 | ['invoices'], |
| 58 | 58 | ['api_key' => $this->client->getApiKey()], |
| 59 | 59 | ['import_id' => $importId, |
| 60 | - 'external_invoice_number' => $externalInvoiceNumber, |
|
| 61 | - 'reference' => $reference, |
|
| 62 | - 'direct_debit_iban' => $directDebitIban, |
|
| 63 | - 'federation_membership_number' => Cast::toOptString($federationMembershipNumber), |
|
| 64 | - 'club_membership_number' => Cast::toOptString($clubMembershipNumber), |
|
| 65 | - 'locale' => $locale, |
|
| 66 | - 'customer' => ['name' => ['prefix' => $customerName['prefix'] ?? null, |
|
| 60 | + 'external_invoice_number' => $externalInvoiceNumber, |
|
| 61 | + 'reference' => $reference, |
|
| 62 | + 'direct_debit_iban' => $directDebitIban, |
|
| 63 | + 'federation_membership_number' => Cast::toOptString($federationMembershipNumber), |
|
| 64 | + 'club_membership_number' => Cast::toOptString($clubMembershipNumber), |
|
| 65 | + 'locale' => $locale, |
|
| 66 | + 'customer' => ['name' => ['prefix' => $customerName['prefix'] ?? null, |
|
| 67 | 67 | 'first_name' => $customerName['first_name'] ?? null, |
| 68 | 68 | 'infix' => $customerName['infix'] ?? null, |
| 69 | 69 | 'last_name' => $customerName['last_name'] ?? null, |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | 'email' => ['email_address' => $customerEmail['email_address'] ?? null], |
| 80 | 80 | 'phone' => ['phone_number' => $customerPhone['phone_number'] ?? null, |
| 81 | 81 | 'country_code' => $customerPhone['country_code'] ?? null]], |
| 82 | - 'invoice_lines' => $this->composeInvoiceLines($invoiceLines), |
|
| 83 | - 'amount_total_cents' => $amountTotalCents]); |
|
| 82 | + 'invoice_lines' => $this->composeInvoiceLines($invoiceLines), |
|
| 83 | + 'amount_total_cents' => $amountTotalCents]); |
|
| 84 | 84 | if (!is_a($resource, Invoice::class)) |
| 85 | 85 | { |
| 86 | 86 | throw new ClubCollectApiException('Expected an Invoice object, got a %s', get_class($resource)); |
@@ -103,14 +103,14 @@ discard block |
||
| 103 | 103 | * @throws ClubCollectApiException |
| 104 | 104 | */ |
| 105 | 105 | public function credit(string $invoiceId, |
| 106 | - string $externalInvoiceNumber, |
|
| 107 | - array $invoiceLines, |
|
| 108 | - int $amountTotalCents): Invoice |
|
| 106 | + string $externalInvoiceNumber, |
|
| 107 | + array $invoiceLines, |
|
| 108 | + int $amountTotalCents): Invoice |
|
| 109 | 109 | { |
| 110 | 110 | /** @var Invoice $resource */ |
| 111 | 111 | $resource = parent::restPost(['invoices', $invoiceId, 'credit'], |
| 112 | - ['api_key' => $this->client->getApiKey()], |
|
| 113 | - ['external_invoice_number' => $externalInvoiceNumber, |
|
| 112 | + ['api_key' => $this->client->getApiKey()], |
|
| 113 | + ['external_invoice_number' => $externalInvoiceNumber, |
|
| 114 | 114 | 'invoice_lines' => $this->composeInvoiceLines($invoiceLines), |
| 115 | 115 | 'amount_total_cents' => $amountTotalCents]); |
| 116 | 116 | |
@@ -138,15 +138,15 @@ discard block |
||
| 138 | 138 | * @throws ClubCollectApiException |
| 139 | 139 | */ |
| 140 | 140 | public function creditAndRetract(string $invoiceId, |
| 141 | - string $externalInvoiceNumber, |
|
| 142 | - string $description, |
|
| 141 | + string $externalInvoiceNumber, |
|
| 142 | + string $description, |
|
| 143 | 143 | ?string $retractionReason, |
| 144 | 144 | ?bool $showRetractionReasonToCustomer): Invoice |
| 145 | 145 | { |
| 146 | 146 | /** @var Invoice $resource */ |
| 147 | 147 | $resource = parent::restPost(['invoices', $invoiceId, 'credit_and_retract'], |
| 148 | - ['api_key' => $this->client->getApiKey()], |
|
| 149 | - ['external_invoice_number' => $externalInvoiceNumber, |
|
| 148 | + ['api_key' => $this->client->getApiKey()], |
|
| 149 | + ['external_invoice_number' => $externalInvoiceNumber, |
|
| 150 | 150 | 'description' => $description, |
| 151 | 151 | 'retraction_reason' => $retractionReason, |
| 152 | 152 | 'show_retraction_reason_to_customer' => $showRetractionReasonToCustomer]); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function delete(string $invoiceId): void |
| 171 | 171 | { |
| 172 | 172 | parent::restDelete(['invoices', $invoiceId], |
| 173 | - ['api_key' => $this->client->getApiKey()]); |
|
| 173 | + ['api_key' => $this->client->getApiKey()]); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -219,28 +219,28 @@ discard block |
||
| 219 | 219 | * @throws ClubCollectApiException |
| 220 | 220 | */ |
| 221 | 221 | public function update(string $invoiceId, |
| 222 | - string $externalInvoiceNumber, |
|
| 222 | + string $externalInvoiceNumber, |
|
| 223 | 223 | ?string $reference, |
| 224 | 224 | ?string $directDebitIban, |
| 225 | 225 | ?string $federationMembershipNumber, |
| 226 | 226 | ?string $clubMembershipNumber, |
| 227 | 227 | ?string $locale, |
| 228 | - array $customerName, |
|
| 229 | - array $customerAddress, |
|
| 230 | - array $customerEmail, |
|
| 231 | - array $customerPhone): Invoice |
|
| 228 | + array $customerName, |
|
| 229 | + array $customerAddress, |
|
| 230 | + array $customerEmail, |
|
| 231 | + array $customerPhone): Invoice |
|
| 232 | 232 | { |
| 233 | 233 | /** @var Invoice $resource */ |
| 234 | 234 | $resource = parent::restPut( |
| 235 | 235 | ['invoices', $invoiceId], |
| 236 | 236 | ['api_key' => $this->client->getApiKey()], |
| 237 | 237 | ['external_invoice_number' => $externalInvoiceNumber, |
| 238 | - 'reference' => $reference, |
|
| 239 | - 'direct_debit_iban' => $directDebitIban, |
|
| 240 | - 'federation_membership_number' => Cast::toOptString($federationMembershipNumber), |
|
| 241 | - 'club_membership_number' => Cast::toOptString($clubMembershipNumber), |
|
| 242 | - 'locale' => $locale, |
|
| 243 | - 'customer' => ['name' => ['prefix' => $customerName['prefix'] ?? null, |
|
| 238 | + 'reference' => $reference, |
|
| 239 | + 'direct_debit_iban' => $directDebitIban, |
|
| 240 | + 'federation_membership_number' => Cast::toOptString($federationMembershipNumber), |
|
| 241 | + 'club_membership_number' => Cast::toOptString($clubMembershipNumber), |
|
| 242 | + 'locale' => $locale, |
|
| 243 | + 'customer' => ['name' => ['prefix' => $customerName['prefix'] ?? null, |
|
| 244 | 244 | 'first_name' => $customerName['first_name'] ?? null, |
| 245 | 245 | 'infix' => $customerName['infix'] ?? null, |
| 246 | 246 | 'last_name' => $customerName['last_name'] ?? null, |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $this->invoiceId = $invoiceId; |
| 34 | 34 | |
| 35 | 35 | parent::restPost(['invoices', $invoiceId, 'tickets', 'actions', 'archive'], |
| 36 | - ['api_key' => $this->client->getApiKey()]); |
|
| 36 | + ['api_key' => $this->client->getApiKey()]); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $this->invoiceId = $invoiceId; |
| 50 | 50 | |
| 51 | 51 | parent::restPost(['invoices', $invoiceId, 'tickets', 'actions', 'assign_to_support'], |
| 52 | - ['api_key' => $this->client->getApiKey()]); |
|
| 52 | + ['api_key' => $this->client->getApiKey()]); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | /** @var Ticket $resource */ |
| 71 | 71 | $resource = parent::restPost(['invoices', $invoiceId, 'tickets'], |
| 72 | - ['api_key' => $this->client->getApiKey()], |
|
| 73 | - ['message' => $message]); |
|
| 72 | + ['api_key' => $this->client->getApiKey()], |
|
| 73 | + ['message' => $message]); |
|
| 74 | 74 | if (!is_a($resource, Ticket::class)) |
| 75 | 75 | { |
| 76 | 76 | throw new ClubCollectApiException('Expected an Ticket object, got a %s', get_class($resource)); |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | $this->invoiceId = $invoiceId; |
| 95 | 95 | |
| 96 | 96 | return parent::restGetList('tickets', |
| 97 | - ['invoices', $invoiceId, 'tickets'], |
|
| 98 | - ['api_key' => $this->client->getApiKey()]); |
|
| 97 | + ['invoices', $invoiceId, 'tickets'], |
|
| 98 | + ['api_key' => $this->client->getApiKey()]); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | { |
| 127 | 127 | $list[] = $this->createResourceObject($import); |
| 128 | 128 | } |
| 129 | - } while ($page<($to ?? $result['page']['total_pages'])); |
|
| 129 | + } while ($page < ($to ?? $result['page']['total_pages'])); |
|
| 130 | 130 | |
| 131 | 131 | return $list; |
| 132 | 132 | } |
@@ -178,10 +178,10 @@ |
||
| 178 | 178 | ?array $body = null): ?array |
| 179 | 179 | { |
| 180 | 180 | $url = sprintf('%s/%s%s%s', |
| 181 | - $this->apiEndpoint, |
|
| 182 | - self::API_VERSION, |
|
| 183 | - $this->composePath($path), |
|
| 184 | - $this->composerQuery($query)); |
|
| 181 | + $this->apiEndpoint, |
|
| 182 | + self::API_VERSION, |
|
| 183 | + $this->composePath($path), |
|
| 184 | + $this->composerQuery($query)); |
|
| 185 | 185 | |
| 186 | 186 | return $this->performHttpCallToFullUrl($httpMethod, $url, $this->composeRequestBody($body)); |
| 187 | 187 | } |