Skip to content

Commit d96ca1e

Browse files
authored
Merge pull request #83 from rspective/pg/api-configurable
Set api endopoint inside iframe widgets
2 parents fab4c9f + da6575b commit d96ca1e

7 files changed

+449
-441
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ The iframe renders the redeem widget
514514
<div class="voucherify-voucher-redeem"
515515
data-client-app-id="YOUR-CLIENT-APPLICATION-ID-FROM-SETTINGS"
516516
data-client-token="YOUR-CLIENT-TOKEN-FROM-SETTINGS"
517+
data-client-app-url="API-ENDPOINT; optional; defaults to https://app.voucherify.io"
517518

518519
data-code-field="true"
519520
data-code-field-label="Label"
@@ -622,6 +623,7 @@ You can also embed the "get voucher" widget as an iframe
622623
<div class="voucherify-get-voucher"
623624
data-client-app-id="YOUR-CLIENT-APPLICATION-ID-FROM-SETTINGS"
624625
data-client-token="YOUR-CLIENT-TOKEN-FROM-SETTINGS"
626+
data-client-app-url="API-ENDPOINT; optional; defaults to https://app.voucherify.io"
625627

626628
data-campaign="Campaign name"
627629

@@ -670,12 +672,13 @@ The widget is fully configurable. You can decide which fields are visible and re
670672
671673
### Subscribe widget - iframe
672674
673-
The iframe redners a widget which creates a customer profile in Voucherify
675+
The iframe renders a widget which creates a customer profile in Voucherify
674676
675677
```html
676678
<div class="voucherify-subscribe"
677679
data-client-app-id="YOUR-CLIENT-APPLICATION-ID-FROM-SETTINGS"
678680
data-client-token="YOUR-CLIENT-TOKEN-FROM-SETTINGS"
681+
data-client-app-url="API-ENDPOINT; optional; defaults to https://app.voucherify.io"
679682

680683
data-name-field="true"
681684
data-name-field-required="false"
@@ -736,6 +739,7 @@ Description and legal fields do support markdown syntax. It means that you can u
736739
737740
### Changelog
738741
742+
- **2021-06-20** - `1.33.0` - Add possibility of configuring API endpoint for iframe widgets
739743
- **2020-09-16** - `1.32.0` - Add possibility to send order metadata with validation request
740744
- **2019-12-23** - `1.31.0` - Add possibility to send customer metadata with validation request
741745
- **2019-02-05** - `1.30.0` - Add method for setting base app url

dist/voucherify.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1089,10 +1089,10 @@ window.Voucherify = (function (window, document, $) {
10891089
})("docReady", window);
10901090

10911091
function renderIframes() {
1092-
var host = "https://app.voucherify.io";
10931092
var common_attributes = [
10941093
"client-app-id",
10951094
"client-token",
1095+
"client-app-url",
10961096

10971097
"logo",
10981098

@@ -1259,6 +1259,8 @@ window.Voucherify = (function (window, document, $) {
12591259
return self;
12601260
}
12611261

1262+
var host = self._options["client-app-url"] ? self._options["client-app-url"] : "https://app.voucherify.io";
1263+
12621264
// -- set custom height or fallback
12631265
var widget_height = self._options.height;
12641266
// -- remove custom height from options to prevent before sending it

dist/voucherify.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/voucherify.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/voucherify.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1089,10 +1089,10 @@ window.Voucherify = (function (window, document, $) {
10891089
})("docReady", window);
10901090

10911091
function renderIframes() {
1092-
var host = "https://app.voucherify.io";
10931092
var common_attributes = [
10941093
"client-app-id",
10951094
"client-token",
1095+
"client-app-url",
10961096

10971097
"logo",
10981098

@@ -1259,6 +1259,8 @@ window.Voucherify = (function (window, document, $) {
12591259
return self;
12601260
}
12611261

1262+
var host = self._options["client-app-url"] ? self._options["client-app-url"] : "https://app.voucherify.io";
1263+
12621264
// -- set custom height or fallback
12631265
var widget_height = self._options.height;
12641266
// -- remove custom height from options to prevent before sending it

0 commit comments

Comments
 (0)