Skip to content

Commit

Permalink
made Nodejs examples template print more readable output
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrd committed May 26, 2016
1 parent ecea43f commit 9d99e23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dotdashpay/rpcgen/templates/nodejs.examples.source.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("{{service.name}}", function() {
dotdashpay.{{service.name|lowercase_first_letter}}.{{method.name|lowercase_first_letter}}(args)
{% for resp in method | get_method_options %}
.on{{resp.name}}(function (response) {
console.log("Received on{{resp.name}} response", JSON.stringify(response));
console.log("Received on{{resp.name}} response", JSON.stringify(response, null, 2));
{% set first = True %}
{% for field in (resp.name | find_proto_by_name).field %}
{% if field.name != "META" %}
Expand Down Expand Up @@ -62,7 +62,7 @@ describe("{{service.name}}", function() {
})
{% endfor %}
.onError(function (errorData) {
console.log("Error", JSON.stringify(errorData));
console.log("Error", JSON.stringify(errorData, null, 2));
{% if not is_example %}

process.exit(0);
Expand Down Expand Up @@ -167,11 +167,11 @@ dotdashpay.setup({

dotdashpay.payment.receivePaymentDataThenSettle({cents: 100})
.onSettled(function (response) {
console.log("Settlement finished! Transaction id: " + response.settleId);
console.log("Settlement finished! Settle response data: ", JSON.stringify(response, null, 2));
process.exit(0);
})
.onError(function (errorData) {
console.error("Unexpected error while processing receivePaymentDataThenSettle: " + errorData);
console.error("Unexpected error: ", JSON.stringify(response, null, 2));
process.exit(0);
});
// @standalone-end()
Expand Down

0 comments on commit 9d99e23

Please sign in to comment.