DAT-834: Add transaction API version selection to PayPal demo/docs - #2
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the PayPal button demo and documentation to allow selecting the Datatrans Transaction API version (v1 or v2) and reflects that option in the “How it works”/options documentation.
Changes:
- Add a “Transaction API version” selector to the demo UI and pass the selected version in the transaction object.
- Update the demo/documentation code snippets and parameter tables to include the new
transaction.versionoption. - Minor HTML/CSS formatting/cleanup in the demo assets.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Updates usage example formatting/logging, but currently contains an event-subscription typo. |
| index.html | Adds Transaction API version selection and wires it into the demo’s transaction config; refactors demo script formatting/flow. |
| css/paypal.css | Formatting-only change to the #paybutton media query rule. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+387
to
+396
| PayPalButton.on('error', function(error) { | ||
| $('#paybutton').empty(); | ||
|
|
||
| createAlias = false; | ||
| amount = '100'; | ||
| document.getElementById('amount').value = '100' | ||
| document.getElementById('createAlias').checked = false; | ||
|
|
||
| appendToConsole('Error:' + JSON.stringify(error)) | ||
| }); |
Contributor
Author
There was a problem hiding this comment.
I removed that part, because if the error is triggered by misconfiguration (like domain not allowed) then it will enter an infinite loop of init > error > init > error > ... and eventually the browser will break and we can produce a DoS to our Sandbox environment.
pstadler
approved these changes
Jul 24, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.