public void Update(string overideSecretKey) { var newGateway = AddGateway(overideSecretKey); var request = new GatewayUpdateRequest { _id = newGateway.resource.data._id, type = "Brain", name = "BraintreeTesting", merchant = "r7pcwvkbkgjfzk99", username = "******", password = "******" }; GatewayItemResponse result; if (overideSecretKey != null) { result = new Gateways(overideSecretKey).Update(request); } else { result = new Gateways().Update(request); } Assert.IsTrue(result.IsSuccess); // clean up if (overideSecretKey != null) { new Gateways(overideSecretKey).Delete(newGateway.resource.data._id); } else { new Gateways().Delete(newGateway.resource.data._id); } }
public GatewayItemResponse Update(GatewayUpdateRequest request) { var gatewayid = Uri.EscapeUriString(request._id); var requestData = SerializeHelper.Serialize(request); var responseJson = _serviceHelper.CallPaydock("gateways/" + gatewayid, HttpMethod.PUT, requestData, overrideConfigSecretKey: _overrideConfigSecretKey); var response = SerializeHelper.Deserialize <GatewayItemResponse>(responseJson); response.JsonResponse = responseJson; return(response); }
public async Task <GatewayItemResponse> Update(GatewayUpdateRequest request) { var gatewayid = Uri.EscapeUriString(request._id); return(await _serviceHelper.Put <GatewayItemResponse, GatewayUpdateRequest>(request, "gateways/" + gatewayid, overrideConfigSecretKey : _overrideConfigSecretKey)); }