Skip to content

Commit

Permalink
Added process.exit() commands to Try API examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrd committed May 5, 2016
1 parent fcc2da2 commit e1af317
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dotdashpay/rpcgen/templates/nodejs.examples.source.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ describe("{{service.name}}", function() {
// @test-end()
{% endif %}
{% endfor%}

{% if not is_example %}
process.exit(0);
{% endif %}


// @test()
callbacksVisited++;
{% if resp.type == "COMPLETION" %}
Expand Down Expand Up @@ -143,9 +149,11 @@ dotdashpay.setup({
dotdashpay.payment.receivePaymentDataThenSettle({cents: 100})
.onSettled(function (response) {
console.log("Settlement finished! Transaction id: " + response.settle_id);
process.exit(0);
})
.onError(function (errorData) {
console.error("Unexpected error while processing receivePaymentDataThenSettle: " + errorData);
process.exit(0);
});
// @single-end()
// @reference-end()
Expand Down

0 comments on commit e1af317

Please sign in to comment.