indents
This commit is contained in:
parent
7a6edd751d
commit
c7e7692057
1 changed files with 11 additions and 11 deletions
|
@ -13,24 +13,24 @@ class HipsterShopServer {
|
||||||
* Handler for PaymentService.Charge.
|
* Handler for PaymentService.Charge.
|
||||||
* @param {*} call { ChargeRequest }
|
* @param {*} call { ChargeRequest }
|
||||||
* @param {*} callback fn(err, ChargeResponse)
|
* @param {*} callback fn(err, ChargeResponse)
|
||||||
*/
|
*/
|
||||||
static ChargeServiceHandler(call, callback) {
|
static ChargeServiceHandler(call, callback) {
|
||||||
try {
|
try {
|
||||||
const response = this.charge(call.request)
|
const response = this.charge(call.request)
|
||||||
callback(null, response);
|
callback(null, response);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Charge function
|
* Charge function
|
||||||
* @param {*} request
|
* @param {*} request
|
||||||
* @return transaction_id
|
* @return transaction_id
|
||||||
*/
|
*/
|
||||||
static charge(request) {
|
static charge(request) {
|
||||||
return { transaction_id: -1 }
|
return { transaction_id: -1 }
|
||||||
}
|
}
|
||||||
|
|
||||||
listen() {
|
listen() {
|
||||||
this.server.bind(`0.0.0.0:${this.port}`, grpc.ServerCredentials.createInsecure());
|
this.server.bind(`0.0.0.0:${this.port}`, grpc.ServerCredentials.createInsecure());
|
||||||
|
|
Loading…
Reference in a new issue