Skip to content

DAT-834: Add transaction API version selection to PayPal demo/docs - #2

Merged
alexabreuplanet merged 1 commit into
masterfrom
DAT-834-add-version
Jul 30, 2026
Merged

DAT-834: Add transaction API version selection to PayPal demo/docs#2
alexabreuplanet merged 1 commit into
masterfrom
DAT-834-add-version

Conversation

@alexabreuplanet

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.version option.
  • 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 thread README.md
Comment thread index.html
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))
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@alexabreuplanet
alexabreuplanet requested a review from pstadler July 23, 2026 14:52
@alexabreuplanet
alexabreuplanet merged commit 7dd94be into master Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants