Ejemplo n.º 1
0
        public static string Execute(CancelTokenRequest request, Options options)
        {
            string hash = CreateSignature(request, options.SecretKey);
            var    url  = options.Url + request.TOKEN + "?merchant=" + request.MERCHANT + "&timestamp=" + request.TIMESTAMP + "&signature=" + hash + "&cancelReason=" + request.CANCELREASON;

            return(HttpCaller.GetDataToUrl(url));
        }
Ejemplo n.º 2
0
        public static string Execute(BinV1Request request, Options options)
        {
            var    hashString = CreateHashString(request, options.SecretKey);
            string createUrl  = options.Url + request.BIN + "?" + hashString;

            return(HttpCaller.GetDataToUrl(createUrl));
        }
        public static string Execute(GetTokenInformationRequest request, Options options)
        {
            string hash = CreateSignature(request, options.SecretKey);
            var    url  = options.Url + request.TOKEN + "?merchant=" + request.MERCHANT + "&timestamp=" + request.TIMESTAMP + "&signature=" + hash; //secure.payu.com.tr/order/token/v2/merchantToken/b7e5d8649c9e2e75726b59c56c29e91d?merchant=CC921&timestamp=1428046996&signature=34b084915a67bf2b54eff4a29e677c2718e26a6632496bfb4c5880a5d938b96e

            return(HttpCaller.GetDataToUrl(url));
        }
Ejemplo n.º 4
0
        public static string Execute(TokenHistoryRequest request, Options options)
        {
            string hash = CreateSignature(request, options.SecretKey);
            var    url  = options.Url + request.TOKEN + "/history" + "?merchant=" + request.MERCHANT + "&timestamp=" + request.TIMESTAMP + "&signature=" + hash;

            return(HttpCaller.GetDataToUrl(url));
        }
Ejemplo n.º 5
0
        public static string Execute(ReportRequest request, Options options)
        {
            var hashString = CreateHashString(request, options.SecretKey);

            string url = options.Url + "?" + hashString;

            return(HttpCaller.GetDataToUrl(url));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Pause()
        {
            HttpStatusCode status = await HttpCaller.Put(_spotifyAPISettings.SpotifyUrl + "/pause?device_id=" + _spotifyAPISettings.DeviceID,
                                                         _spotifyAPISettings.AccessToken,
                                                         null);

            return(StatusCode((int)status));
        }
Ejemplo n.º 7
0
        public async Task <ActionResult <SpotifyReply> > Get()
        {
            Player player = await HttpCaller.Get <Player>(_spotifyAPISettings.SpotifyUrl,
                                                          _spotifyAPISettings.AccessToken);

            SpotifyReply spotifyReply = player.ToSpotifyReply();

            return(Ok(spotifyReply));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Get(int volume)
        {
            HttpStatusCode status = await HttpCaller.Put(_spotifyAPISettings.SpotifyUrl + "/volume" +
                                                         "?volume_percent=" + volume +
                                                         "&device_id=" + _spotifyAPISettings.DeviceID,
                                                         _spotifyAPISettings.AccessToken,
                                                         null);

            return(StatusCode((int)status));
        }
Ejemplo n.º 9
0
        public async Task <ActionResult <SpotifyReply> > Previous()
        {
            HttpStatusCode status = await HttpCaller.Post(_spotifyAPISettings.SpotifyUrl + "/previous?device_id=" + _spotifyAPISettings.DeviceID,
                                                          _spotifyAPISettings.AccessToken,
                                                          null);

            Player player = await HttpCaller.Get <Player>(_spotifyAPISettings.SpotifyUrl,
                                                          _spotifyAPISettings.AccessToken);

            SpotifyReply spotifyReply = player.ToSpotifyReply();

            return(Ok(spotifyReply));
        }
Ejemplo n.º 10
0
        public static string Execute(MultipleTokenRequest request, Options options)
        {
            string hash        = CreateSignature(request, options.SecretKey);
            int    i           = 0;
            string tokenString = string.Empty;

            foreach (var item in request.TOKENS)
            {
                tokenString += "&tokens[" + i + "]=" + item.TOKEN;
                i++;
            }
            tokenString = tokenString.Substring(1);

            string url = options.Url + "merchantToken?" + tokenString + "&merchant=" + request.MERCHANT + "&timestamp=" + request.TIMESTAMP + "&signature=" + hash;

            return(HttpCaller.GetDataToUrl(url));
        }
 public void Setup()
 {
     _Caller = new HttpCaller();
 }
Ejemplo n.º 12
0
        public static PointCheckResponse Execute(PointCheckWithTokenRequest request, Options options)
        {
            var hashString = CreateHashString(request, options.SecretKey);

            return(HttpCaller.Create().PostData <PointCheckResponse>(options.Url, hashString));
        }
Ejemplo n.º 13
0
        public static string Execute(ConfirmationRequest request, Options options)
        {
            var hashString = CreateHashString(request, options.SecretKey);

            return(HttpCaller.PostDataReturnString(options.Url, hashString));
        }
Ejemplo n.º 14
0
 public SpotifyApi(HttpCaller httpCaller)
 {
     _httpCaller = httpCaller;
 }
Ejemplo n.º 15
0
        public static ApiPayment3DResponse ThreeDSecurePayment(ApiPaymentRequest request, Options options)
        {
            var hashString = CreateHashString(request, options.SecretKey);

            return(HttpCaller.Create().PostData <ApiPayment3DResponse>(options.Url, hashString));
        }
Ejemplo n.º 16
0
        public static IOSResponse Execute(IOSRequest request, Options options)
        {
            var hashString = CreateHashString(request, options.SecretKey);

            return(HttpCaller.Create().PostData <IOSResponse>(options.Url, hashString));
        }
Ejemplo n.º 17
0
        public static string Execute(BinV2Request request, Options options)
        {
            var nameValueCollection = CreateHashString(request, options.SecretKey);

            return(HttpCaller.PostDataArrayReturnString(options.Url, nameValueCollection));
        }
Ejemplo n.º 18
0
 public VolumeController(IOptions <SpotifyAPISettings> spotifyApiSettings, HttpCaller httpCaller)
 {
     _spotifyAPISettings = spotifyApiSettings.Value;
     _httpCaller         = httpCaller;
 }
Ejemplo n.º 19
0
        public static string Execute(TokenServiceCreateTokenRequest request, Options options)
        {
            var nameValueCollection = CreatePostDataArray(request, options.SecretKey);

            return(HttpCaller.PostDataArrayReturnString(options.Url, nameValueCollection));
        }