public string GetOBWriteDomesticConsentResponse2() { string consentId = Guid.NewGuid().ToString(); OBWriteDomestic2DataInitiationInstructedAmount instructedAmount = new OBWriteDomestic2DataInitiationInstructedAmount(amount: "50", currency: "GBP"); OBWriteDomestic2DataInitiationCreditorAccount creditorAccount = new OBWriteDomestic2DataInitiationCreditorAccount( schemeName: "IBAN", identification: "BE56456394728288", name: "ACME DIY", secondaryIdentification: "secondary-identif"); OBWriteDomestic2DataInitiation domestic2 = new OBWriteDomestic2DataInitiation( instructionIdentification: "instr-identification", endToEndIdentification: "e2e-identification", localInstrument: null, instructedAmount: instructedAmount, debtorAccount: null, creditorAccount: creditorAccount); OBWriteDomesticConsentResponse4Data data = new OBWriteDomesticConsentResponse4Data( consentId: consentId, creationDateTime: DateTime.Now, status: OBWriteDomesticConsentResponse4Data.StatusEnum.AwaitingAuthorisation, statusUpdateDateTime: DateTime.Now, cutOffDateTime: DateTime.Now.Add(new TimeSpan(days: 1, hours: 0, minutes: 0, seconds: 0)), expectedExecutionDateTime: DateTime.Now, expectedSettlementDateTime: DateTime.Now, charges: null, initiation: domestic2); OBRisk1DeliveryAddress deliveryAddress = new OBRisk1DeliveryAddress { StreetName = "Oxford Street", BuildingNumber = "42", PostCode = "SW1 1AA", TownName = "London", Country = "UK" }; OBRisk1 risk = new OBRisk1( paymentContextCode: OBRisk1.PaymentContextCodeEnum.EcommerceGoods, merchantCategoryCode: null, merchantCustomerIdentification: null, deliveryAddress: deliveryAddress); Links links = new Links($"{MockRoutes.Url}/{MockRoutes.DomesticPayments}/{consentId}"); Meta meta = new Meta(1); OBWriteDomesticConsentResponse4 model = new OBWriteDomesticConsentResponse4( data: data, risk: risk, links: links, meta: meta); return(JsonConvert.SerializeObject(model)); }
public void OBWriteDomesticDataInitiationInstructedAmount_To_V111() { OBWriteDomestic2DataInitiationInstructedAmount value = new OBWriteDomestic2DataInitiationInstructedAmount { Amount = 1234.56.ToString(), Currency = "GBP" }; ObModels.PaymentInitiation.V3p1p1.Model.OBDomestic2InstructedAmount result = _entityMapper.Map <ObModels.PaymentInitiation.V3p1p1.Model.OBDomestic2InstructedAmount>(value); result.Should().NotBeNull(); result.Amount.Should().Be(value.Amount); result.Currency.Should().Be(value.Currency); }
public string GetOBWriteDomesticResponse2() { var consentId = Guid.NewGuid().ToString(); var instructedAmount = new OBWriteDomestic2DataInitiationInstructedAmount("50", "GBP"); var creditorAccount = new OBWriteDomestic2DataInitiationCreditorAccount("IBAN", "BE56456394728288", "ACME DIY", "secondary-identif"); var domestic2 = new OBWriteDomestic2DataInitiation("instr-identification", "e2e-identification", null, instructedAmount, null, creditorAccount); var dataDomesticReponse2 = new OBWriteDomesticResponse4Data("PaymentId", consentId, DateTime.Now, OBWriteDomesticResponse4Data.StatusEnum.Pending, DateTimeOffset.Now, DateTimeOffset.Now, DateTimeOffset.Now, null, null, domestic2); var links = new Links($"{MockRoutes.Url}/{MockRoutes.DomesticPayments}"); var meta = new Meta(1); var model = new OBWriteDomesticResponse4(dataDomesticReponse2, links, meta); return(JsonConvert.SerializeObject(model)); }
public static DomesticPaymentConsentContext Amount( this DomesticPaymentConsentContext context, OBWriteDomestic2DataInitiationInstructedAmount value) { context.ArgNotNull(nameof(context)); if (value != null) { context.GetOrCreateDefault(BaseLens) .GetOrCreateDefault(DomesticConsentLens) .GetOrCreateDefault(DataLens) .GetOrCreateDefault(InitiationLens).InstructedAmount = value; } return(context); }
public static DomesticPaymentConsentContext Amount( this DomesticPaymentConsentContext context, string currency, double value) { context.ArgNotNull(nameof(context)); OBWriteDomestic2DataInitiationInstructedAmount amt = context.GetOrCreateDefault(BaseLens) .GetOrCreateDefault(DomesticConsentLens) .GetOrCreateDefault(DataLens) .GetOrCreateDefault(InitiationLens) .GetOrCreateDefault(InstructedAmountLens); amt.Currency = currency; amt.Amount = value.ToString(CultureInfo.InvariantCulture); return(context); }
public string GetOBWriteDomesticConsent2() { OBWriteDomestic2DataInitiationInstructedAmount instructedAmount = new OBWriteDomestic2DataInitiationInstructedAmount(amount: "50", currency: "GBP"); OBWriteDomestic2DataInitiationCreditorAccount creditorAccount = new OBWriteDomestic2DataInitiationCreditorAccount( schemeName: "IBAN", identification: "BE56456394728288", name: "ACME DIY", secondaryIdentification: "secondary-identif"); OBWriteDomestic2DataInitiationRemittanceInformation remittanceInformation = new OBWriteDomestic2DataInitiationRemittanceInformation(unstructured: "Tools", reference: "Tools"); OBWriteDomestic2DataInitiation domestic2 = new OBWriteDomestic2DataInitiation( instructionIdentification: "instr-identification", endToEndIdentification: "e2e-identification", localInstrument: null, instructedAmount: instructedAmount, debtorAccount: null, creditorAccount: creditorAccount, remittanceInformation: remittanceInformation); OBWriteDomesticConsent4Data data = new OBWriteDomesticConsent4Data { Initiation = domestic2 }; OBRisk1DeliveryAddress deliveryAddress = new OBRisk1DeliveryAddress { StreetName = "Oxford Street", BuildingNumber = "42", PostCode = "SW1 1AA", TownName = "London", Country = "UK" }; OBRisk1 risk = new OBRisk1( paymentContextCode: OBRisk1.PaymentContextCodeEnum.EcommerceGoods, merchantCategoryCode: null, merchantCustomerIdentification: null, deliveryAddress: deliveryAddress); OBWriteDomesticConsent4 model = new OBWriteDomesticConsent4(data: data, risk: risk); return(JsonConvert.SerializeObject(model)); }