-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release braintree-web 3.110.0 source
- Loading branch information
1 parent
ee0c13a
commit 7f9146b
Showing
16 changed files
with
514 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# CHANGELOG | ||
|
||
## 3.110.0 | ||
|
||
- SEPA | ||
- Add support for new full page redirect flow | ||
|
||
## 3.109.0 | ||
|
||
- PayPal Checkout | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,57 @@ | ||
"use strict"; | ||
|
||
var constants = require("./constants"); | ||
var addMetadata = require("./add-metadata"); | ||
var metadata = require("./add-metadata"); | ||
|
||
function sendAnalyticsEvent(clientInstanceOrPromise, kind, callback) { | ||
var timestamp = Date.now(); // milliseconds | ||
function sendPaypalEvent(clientInstanceOrPromise, eventName, callback) { | ||
var timestamp = Date.now(); | ||
|
||
return Promise.resolve(clientInstanceOrPromise) | ||
.then(function (client) { | ||
var timestampInPromise = Date.now(); | ||
var configuration = client.getConfiguration(); | ||
var request = client._request; | ||
var url = configuration.gatewayConfiguration.analytics.url; | ||
var url = constants.ANALYTICS_URL; | ||
var qualifiedEvent = constants.ANALYTICS_PREFIX + eventName; | ||
var configuration = client.getConfiguration(); | ||
var isProd = | ||
configuration.gatewayConfiguration.environment === "production"; | ||
var data = { | ||
analytics: [ | ||
{ | ||
kind: constants.ANALYTICS_PREFIX + kind, | ||
isAsync: | ||
Math.floor(timestampInPromise / 1000) !== | ||
Math.floor(timestamp / 1000), | ||
events: [], | ||
tracking: [], | ||
}; | ||
var trackingMeta = metadata.addEventMetadata(client, data); | ||
|
||
trackingMeta.event_name = qualifiedEvent; // eslint-disable-line camelcase | ||
trackingMeta.t = timestamp; // eslint-disable-line camelcase | ||
|
||
data.events = [ | ||
{ | ||
level: "info", | ||
event: qualifiedEvent, | ||
payload: { | ||
env: isProd ? "production" : "sandbox", | ||
timestamp: timestamp, | ||
}, | ||
], | ||
}; | ||
}, | ||
]; | ||
data.tracking = [trackingMeta]; | ||
|
||
request( | ||
return request( | ||
{ | ||
url: url, | ||
method: "post", | ||
data: addMetadata(configuration, data), | ||
data: data, | ||
timeout: constants.ANALYTICS_REQUEST_TIMEOUT_MS, | ||
}, | ||
callback | ||
); | ||
}) | ||
.catch(function (err) { | ||
// for all non-test cases, we don't provide a callback, | ||
// so this error will always be swallowed. In this case, | ||
// that's fine, it should only error when the deferred | ||
// client fails to set up, in which case we don't want | ||
// that error to report over and over again via these | ||
// deferred analytics events | ||
if (callback) { | ||
callback(err); | ||
} | ||
}); | ||
} | ||
|
||
module.exports = { | ||
sendEvent: sendAnalyticsEvent, | ||
sendEvent: sendPaypalEvent, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.