Skip to content

Commit

Permalink
fix city is not filled in Apple Pay
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-zhang-awx committed Dec 19, 2024
1 parent 6cc10e1 commit 34032b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public function getOriginFromUrl($url): string
public function execute(): Json
{
$resultJson = $this->resultJsonFactory->create();
if (empty($this->request->getParam('code'))) {
header('Location: ' . base64_decode($this->request->getParam('target_url')));
return $resultJson;
}
$environment = 'demo';
if ($this->request->getParam('env') !== 'demo') {
$environment = 'www';
Expand Down
3 changes: 2 additions & 1 deletion Controller/Webhooks/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public function execute(): ResponseHttp
}
} catch (Exception $e) {
$id = $data->sourceId ?? '';
$this->requestLog->setMessage($data->name . " $id webhook: " . $e->getMessage(), $e->getTraceAsString())->send();
$name = $data->name ?? '';
$this->requestLog->setMessage("$name $id webhook: " . $e->getMessage(), $e->getTraceAsString())->send();
$this->logger->error($e->getMessage());
throw $e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@ define([
},

city(addr, type) {
if (type === 'google') {
return addr.locality || addr.administrativeArea || addr.countryCode;
if (addr.locality) return addr.locality;
if (['sg', 'singapore'].indexOf(addr.countryCode.toLowerCase()) !== -1) {
return 'Singapore';
}
return addr.locality;
if (addr.administrativeArea) return addr.administrativeArea;
if (addr.country) return addr.country;
return addr.countryCode;
},

postcode(addr, type) {
Expand Down

0 comments on commit 34032b1

Please sign in to comment.