Exemplo n.º 1
0
        protected HookDTO GetJohnsHook()
        {
            if (BaseTest._johnsHook == null)
            {
                Pagination pagination        = new Pagination(1, 1);
                ListPaginated <HookDTO> list = this.Api.Hooks.GetAll(pagination);

                if (list != null && list.Count > 0 && list[0] != null)
                {
                    BaseTest._johnsHook = list[0];
                }
                else
                {
                    HookPostDTO hook = new HookPostDTO("http://test.com", EventType.PAYIN_NORMAL_CREATED);
                    BaseTest._johnsHook = this.Api.Hooks.Create(hook);
                }
            }

            return(BaseTest._johnsHook);
        }
        public async Task <HookDTO> Create(string idempotencyKey, HookPostDTO hook)
        {
            var targetUrl = $"{_baseUrl}/hooks";

            return(await CreateEntity <HookDTO, HookPostDTO>(targetUrl, hook, idempotencyKey));
        }
        public async Task <HookDTO> Create(HookPostDTO hook)
        {
            var targetUrl = $"{_baseUrl}/hooks";

            return(await CreateEntity <HookDTO, HookPostDTO>(targetUrl, hook));
        }
 /// <summary>Creates new hook.</summary>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="hook">Hook instance to be created.</param>
 /// <returns>Hook instance returned from API.</returns>
 public async Task <HookDTO> Create(String idempotencyKey, HookPostDTO hook)
 {
     return(await this.CreateObject <HookDTO, HookPostDTO>(idempotencyKey, MethodKey.HooksCreate, hook));
 }
 /// <summary>Creates new hook.</summary>
 /// <param name="hook">Hook instance to be created.</param>
 /// <returns>Hook instance returned from API.</returns>
 public async Task <HookDTO> Create(HookPostDTO hook)
 {
     return(await Create(null, hook));
 }
Exemplo n.º 6
0
 /// <summary>Creates new hook.</summary>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="hook">Hook instance to be created.</param>
 /// <returns>Hook instance returned from API.</returns>
 public HookDTO Create(String idempotencyKey, HookPostDTO hook)
 {
     return(this.CreateObject <HookDTO, HookPostDTO>(idempotencyKey, MethodKey.HooksCreate, hook));
 }
Exemplo n.º 7
0
 /// <summary>Creates new hook.</summary>
 /// <param name="hook">Hook instance to be created.</param>
 /// <returns>Hook instance returned from API.</returns>
 public HookDTO Create(HookPostDTO hook)
 {
     return(Create(null, hook));
 }
Exemplo n.º 8
0
 /// <summary>Creates new hook.</summary>
 /// <param name="hook">Hook instance to be created.</param>
 /// <returns>Hook instance returned from API.</returns>
 public HookDTO Create(HookPostDTO hook)
 {
     return(this.CreateObject <HookDTO, HookPostDTO>(MethodKey.HooksCreate, hook));
 }