Пример #1
0
        private async Task <PayInCardWebDTO> CreatePayInCardWeb(string authorId, string creditedWalletId, Money debitedFunds, Money fees, string returnURL, CultureCode culture, CardType cardType)
        {
            PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(authorId, debitedFunds, fees, creditedWalletId, returnURL, culture, cardType)
            {
                SecureMode = SecureMode.FORCE
            };
            var payInCardWeb = await _mangoPayApi.PayIns.CreateCardWeb(payIn);

            return(payInCardWeb);
        }
Пример #2
0
        protected PayInCardWebDTO CreateJohnsPayInCardWeb(string walletId)
        {
            UserNaturalDTO user = this.GetJohn();

            PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money {
                Amount = 1000, Currency = CurrencyIso.EUR
            }, new Money {
                Amount = 0, Currency = CurrencyIso.EUR
            }, walletId, "https://test.com", CountryIso.FR, CardType.CB_VISA_MASTERCARD);

            return(this.Api.PayIns.CreateCardWeb(payIn));
        }
Пример #3
0
        protected PayInCardWebDTO GetNewPayInCardWeb()
        {
            WalletDTO      wallet = this.GetJohnsWallet();
            UserNaturalDTO user   = this.GetJohn();

            PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money {
                Amount = 1000, Currency = CurrencyIso.EUR
            }, new Money {
                Amount = 0, Currency = CurrencyIso.EUR
            }, wallet.Id, "https://test.com", CountryIso.FR, CardType.CB_VISA_MASTERCARD);

            BaseTest._johnsPayInCardWeb = this.Api.PayIns.CreateCardWeb(payIn);

            return(BaseTest._johnsPayInCardWeb);
        }
Пример #4
0
        protected PayInCardWebDTO GetJohnsPayInCardWeb(string walletId)
        {
            if (BaseTest._johnsPayInCardWeb == null)
            {
                UserNaturalDTO user = this.GetJohn();

                PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money {
                    Amount = 1000, Currency = CurrencyIso.EUR
                }, new Money {
                    Amount = 0, Currency = CurrencyIso.EUR
                }, walletId, "https://test.com", CultureCode.FR, CardType.CB_VISA_MASTERCARD);

                BaseTest._johnsPayInCardWeb = this.Api.PayIns.CreateCardWeb(payIn);
            }

            return(BaseTest._johnsPayInCardWeb);
        }
Пример #5
0
        protected async Task <PayInCardWebDTO> GetJohnsPayInCardWeb()
        {
            if (BaseTest._johnsPayInCardWeb == null)
            {
                WalletDTO wallet = await this.GetJohnsWallet();

                UserNaturalDTO user = await this.GetJohn();

                PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money {
                    Amount = 1000, Currency = CurrencyIso.EUR
                }, new Money {
                    Amount = 0, Currency = CurrencyIso.EUR
                }, wallet.Id, "https://test.com", CultureCode.FR, CardType.CB_VISA_MASTERCARD);

                BaseTest._johnsPayInCardWeb = await this.Api.PayIns.CreateCardWeb(payIn);
            }

            return(BaseTest._johnsPayInCardWeb);
        }
        public void Test_Idempotency_PayinsCardWebCreate()
        {
            string              key    = DateTime.Now.Ticks.ToString();
            WalletDTO           wallet = this.GetJohnsWallet();
            UserNaturalDTO      user   = this.GetJohn();
            PayInCardWebPostDTO payIn  = new PayInCardWebPostDTO(user.Id,
                                                                 new Money {
                Amount = 1000, Currency = CurrencyIso.EUR
            },
                                                                 new Money {
                Amount = 0, Currency = CurrencyIso.EUR
            }, wallet.Id, "https://test.com", CultureCode.FR,
                                                                 CardType.CB_VISA_MASTERCARD);

            Api.PayIns.CreateCardWeb(key, payIn);

            var result = Api.Idempotency.Get(key);

            Assert.IsInstanceOf <PayInCardWebDTO>(result.Resource);
        }
Пример #7
0
        protected PayInCardWebDTO GetJohnsPayInCardWeb(string walletId)
        {
            if (BaseTest._johnsPayInCardWeb == null)
            {
                UserNaturalDTO user = this.GetJohn();

                PayInCardWebPostDTO payIn = new PayInCardWebPostDTO(user.Id, new Money {
                    Amount = 1000, Currency = CurrencyIso.EUR
                }, new Money {
                    Amount = 0, Currency = CurrencyIso.EUR
                }, walletId, "https://test.com", CultureCode.FR, CardType.CB_VISA_MASTERCARD);
                //Add TemplateURLOptionsCard for tests
                payIn.TemplateURLOptionsCard = new TemplateURLOptionsCard {
                    PAYLINEV2 = "https://www.maysite.com/payline_template/"
                };

                BaseTest._johnsPayInCardWeb = this.Api.PayIns.CreateCardWeb(payIn);
            }

            return(BaseTest._johnsPayInCardWeb);
        }
Пример #8
0
        public async Task <PayInCardWebDTO> CreateCardWeb(string idempotencyKey, PayInCardWebPostDTO payIn)
        {
            var targetUrl = $"{_baseUrl}/payins/card/web";

            return(await CreateEntity <PayInCardWebDTO, PayInCardWebPostDTO>(targetUrl, payIn, idempotencyKey));
        }
Пример #9
0
 /// <summary>Creates new payin card web.</summary>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="payIn">Object instance to be created.</param>
 /// <returns>Object instance returned from API.</returns>
 public PayInCardWebDTO CreateCardWeb(String idempotencyKey, PayInCardWebPostDTO payIn)
 {
     return(this.CreateObject <PayInCardWebDTO, PayInCardWebPostDTO>(idempotencyKey, MethodKey.PayinsCardWebCreate, payIn));
 }
Пример #10
0
 /// <summary>Creates new payin card web.</summary>
 /// <param name="payIn">Object instance to be created.</param>
 /// <returns>Object instance returned from API.</returns>
 public PayInCardWebDTO CreateCardWeb(PayInCardWebPostDTO payIn)
 {
     return(CreateCardWeb(null, payIn));
 }
 /// <summary>Creates new payin card web.</summary>
 /// <param name="payIn">Object instance to be created.</param>
 /// <returns>Object instance returned from API.</returns>
 public async Task <PayInCardWebDTO> CreateCardWeb(PayInCardWebPostDTO payIn)
 {
     return(await CreateCardWeb(null, payIn));
 }
Пример #12
0
 /// <summary>Creates new payin card web.</summary>
 /// <param name="payIn">Object instance to be created.</param>
 /// <returns>Object instance returned from API.</returns>
 public PayInCardWebDTO CreateCardWeb(PayInCardWebPostDTO payIn)
 {
     return(this.CreateObject <PayInCardWebDTO, PayInCardWebPostDTO>(MethodKey.PayinsCardWebCreate, payIn));
 }
Пример #13
0
 /// <summary>Creates new payin card web.</summary>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="payIn">Object instance to be created.</param>
 /// <returns>Object instance returned from API.</returns>
 public async Task <PayInCardWebDTO> CreateCardWebAsync(String idempotencyKey, PayInCardWebPostDTO payIn)
 {
     return(await this.CreateObjectAsync <PayInCardWebDTO, PayInCardWebPostDTO>(idempotencyKey, MethodKey.PayinsCardWebCreate, payIn));
 }