public CreatePeccoPaymentRequest Build()
        {
            CreatePeccoPaymentRequest createPeccoPaymentRequest = new CreatePeccoPaymentRequest();

            createPeccoPaymentRequest.Token = _token;
            return(createPeccoPaymentRequest);
        }
        public void Should_Create_Pecco_Payment()
        {
            CreatePeccoInitializeRequest request = CreatePeccoInitializeRequestBuilder.Create()
                                                   .CallbackUrl("https://www.merchant.com/callback")
                                                   .PaymentGroup(PaymentGroup.LISTING.ToString())
                                                   .Price("1")
                                                   .PaidPrice("10")
                                                   .Build();

            string token = PeccoInitialize.Create(request, Options).Token;

            CreatePeccoPaymentRequest peccoPaymentRequest = CreatePeccoPaymentRequestBuilder.Create()
                                                            .Token(token)
                                                            .Build();

            PeccoPayment peccoPayment = PeccoPayment.Create(peccoPaymentRequest, Options);

            PrintResponse(peccoPayment);
        }
Exemple #3
0
        public void Should_Create_Pecco_Payment()
        {
            CreatePeccoPaymentRequest request = new CreatePeccoPaymentRequest();

            request.Locale         = Locale.TR.ToString();
            request.ConversationId = "123456789";
            request.Token          = "token";

            PeccoPayment peccoPayment = PeccoPayment.Create(request, options);

            PrintResponse <PeccoPayment>(peccoPayment);

            Assert.AreEqual(Status.SUCCESS.ToString(), peccoPayment.Status);
            Assert.AreEqual(Locale.TR.ToString(), peccoPayment.Locale);
            Assert.AreEqual("123456789", peccoPayment.ConversationId);
            Assert.IsNotNull(peccoPayment.SystemTime);
            Assert.IsNull(peccoPayment.ErrorCode);
            Assert.IsNull(peccoPayment.ErrorMessage);
            Assert.IsNull(peccoPayment.ErrorGroup);
        }
        public async Task Should_Create_Pecco_Payment()
        {
            CreatePeccoPaymentRequest request = new CreatePeccoPaymentRequest
            {
                Locale         = Locale.TR.ToString(),
                ConversationId = "123456789",
                Token          = "token"
            };

            PeccoPayment peccoPayment = await PeccoPayment.CreateAsync(request, Options);

            PrintResponse(peccoPayment);

            Assert.AreEqual(Status.SUCCESS.ToString(), peccoPayment.Status);
            Assert.AreEqual(Locale.TR.ToString(), peccoPayment.Locale);
            Assert.AreEqual("123456789", peccoPayment.ConversationId);
            Assert.IsNotNull(peccoPayment.SystemTime);
            Assert.IsNull(peccoPayment.ErrorCode);
            Assert.IsNull(peccoPayment.ErrorMessage);
            Assert.IsNull(peccoPayment.ErrorGroup);
        }
 public static async Task <PeccoPayment> CreateAsync(CreatePeccoPaymentRequest request, Options options)
 {
     return(await RestHttpClient.Instance.PostAsync <PeccoPayment>(options.BaseUrl + PeccoPaymentUrl, GetHttpHeaders(request, options), request));
 }
 public static PeccoPayment Create(CreatePeccoPaymentRequest request, Options options)
 {
     return(RestHttpClient.Instance.Post <PeccoPayment>(options.BaseUrl + PeccoPaymentUrl, GetHttpHeaders(request, options), request));
 }
 public static PeccoPayment Create(CreatePeccoPaymentRequest request, Options options)
 {
     return(RestHttpClient.Create().Post <PeccoPayment>(options.BaseUrl + "/payment/pecco/auth", GetHttpHeaders(request, options), request));
 }