Exemplo n.º 1
0
        public VaultResponse CreateToken(VaultRequest request)
        {
            var requestData  = SerializeHelper.Serialize(request);
            var responseJson = _serviceHelper.CallPaydock("vault/payment_sources", HttpMethod.POST, requestData, overrideConfigSecretKey: _overrideConfigSecretKey);

            var response = SerializeHelper.Deserialize <VaultResponse>(responseJson);

            response.JsonResponse = responseJson;
            return(response);
        }
Exemplo n.º 2
0
        public GatewayResponse Add(GatewayRequest request)
        {
            var requestData  = SerializeHelper.Serialize(request);
            var responseJson = _serviceHelper.CallPaydock("gateways", HttpMethod.POST, requestData, overrideConfigSecretKey: _overrideConfigSecretKey);

            var response = SerializeHelper.Deserialize <GatewayResponse>(responseJson);

            response.JsonResponse = responseJson;
            return(response);
        }
Exemplo n.º 3
0
        public ChargeResponse Add(ChargeRequestBase request)
        {
            var requestData  = SerializeHelper.Serialize(request);
            var responseJson = _serviceHelper.CallPaydock("charges", HttpMethod.POST, requestData, overrideConfigSecretKey: _overrideConfigSecretKey);

            var response = SerializeHelper.Deserialize <ChargeResponse>(responseJson);

            response.JsonResponse = responseJson;
            return(response);
        }
Exemplo n.º 4
0
        public ExternalCheckoutResponse Create(ExternalCheckoutRequest request)
        {
            var requestData  = SerializeHelper.Serialize(request);
            var responseJson = _serviceHelper.CallPaydock("payment_sources/external_checkout", HttpMethod.POST, requestData, overrideConfigSecretKey: _overrideConfigSecretKey);

            var response = SerializeHelper.Deserialize <ExternalCheckoutResponse>(responseJson);

            response.JsonResponse = responseJson;
            return(response);
        }
Exemplo n.º 5
0
        public TokenResponse Create(TokenRequest request)
        {
            var requestData = SerializeHelper.Serialize(request);

            var publicKey = Config.PublicKey;

            if (!string.IsNullOrEmpty(_overrideConfigPublicKey))
            {
                publicKey = _overrideConfigPublicKey;
            }

            var responseJson = _serviceHelper.CallPaydock("payment_sources/tokens?public_key=" + Uri.EscapeUriString(publicKey), HttpMethod.POST, requestData, excludeSecretKey: true);

            var response = SerializeHelper.Deserialize <TokenResponse>(responseJson);

            response.JsonResponse = responseJson;
            return(response);
        }
Exemplo n.º 6
0
        public NotificationTemplateResponse AddTemplate(NotificationTemplateRequest request)
        {
            var requestData  = SerializeHelper.Serialize(request);
            var responseJson = _serviceHelper.CallPaydock("notifications/templates", HttpMethod.POST, requestData, overrideConfigSecretKey: _overrideConfigSecretKey);

            var response = SerializeHelper.Deserialize <NotificationTemplateResponse>(responseJson);

            response.JsonResponse = responseJson;
            return(response);
        }