Skip to content

Commit

Permalink
fix [PAYMENTS-20334]: widget usage in sandbox mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ekireevxs committed Aug 9, 2024
1 parent cfd8ef4 commit 79f1d9c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.3.4
- [fix] usage widget in sandbox mode

## 1.3.3
- [chore] update `gulp-uglify` to version 3.0.2

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Features:

#### Linking to Xsolla CDN

Script is located on our CDN and is available here: [https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.2/widget.min.js](https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.2/widget.min.js). Use this URL to integrate script on your website.
Script is located on our CDN and is available here: [https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.4/widget.min.js](https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.4/widget.min.js). Use this URL to integrate script on your website.

### Script Loading

Expand All @@ -30,7 +30,7 @@ Script is located on our CDN and is available here: [https://cdn.xsolla.net/pay
const s = document.createElement('script');
s.type = "text/javascript";
s.async = true;
s.src = "https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.2/widget.min.js";
s.src = "https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.4/widget.min.js";

s.addEventListener('load', function (e) {
XPayStationWidget.init(options);
Expand All @@ -44,7 +44,7 @@ Script is located on our CDN and is available here: [https://cdn.xsolla.net/pay
#### Synchronous loading (blocks content)

``` javascript
<script src="https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.2/widget.min.js"></script>
<script src="https://cdn.xsolla.net/payments-bucket-prod/embed/1.3.4/widget.min.js"></script>
<script>
XPayStationWidget.init({
access_token: 'abcdef1234567890abcdef1234567890'
Expand Down
8 changes: 5 additions & 3 deletions dist/widget.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/widget.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/widget.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xsolla-paystation-widget",
"version": "1.3.3",
"version": "1.3.4",
"description": "PayStation Integration Widget",
"scripts": {
"build": "gulp build",
Expand Down
6 changes: 4 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ module.exports = (function () {
query.access_data = JSON.stringify(this.config.access_data);
}

const paymentUrl = this.config.sandbox ?
const urlWithoutQueryParams = this.config.sandbox ?
SANDBOX_PAYSTATION_URL :
'https://' + this.config.host + '/paystation2/?' + Helpers.param(query);
'https://' + this.config.host + '/paystation2/?';

const paymentUrl = urlWithoutQueryParams + Helpers.param(query);

if (this.config.consentId) {
return Helpers.getPaymentUrlWithConsentId(paymentUrl, this.config.consentId)
Expand Down

0 comments on commit 79f1d9c

Please sign in to comment.