Skip to content

Commit

Permalink
Merge pull request #295 from recurly/hash-config
Browse files Browse the repository at this point in the history
Sends initial field config over hash instead of query
  • Loading branch information
snodgrass23 authored Aug 30, 2016
2 parents 51e10b0 + f5926ea commit 70d314f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/recurly/hosted-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ export class HostedField extends Emitter {

url () {
let config = encodeURIComponent(JSON.stringify(this.config));
return `${this.config.recurly.api}/field?config=${config}`;
return `${this.config.recurly.api}/field.html#config=${config}`;
}
}
2 changes: 1 addition & 1 deletion test/server/fixtures/field.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
}
function config () {
var query = window.location.search;
var query = window.location.hash;
return JSON.parse(decodeURIComponent(query.substring(query.indexOf('config=') + 7)) || {});
}
Expand Down
1 change: 1 addition & 0 deletions test/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ app.use(route.get('/tax', json));
app.use(route.get('/paypal/start', postMessage));
app.use(route.get('/relay', render('relay')));
app.use(route.get('/field', render('field')));
app.use(route.get('/field.html', render('field')));
app.use(route.get('/fraud_data_collector', json));

app.listen(port, () => {
Expand Down

0 comments on commit 70d314f

Please sign in to comment.