예제 #1
0
        public SendCodeResponse Send(SendCodeRequest sendCode)
        {
            this.ValidatedAndParseFields(sendCode);

            StringBuilder verifyRequestUrl = new StringBuilder("/verify");

            if (this.IsResend)
            {
                verifyRequestUrl.Append("/resend");
            }
            else
            {
                verifyRequestUrl.Append("/req");
            }

            if (this.Channel == Channel.Sms)
            {
                verifyRequestUrl.Append("/sms");
            }

            string responseStr      = this.ApiRequest.Post(verifyRequestUrl.ToString(), this.parameters);
            var    sendCodeResponse = (SendCodeResponse)ResponseFactory.CreateObjectfromRawResponse <SendCodeResponse>(responseStr)
                                      .SetRawResponse(this.ApiRequest.RawResponse);

            sendCodeResponse.Client = this;

            return(sendCodeResponse);
        }
예제 #2
0
        public SendCodeResponse Resend(SendCodeRequest sendCode)
        {
            this.SendAs(Channel.Sms);
            this.IsResend       = true;
            this.requiredFields = new List <string> {
                "mocean-api-key", "mocean-api-secret", "mocean-reqid"
            };

            return(this.Send(sendCode));
        }