public async Task Should_Retrieve_Checkout_Form_Result() { IReadOnlyList <BasketItem> basketItems = new ReadOnlyCollection <BasketItem>(new List <BasketItem>() { BasketItemBuilder.Create().Price("0.3").Build() }); CreateCheckoutFormInitializeRequest request = CreateCheckoutFormInitializeRequestBuilder.Create() .Price("0.3") .PaymentGroup(PaymentGroup.LISTING.ToString()) .PaidPrice("0.4") .CallbackUrl("https://www.merchant.com/callback") .BasketItems(basketItems) .Build(); CheckoutFormInitialize checkoutFormInitialize = await CheckoutFormInitialize.CreateAsync(request, Options); RetrieveCheckoutFormRequest retrieveCheckoutFormRequest = RetrieveCheckoutFormRequestBuilder.Create() .Token(checkoutFormInitialize.Token) .Build(); CheckoutForm checkoutForm = await CheckoutForm.RetrieveAsync(retrieveCheckoutFormRequest, Options); PrintResponse(checkoutForm); Assert.NotNull(checkoutForm.ErrorMessage); Assert.AreEqual(Status.FAILURE.ToString(), checkoutForm.Status); Assert.NotNull(checkoutForm.SystemTime); }
public async Task Should_Initialize_Checkout_Form_For_Standard_Merchant() { IReadOnlyList <BasketItem> basketItems = new ReadOnlyCollection <BasketItem>(new List <BasketItem>() { BasketItemBuilder.Create().Price("0.3").Build() }); CreateCheckoutFormInitializeRequest request = CreateCheckoutFormInitializeRequestBuilder.Create() .Price("0.3") .PaymentGroup(PaymentGroup.LISTING.ToString()) .PaidPrice("0.4") .CallbackUrl("https://www.merchant.com/callback") .BasketItems(basketItems) .Build(); CheckoutFormInitialize checkoutFormInitialize = await CheckoutFormInitialize.CreateAsync(request, Options); PrintResponse(request); Assert.AreEqual(Status.SUCCESS.ToString(), checkoutFormInitialize.Status); Assert.AreEqual(Locale.TR.ToString(), checkoutFormInitialize.Locale); Assert.NotNull(checkoutFormInitialize.SystemTime); Assert.NotNull(checkoutFormInitialize.Token); Assert.NotNull(checkoutFormInitialize.CheckoutFormContent); }
public CreatePaymentRequestBuilder StandardListingPayment() { _basketItems = BasketItemBuilder.Create().BuildDefaultBasketItems(); _paymentGroup = Model.PaymentGroup.LISTING.ToString(); return(this); }
public CreatePaymentRequestBuilder MarketplacePayment(string subMerchantKey, string price, string subMerchantPrice) { _basketItems = BasketItemBuilder.Create().BuildBasketItem(subMerchantKey, price, subMerchantPrice); _paymentGroup = Model.PaymentGroup.PRODUCT.ToString(); return(this); }
public CreatePaymentRequestBuilder MarketplacePaymentWithSamePrice(string subMerchantKey) { _basketItems = BasketItemBuilder.Create().BuildBasketItemsWithSubmetchantKeyAndSamePrice(subMerchantKey); _paymentGroup = Model.PaymentGroup.PRODUCT.ToString(); return(this); }