Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the request to error response for apple pay validate #201

Merged
merged 4 commits into from
Mar 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions server-middleware/apiApplePay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,24 @@ app.post('/validate', (req, res) => {
? payfacMerchantIdentityKey
: partnershipMerchantIdentityKey, // key apple
})
const requestData = {
merchantIdentifier:
merchantType === 'PayFac' ? payfacMerchantId : partnershipMerchantId,
domainName,
displayName: DISPLAY_NAME,
}
axios
.post(
appleUrl,
{
merchantIdentifier:
merchantType === 'PayFac'
? payfacMerchantId
: partnershipMerchantId,
domainName,
displayName: DISPLAY_NAME,
},
{
httpsAgent,
}
)
.post(appleUrl, requestData, {
httpsAgent,
})
.then((a) => {
// return the json received from Apple Pay server unmodified
res.send(a.data)
})
.catch((a) => {
res.send({
message: a.message,
errorMessage: a.message,
Copy link
Contributor

@antiv0 antiv0 Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i d say send ALL (checksum of cert/key), applePayUrl, every possible detail and compare

if this is not due to domain verification revoked then it is down to SOMETHING being off, so better to verify all

request: requestData,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this change make sensitive data like keys/certificates available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only makes the merchant identifier, domain name, and display name available, all of which were previously hard coded into the file

responseStatus: a.response.status,
responseData: a.response.data,
responseHeaders: a.response.headers,
Expand Down