public Subscription(NodeWrapper node, IBraintreeGateway gateway) { Balance = node.GetDecimal("balance"); BillingDayOfMonth = node.GetInteger("billing-day-of-month"); BillingPeriodEndDate = node.GetDateTime("billing-period-end-date"); BillingPeriodStartDate = node.GetDateTime("billing-period-start-date"); CurrentBillingCycle = node.GetInteger("current-billing-cycle"); DaysPastDue = node.GetInteger("days-past-due"); Descriptor = new Descriptor(node.GetNode("descriptor")); Description = node.GetString("description"); FailureCount = node.GetInteger("failure-count"); FirstBillingDate = node.GetDateTime("first-billing-date"); CreatedAt = node.GetDateTime("created-at"); UpdatedAt = node.GetDateTime("updated-at"); Id = node.GetString("id"); NextBillAmount = node.GetDecimal("next-bill-amount"); NextBillingDate = node.GetDateTime("next-billing-date"); NextBillingPeriodAmount = node.GetDecimal("next-billing-period-amount"); NeverExpires = node.GetBoolean("never-expires"); NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles"); PaymentMethodToken = node.GetString("payment-method-token"); PaidThroughDate = node.GetDateTime("paid-through-date"); PlanId = node.GetString("plan-id"); Price = node.GetDecimal("price"); Status = (SubscriptionStatus)CollectionUtil.Find(SubscriptionStatus.STATUSES, node.GetString("status"), SubscriptionStatus.UNRECOGNIZED); List <NodeWrapper> statusNodes = node.GetList("status-history/status-event"); StatusHistory = new SubscriptionStatusEvent[statusNodes.Count]; for (int i = 0; i < statusNodes.Count; i++) { StatusHistory[i] = new SubscriptionStatusEvent(statusNodes[i]); } HasTrialPeriod = node.GetBoolean("trial-period"); TrialDuration = node.GetInteger("trial-duration"); var trialDurationUnitStr = node.GetString("trial-duration-unit"); if (trialDurationUnitStr != null) { TrialDurationUnit = (SubscriptionDurationUnit)CollectionUtil.Find(SubscriptionDurationUnit.ALL, trialDurationUnitStr, SubscriptionDurationUnit.UNRECOGNIZED); } MerchantAccountId = node.GetString("merchant-account-id"); AddOns = new List <AddOn> (); foreach (var addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List <Discount> (); foreach (var discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } Transactions = new List <Transaction> (); foreach (var transactionResponse in node.GetList("transactions/transaction")) { Transactions.Add(new Transaction(transactionResponse, gateway)); } }
public SubscriptionStatusEvent(NodeWrapper node) { if (node == null) return; Price = node.GetDecimal("price"); Balance = node.GetDecimal("balance"); Status = (SubscriptionStatus)CollectionUtil.Find(SubscriptionStatus.STATUSES, node.GetString("status"), SubscriptionStatus.UNRECOGNIZED); Timestamp = node.GetDateTime("timestamp"); Source = (SubscriptionSource)CollectionUtil.Find(SubscriptionSource.ALL, node.GetString("subscription-source"), SubscriptionSource.UNRECOGNIZED); User = node.GetString("user"); }
public SubscriptionStatusEvent(NodeWrapper node) { if (node == null) { return; } Price = node.GetDecimal("price"); Balance = node.GetDecimal("balance"); Status = (SubscriptionStatus)CollectionUtil.Find(SubscriptionStatus.STATUSES, node.GetString("status"), SubscriptionStatus.UNRECOGNIZED); Timestamp = node.GetDateTime("timestamp"); Source = (SubscriptionSource)CollectionUtil.Find(SubscriptionSource.ALL, node.GetString("subscription-source"), SubscriptionSource.UNRECOGNIZED); User = node.GetString("user"); }
public Dispute(NodeWrapper node) { Amount = node.GetDecimal("amount"); AmountDisputed = node.GetDecimal("amount-disputed"); AmountWon = node.GetDecimal("amount-won"); CreatedAt = node.GetDateTime("created-at"); DateOpened = node.GetDateTime("date-opened"); DateWon = node.GetDateTime("date-won"); ReceivedDate = node.GetDateTime("received-date"); ReplyByDate = node.GetDateTime("reply-by-date"); UpdatedAt = node.GetDateTime("updated-at"); Reason = node.GetEnum("reason", DisputeReason.GENERAL); Status = node.GetEnum("status", DisputeStatus.UNRECOGNIZED); Kind = node.GetEnum("kind", DisputeKind.UNRECOGNIZED); CaseNumber = node.GetString("case-number"); CurrencyIsoCode = node.GetString("currency-iso-code"); GraphQLId = node.GetString("global-id"); Id = node.GetString("id"); ProcessorComments = node.GetString("processor-comments"); MerchantAccountId = node.GetString("merchant-account-id"); OriginalDisputeId = node.GetString("original-dispute-id"); ReasonCode = node.GetString("reason-code"); ReasonDescription = node.GetString("reason-description"); ReferenceNumber = node.GetString("reference-number"); if (node.GetNode("transaction") != null) { TransactionDetails = new TransactionDetails(node.GetNode("transaction")); Transaction = new DisputeTransaction(node.GetNode("transaction")); } Evidence = new List <DisputeEvidence>(); foreach (var evidenceResponse in node.GetList("evidence/evidence")) { Evidence.Add(new DisputeEvidence(evidenceResponse)); } PayPalMessages = new List <DisputePayPalMessage>(); foreach (var paypalMessageResponse in node.GetList("paypal-messages/paypal-messages")) { PayPalMessages.Add(new DisputePayPalMessage(paypalMessageResponse)); } StatusHistory = new List <DisputeStatusHistory>(); foreach (var historyStatusResponse in node.GetList("status-history/status-history")) { StatusHistory.Add(new DisputeStatusHistory(historyStatusResponse)); } }
public SubscriptionStatusEvent(NodeWrapper node) { if (node == null) { return; } Price = node.GetDecimal("price"); Balance = node.GetDecimal("balance"); Status = node.GetEnum("status", SubscriptionStatus.UNRECOGNIZED); Timestamp = node.GetDateTime("timestamp"); Source = node.GetEnum("subscription-source", SubscriptionSource.UNRECOGNIZED); User = node.GetString("user"); CurrencyIsoCode = node.GetString("currency-iso-code"); PlanId = node.GetString("plan-id"); }
protected internal Adjustment(NodeWrapper node) { Amount = node.GetDecimal("amount"); ProjectedDisbursementDate = node.GetDateTime("projected_disbursement_date"); ActualDisbursementDate = node.GetDateTime("actual_disbursement_date"); Kind = node.GetEnum("kind", Kind.UNRECOGNIZED); }
public CreditCardVerification(NodeWrapper node, IBraintreeGateway gateway) { if (node == null) { return; } Amount = node.GetDecimal("amount"); AvsErrorResponseCode = node.GetString("avs-error-response-code"); AvsPostalCodeResponseCode = node.GetString("avs-postal-code-response-code"); AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code"); CurrencyIsoCode = node.GetString("currency-iso-code"); CvvResponseCode = node.GetString("cvv-response-code"); GatewayRejectionReason = (TransactionGatewayRejectionReason)CollectionUtil.Find( TransactionGatewayRejectionReason.ALL, node.GetString("gateway-rejection-reason"), null ); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); MerchantAccountId = node.GetString("merchant-account-id"); Status = (VerificationStatus)CollectionUtil.Find(VerificationStatus.ALL, node.GetString("status"), VerificationStatus.UNRECOGNIZED); Id = node.GetString("id"); BillingAddress = new Address(node.GetNode("billing")); CreditCard = new CreditCard(node.GetNode("credit-card"), gateway); CreatedAt = node.GetDateTime("created-at"); var riskDataNode = node.GetNode("risk-data"); if (riskDataNode != null) { RiskData = new RiskData(riskDataNode); } }
public Plan(NodeWrapper node) { if (node == null) return; BillingDayOfMonth = node.GetInteger("billing-day-of-month"); BillingFrequency = node.GetInteger("billing-frequency"); CurrencyIsoCode = node.GetString("currency-iso-code"); Description = node.GetString("description"); Id = node.GetString("id"); Name = node.GetString("name"); NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles"); Price = node.GetDecimal("price"); TrialPeriod = node.GetBoolean("trial-period"); TrialDuration = node.GetInteger("trial-duration"); string trialDurationUnitStr = node.GetString("trial-duration-unit"); if (trialDurationUnitStr != null) { TrialDurationUnit = (PlanDurationUnit) CollectionUtil.Find(PlanDurationUnit.ALL, trialDurationUnitStr, PlanDurationUnit.UNRECOGNIZED); } AddOns = new List<AddOn> (); foreach (var addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List<Discount> (); foreach (var discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } }
public Plan(NodeWrapper node) { if (node == null) { return; } BillingDayOfMonth = node.GetInteger("billing-day-of-month"); BillingFrequency = node.GetInteger("billing-frequency"); CurrencyIsoCode = node.GetString("currency-iso-code"); Description = node.GetString("description"); Id = node.GetString("id"); Name = node.GetString("name"); NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles"); Price = node.GetDecimal("price"); TrialPeriod = node.GetBoolean("trial-period"); TrialDuration = node.GetInteger("trial-duration"); String trialDurationUnitStr = node.GetString("trial-duration-unit"); if (trialDurationUnitStr != null) { TrialDurationUnit = (PlanDurationUnit)CollectionUtil.Find(PlanDurationUnit.ALL, trialDurationUnitStr, PlanDurationUnit.UNRECOGNIZED); } AddOns = new List <AddOn> (); foreach (NodeWrapper addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List <Discount> (); foreach (NodeWrapper discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } }
public DocumentUpload(NodeWrapper node) { Size = node.GetDecimal("size"); Kind = (DocumentUploadKind)CollectionUtil.Find(DocumentUploadKind.ALL, node.GetString("kind"), null); ContentType = node.GetString("content-type"); Id = node.GetString("id"); Name = node.GetString("name"); }
public DocumentUpload(NodeWrapper node) { Size = node.GetDecimal("size"); Kind = node.GetEnum <DocumentUploadKind>("kind"); ContentType = node.GetString("content-type"); Id = node.GetString("id"); Name = node.GetString("name"); }
internal Modification(NodeWrapper node) { Amount = node.GetDecimal("amount"); Id = node.GetString("id"); NeverExpires = node.GetBoolean("never-expires"); NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles"); Quantity = node.GetInteger("quantity"); }
protected internal DisputeTransaction(NodeWrapper node) { Amount = node.GetDecimal("amount"); CreatedAt = node.GetDateTime("created-at"); Id = node.GetString("id"); OrderId = node.GetString("order-id"); PaymentInstrumentSubtype = node.GetString("payment-instrument-subtype"); PurchaseOrderNumber = node.GetString("purchase-order-number"); }
protected internal DisbursementDetails(NodeWrapper node) { SettlementAmount = node.GetDecimal("settlement-amount"); SettlementCurrencyIsoCode = node.GetString("settlement-currency-iso-code"); SettlementCurrencyExchangeRate = node.GetString("settlement-currency-exchange-rate"); FundsHeld = node.GetBoolean("funds-held"); Success = node.GetBoolean("success"); DisbursementDate = node.GetDateTime("disbursement-date"); }
public Dispute(NodeWrapper node) { Amount = node.GetDecimal("amount"); ReceivedDate = node.GetDateTime("received-date"); ReplyByDate = node.GetDateTime("reply-by-date"); Reason = (DisputeReason)CollectionUtil.Find(DisputeReason.ALL, node.GetString("reason"), DisputeReason.GENERAL); Status = (DisputeStatus)CollectionUtil.Find(DisputeStatus.ALL, node.GetString("status"), DisputeStatus.UNRECOGNIZED); CurrencyIsoCode = node.GetString("currency-iso-code"); Id = node.GetString("id"); }
public StatusEvent(NodeWrapper node) { if (node == null) return; Amount = node.GetDecimal("amount"); Status = (TransactionStatus)CollectionUtil.Find(TransactionStatus.ALL, node.GetString("status"), TransactionStatus.UNRECOGNIZED); Timestamp = node.GetDateTime("timestamp"); Source = (TransactionSource)CollectionUtil.Find(TransactionSource.ALL, node.GetString("transaction-source"), TransactionSource.UNRECOGNIZED); User = node.GetString("user"); }
public Dispute(NodeWrapper node) { Amount = node.GetDecimal("amount"); AmountDisputed = node.GetDecimal("amount-disputed"); AmountWon = node.GetDecimal("amount-won"); CreatedAt = node.GetDateTime("created-at"); DateOpened = node.GetDateTime("date-opened"); DateWon = node.GetDateTime("date-won"); ReceivedDate = node.GetDateTime("received-date"); ReplyByDate = node.GetDateTime("reply-by-date"); UpdatedAt = node.GetDateTime("updated-at"); Reason = (DisputeReason)CollectionUtil.Find(DisputeReason.ALL, node.GetString("reason"), DisputeReason.GENERAL); Status = (DisputeStatus)CollectionUtil.Find(DisputeStatus.ALL, node.GetString("status"), DisputeStatus.UNRECOGNIZED); Kind = (DisputeKind)CollectionUtil.Find(DisputeKind.ALL, node.GetString("kind"), DisputeKind.UNRECOGNIZED); CaseNumber = node.GetString("case-number"); CurrencyIsoCode = node.GetString("currency-iso-code"); Id = node.GetString("id"); ForwardedComments = node.GetString("forwarded-comments"); MerchantAccountId = node.GetString("merchant-account-id"); OriginalDisputeId = node.GetString("original-dispute-id"); ReasonCode = node.GetString("reason-code"); ReasonDescription = node.GetString("reason-description"); ReferenceNumber = node.GetString("reference-number"); if (node.GetNode("transaction") != null) { TransactionDetails = new TransactionDetails(node.GetNode("transaction")); Transaction = new DisputeTransaction(node.GetNode("transaction")); } Evidence = new List <DisputeEvidence>(); foreach (var evidenceResponse in node.GetList("evidence/evidence")) { Evidence.Add(new DisputeEvidence(evidenceResponse)); } StatusHistory = new List <DisputeStatusHistory>(); foreach (var historyStatusResponse in node.GetList("status-history/status-history")) { StatusHistory.Add(new DisputeStatusHistory(historyStatusResponse)); } }
public AuthorizationAdjustment(NodeWrapper node) { if (node == null) { return; } Amount = node.GetDecimal("amount"); Success = node.GetBoolean("success"); Timestamp = node.GetDateTime("timestamp"); }
protected internal Installment(NodeWrapper node) { Amount = node.GetDecimal("amount"); Id = node.GetString("id"); ProjectedDisbursementDate = node.GetDateTime("projected_disbursement_date"); ActualDisbursementDate = node.GetDateTime("actual_disbursement_date"); Adjustments = new List <Adjustment>(); foreach (var adjustmentNode in node.GetList("adjustments/adjustment")) { Adjustments.Add(new Adjustment(adjustmentNode)); } }
public AuthorizationAdjustment(NodeWrapper node) { if (node == null) { return; } Amount = node.GetDecimal("amount"); Success = node.GetBoolean("success"); Timestamp = node.GetDateTime("timestamp"); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); }
public StatusEvent(NodeWrapper node) { if (node == null) { return; } Amount = node.GetDecimal("amount"); Status = node.GetEnum("status", TransactionStatus.UNRECOGNIZED); Timestamp = node.GetDateTime("timestamp"); Source = node.GetEnum("transaction-source", TransactionSource.UNRECOGNIZED); User = node.GetString("user"); }
public StatusEvent(NodeWrapper node) { if (node == null) { return; } Amount = node.GetDecimal("amount"); Status = (TransactionStatus)CollectionUtil.Find(TransactionStatus.ALL, node.GetString("status"), TransactionStatus.UNRECOGNIZED); Timestamp = node.GetDateTime("timestamp"); Source = (TransactionSource)CollectionUtil.Find(TransactionSource.ALL, node.GetString("transaction-source"), TransactionSource.UNRECOGNIZED); User = node.GetString("user"); }
public AuthorizationAdjustment(NodeWrapper node) { if (node == null) { return; } Amount = node.GetDecimal("amount"); Success = node.GetBoolean("success"); Timestamp = node.GetDateTime("timestamp"); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); ProcessorResponseType = (ProcessorResponseType)CollectionUtil.Find(ProcessorResponseType.ALL, node.GetString("processor-response-type"), ProcessorResponseType.UNRECOGNIZED); }
public Dispute(NodeWrapper node) { Amount = node.GetDecimal("amount"); ReceivedDate = node.GetDateTime("received-date"); ReplyByDate = node.GetDateTime("reply-by-date"); DateOpened = node.GetDateTime("date-opened"); DateWon = node.GetDateTime("date-won"); Reason = (DisputeReason)CollectionUtil.Find(DisputeReason.ALL, node.GetString("reason"), DisputeReason.GENERAL); Status = (DisputeStatus)CollectionUtil.Find(DisputeStatus.ALL, node.GetString("status"), DisputeStatus.UNRECOGNIZED); Kind = (DisputeKind)CollectionUtil.Find(DisputeKind.ALL, node.GetString("kind"), DisputeKind.UNRECOGNIZED); CurrencyIsoCode = node.GetString("currency-iso-code"); Id = node.GetString("id"); TransactionDetails = new TransactionDetails(node.GetNode("transaction")); }
protected Modification(NodeWrapper node) { Amount = node.GetDecimal("amount"); CreatedAt = node.GetDateTime("created-at"); Description = node.GetString("description"); Id = node.GetString("id"); Kind = node.GetString("kind"); MerchantId = node.GetString("merchant-id"); Name = node.GetString("name"); NeverExpires = node.GetBoolean("never-expires"); NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles"); Quantity = node.GetInteger("quantity"); UpdatedAt = node.GetDateTime("updated-at"); }
protected Modification(NodeWrapper node) { Amount = node.GetDecimal("amount"); CreatedAt = node.GetDateTime("created-at"); CurrentBillingCycle = node.GetInteger("current-billing-cycle"); Description = node.GetString("description"); Id = node.GetString("id"); Kind = node.GetString("kind"); MerchantId = node.GetString("merchant-id"); Name = node.GetString("name"); NeverExpires = node.GetBoolean("never-expires"); NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles"); Quantity = node.GetInteger("quantity"); UpdatedAt = node.GetDateTime("updated-at"); }
protected internal IdealPayment(NodeWrapper node) { Id = node.GetString("id"); IdealTransactionId = node.GetString("ideal-transaction-id"); ImageUrl = node.GetString("image-url"); Currency = node.GetString("currency"); Status = node.GetString("status"); Amount = (decimal)node.GetDecimal("amount"); OrderId = node.GetString("order-id"); Issuer = node.GetString("issuer"); ApprovalUrl = node.GetString("approval-url"); if (node.GetNode("iban-bank-account") != null) { IbanBankAccount = new IbanBankAccount(node.GetNode("iban-bank-account")); } }
public Disbursement(NodeWrapper node, BraintreeGateway gateway) { Id = node.GetString("id"); Amount = node.GetDecimal("amount"); ExceptionMessage = node.GetString("exception-message"); DisbursementDate = node.GetDateTime("disbursement-date"); FollowUpAction = node.GetString("follow-up-action"); MerchantAccount = new MerchantAccount(node.GetNode("merchant-account")); TransactionIds = new List<string>(); foreach (var stringNode in node.GetList("transaction-ids/item")) { TransactionIds.Add(stringNode.GetString(".")); } Success = node.GetBoolean("success"); Retry = node.GetBoolean("retry"); this.gateway = gateway; }
public Disbursement(NodeWrapper node, IBraintreeGateway gateway) { Id = node.GetString("id"); Amount = node.GetDecimal("amount"); ExceptionMessage = node.GetString("exception-message"); DisbursementDate = node.GetDateTime("disbursement-date"); FollowUpAction = node.GetString("follow-up-action"); MerchantAccount = new MerchantAccount(node.GetNode("merchant-account")); TransactionIds = new List <string>(); foreach (var stringNode in node.GetList("transaction-ids/item")) { TransactionIds.Add(stringNode.GetString(".")); } Success = node.GetBoolean("success"); Retry = node.GetBoolean("retry"); this.gateway = gateway; }
public CreditCardVerification(NodeWrapper node, IBraintreeGateway gateway) { if (node == null) { return; } Amount = node.GetDecimal("amount"); AvsErrorResponseCode = node.GetString("avs-error-response-code"); AvsPostalCodeResponseCode = node.GetString("avs-postal-code-response-code"); AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code"); CurrencyIsoCode = node.GetString("currency-iso-code"); CvvResponseCode = node.GetString("cvv-response-code"); GatewayRejectionReason = node.GetEnum <TransactionGatewayRejectionReason>("gateway-rejection-reason"); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); ProcessorResponseType = node.GetEnum("processor-response-type", ProcessorResponseType.UNRECOGNIZED); NetworkResponseCode = node.GetString("network-response-code"); NetworkResponseText = node.GetString("network-response-text"); NetworkTransactionId = node.GetString("network-transaction-id"); MerchantAccountId = node.GetString("merchant-account-id"); Status = node.GetEnum("status", VerificationStatus.UNRECOGNIZED); GraphQLId = node.GetString("global-id"); Id = node.GetString("id"); BillingAddress = new Address(node.GetNode("billing")); CreditCard = new CreditCard(node.GetNode("credit-card"), gateway); CreatedAt = node.GetDateTime("created-at"); var riskDataNode = node.GetNode("risk-data"); if (riskDataNode != null) { RiskData = new RiskData(riskDataNode); } var threeDSecureInfoNode = node.GetNode("three-d-secure-info"); if (threeDSecureInfoNode != null && !threeDSecureInfoNode.IsEmpty()) { ThreeDSecureInfo = new ThreeDSecureInfo(threeDSecureInfoNode); } NetworkTransactionId = node.GetString("network-transaction-id"); }
protected internal TransactionLineItem(NodeWrapper node) { Quantity = node.GetDecimal("quantity"); Name = node.GetString("name"); Description = node.GetString("description"); Kind = node.GetEnum("kind", TransactionLineItemKind.UNRECOGNIZED); UnitAmount = node.GetDecimal("unit-amount"); UnitTaxAmount = node.GetDecimal("unit-tax-amount"); TotalAmount = node.GetDecimal("total-amount"); DiscountAmount = node.GetDecimal("discount-amount"); TaxAmount = node.GetDecimal("tax-amount"); UnitOfMeasure = node.GetString("unit-of-measure"); ProductCode = node.GetString("product-code"); CommodityCode = node.GetString("commodity-code"); Url = node.GetString("url"); }
protected internal Transaction(NodeWrapper node, BraintreeGateway gateway) { Gateway = gateway; if (node == null) return; Id = node.GetString("id"); Amount = node.GetDecimal("amount"); AvsErrorResponseCode = node.GetString("avs-error-response-code"); AvsPostalCodeResponseCode = node.GetString("avs-postal-code-response-code"); AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code"); GatewayRejectionReason = (TransactionGatewayRejectionReason)CollectionUtil.Find( TransactionGatewayRejectionReason.ALL, node.GetString("gateway-rejection-reason"), TransactionGatewayRejectionReason.UNRECOGNIZED ); PaymentInstrumentType = (PaymentInstrumentType)CollectionUtil.Find( PaymentInstrumentType.ALL, node.GetString("payment-instrument-type"), PaymentInstrumentType.UNKNOWN ); Channel = node.GetString("channel"); OrderId = node.GetString("order-id"); Status = (TransactionStatus)CollectionUtil.Find(TransactionStatus.ALL, node.GetString("status"), TransactionStatus.UNRECOGNIZED); EscrowStatus = (TransactionEscrowStatus)CollectionUtil.Find( TransactionEscrowStatus.ALL, node.GetString("escrow-status"), TransactionEscrowStatus.UNRECOGNIZED ); List<NodeWrapper> statusNodes = node.GetList("status-history/status-event"); StatusHistory = new StatusEvent[statusNodes.Count]; for (int i = 0; i < statusNodes.Count; i++) { StatusHistory[i] = new StatusEvent(statusNodes[i]); } Type = (TransactionType)CollectionUtil.Find(TransactionType.ALL, node.GetString("type"), TransactionType.UNRECOGNIZED); MerchantAccountId = node.GetString("merchant-account-id"); ProcessorAuthorizationCode = node.GetString("processor-authorization-code"); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); ProcessorSettlementResponseCode = node.GetString("processor-settlement-response-code"); ProcessorSettlementResponseText = node.GetString("processor-settlement-response-text"); AdditionalProcessorResponse = node.GetString("additional-processor-response"); VoiceReferralNumber = node.GetString("voice-referral-number"); PurchaseOrderNumber = node.GetString("purchase-order-number"); Recurring = node.GetBoolean("recurring"); RefundedTransactionId = node.GetString("refunded-transaction-id"); #pragma warning disable 0618 RefundId = node.GetString("refund-id"); #pragma warning restore 0618 RefundIds = node.GetStrings("refund-ids/*"); PartialSettlementTransactionIds = node.GetStrings("partial-settlement-transaction-ids/*"); AuthorizedTransactionId = node.GetString("authorized-transaction-id"); SettlementBatchId = node.GetString("settlement-batch-id"); PlanId = node.GetString("plan-id"); SubscriptionId = node.GetString("subscription-id"); TaxAmount = node.GetDecimal("tax-amount"); TaxExempt = node.GetBoolean("tax-exempt"); CustomFields = node.GetDictionary("custom-fields"); CreditCard = new CreditCard(node.GetNode("credit-card"), gateway); Subscription = new Subscription(node.GetNode("subscription"), gateway); Customer = new Customer(node.GetNode("customer"), gateway); CurrencyIsoCode = node.GetString("currency-iso-code"); CvvResponseCode = node.GetString("cvv-response-code"); Descriptor = new Descriptor(node.GetNode("descriptor")); ServiceFeeAmount = node.GetDecimal("service-fee-amount"); DisbursementDetails = new DisbursementDetails(node.GetNode("disbursement-details")); var paypalNode = node.GetNode("paypal"); if (paypalNode != null) { PayPalDetails = new PayPalDetails(paypalNode); } var coinbaseNode = node.GetNode("coinbase-account"); if (coinbaseNode != null) { CoinbaseDetails = new CoinbaseDetails(coinbaseNode); } var applePayNode = node.GetNode("apple-pay"); if (applePayNode != null) { ApplePayDetails = new ApplePayDetails(applePayNode); } var androidPayNode = node.GetNode("android-pay-card"); if (androidPayNode != null) { AndroidPayDetails = new AndroidPayDetails(androidPayNode); } BillingAddress = new Address(node.GetNode("billing")); ShippingAddress = new Address(node.GetNode("shipping")); CreatedAt = node.GetDateTime("created-at"); UpdatedAt = node.GetDateTime("updated-at"); AddOns = new List<AddOn>(); foreach (var addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List<Discount>(); foreach (var discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } Disputes = new List<Dispute>(); foreach (var dispute in node.GetList("disputes/dispute")) { Disputes.Add(new Dispute(dispute)); } var riskDataNode = node.GetNode("risk-data"); if (riskDataNode != null){ RiskData = new RiskData(riskDataNode); } var threeDSecureInfoNode = node.GetNode("three-d-secure-info"); if (threeDSecureInfoNode != null && !threeDSecureInfoNode.IsEmpty()){ ThreeDSecureInfo = new ThreeDSecureInfo(threeDSecureInfoNode); } }
protected internal Transaction(NodeWrapper node, IBraintreeGateway gateway) { Gateway = gateway; if (node == null) { return; } Id = node.GetString("id"); Amount = node.GetDecimal("amount"); AvsErrorResponseCode = node.GetString("avs-error-response-code"); AvsPostalCodeResponseCode = node.GetString("avs-postal-code-response-code"); AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code"); GatewayRejectionReason = node.GetEnum("gateway-rejection-reason", TransactionGatewayRejectionReason.UNRECOGNIZED); PaymentInstrumentType = node.GetEnum("payment-instrument-type", PaymentInstrumentType.UNKNOWN); Channel = node.GetString("channel"); GraphQLId = node.GetString("global-id"); OrderId = node.GetString("order-id"); Status = node.GetEnum("status", TransactionStatus.UNRECOGNIZED); EscrowStatus = node.GetEnum("escrow-status", TransactionEscrowStatus.UNRECOGNIZED); List <NodeWrapper> statusNodes = node.GetList("status-history/status-event"); StatusHistory = new StatusEvent[statusNodes.Count]; for (int i = 0; i < statusNodes.Count; i++) { StatusHistory[i] = new StatusEvent(statusNodes[i]); } Type = node.GetEnum("type", TransactionType.UNRECOGNIZED); MerchantAccountId = node.GetString("merchant-account-id"); ProcessedWithNetworkToken = node.GetBoolean("processed-with-network-token"); ProcessorAuthorizationCode = node.GetString("processor-authorization-code"); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); ProcessorResponseType = node.GetEnum("processor-response-type", ProcessorResponseType.UNRECOGNIZED); ProcessorSettlementResponseCode = node.GetString("processor-settlement-response-code"); ProcessorSettlementResponseText = node.GetString("processor-settlement-response-text"); NetworkResponseCode = node.GetString("network-response-code"); NetworkResponseText = node.GetString("network-response-text"); AdditionalProcessorResponse = node.GetString("additional-processor-response"); VoiceReferralNumber = node.GetString("voice-referral-number"); PurchaseOrderNumber = node.GetString("purchase-order-number"); Recurring = node.GetBoolean("recurring"); RefundedTransactionId = node.GetString("refunded-transaction-id"); RefundIds = node.GetStrings("refund-ids/*"); PartialSettlementTransactionIds = node.GetStrings("partial-settlement-transaction-ids/*"); AuthorizedTransactionId = node.GetString("authorized-transaction-id"); SettlementBatchId = node.GetString("settlement-batch-id"); PlanId = node.GetString("plan-id"); SubscriptionId = node.GetString("subscription-id"); TaxAmount = node.GetDecimal("tax-amount"); TaxExempt = node.GetBoolean("tax-exempt"); CustomFields = node.GetDictionary("custom-fields"); var creditCardNode = node.GetNode("credit-card"); if (creditCardNode != null) { CreditCard = new CreditCard(creditCardNode, gateway); } var subscriptionNode = node.GetNode("subscription"); if (subscriptionNode != null) { SubscriptionDetails = new SubscriptionDetails(subscriptionNode); } var customerNode = node.GetNode("customer"); if (customerNode != null) { CustomerDetails = new CustomerDetails(customerNode, gateway); } CurrencyIsoCode = node.GetString("currency-iso-code"); CvvResponseCode = node.GetString("cvv-response-code"); var descriptorNode = node.GetNode("descriptor"); if (descriptorNode != null) { Descriptor = new Descriptor(descriptorNode); } ServiceFeeAmount = node.GetDecimal("service-fee-amount"); var disbursementDetailsNode = node.GetNode("disbursement-details"); if (disbursementDetailsNode != null) { DisbursementDetails = new DisbursementDetails(disbursementDetailsNode); } var paypalNode = node.GetNode("paypal"); if (paypalNode != null) { PayPalDetails = new PayPalDetails(paypalNode); } var paypalHereNode = node.GetNode("paypal-here"); if (paypalHereNode != null) { PayPalHereDetails = new PayPalHereDetails(paypalHereNode); } var localPaymentNode = node.GetNode("local-payment"); if (localPaymentNode != null) { LocalPaymentDetails = new LocalPaymentDetails(localPaymentNode); } var applePayNode = node.GetNode("apple-pay"); if (applePayNode != null) { ApplePayDetails = new ApplePayDetails(applePayNode); } var androidPayNode = node.GetNode("android-pay-card"); if (androidPayNode != null) { AndroidPayDetails = new AndroidPayDetails(androidPayNode); } var venmoAccountNode = node.GetNode("venmo-account"); if (venmoAccountNode != null) { VenmoAccountDetails = new VenmoAccountDetails(venmoAccountNode); } var usBankAccountNode = node.GetNode("us-bank-account"); if (usBankAccountNode != null) { UsBankAccountDetails = new UsBankAccountDetails(usBankAccountNode); } var visaCheckoutNode = node.GetNode("visa-checkout-card"); if (visaCheckoutNode != null) { VisaCheckoutCardDetails = new VisaCheckoutCardDetails(visaCheckoutNode); } var samsungPayNode = node.GetNode("samsung-pay-card"); if (samsungPayNode != null) { SamsungPayCardDetails = new SamsungPayCardDetails(samsungPayNode); } var billingAddressNode = node.GetNode("billing"); if (billingAddressNode != null) { BillingAddress = new Address(billingAddressNode); } var shippingAddressNode = node.GetNode("shipping"); if (shippingAddressNode != null) { ShippingAddress = new Address(shippingAddressNode); } CreatedAt = node.GetDateTime("created-at"); UpdatedAt = node.GetDateTime("updated-at"); AddOns = new List <AddOn>(); foreach (var addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List <Discount>(); foreach (var discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } Disputes = new List <Dispute>(); foreach (var dispute in node.GetList("disputes/dispute")) { Disputes.Add(new Dispute(dispute)); } AuthorizationAdjustments = new List <AuthorizationAdjustment>(); foreach (var authorizationAdjustment in node.GetList("authorization-adjustments/authorization-adjustment")) { AuthorizationAdjustments.Add(new AuthorizationAdjustment(authorizationAdjustment)); } var riskDataNode = node.GetNode("risk-data"); if (riskDataNode != null) { RiskData = new RiskData(riskDataNode); } var threeDSecureInfoNode = node.GetNode("three-d-secure-info"); if (threeDSecureInfoNode != null && !threeDSecureInfoNode.IsEmpty()) { ThreeDSecureInfo = new ThreeDSecureInfo(threeDSecureInfoNode); } var facilitatedDetailsNode = node.GetNode("facilitated-details"); if (facilitatedDetailsNode != null && !facilitatedDetailsNode.IsEmpty()) { FacilitatedDetails = new FacilitatedDetails(facilitatedDetailsNode); } var facilitatorDetailsNode = node.GetNode("facilitator-details"); if (facilitatorDetailsNode != null && !facilitatorDetailsNode.IsEmpty()) { FacilitatorDetails = new FacilitatorDetails(facilitatorDetailsNode); } DiscountAmount = node.GetDecimal("discount-amount"); ShippingAmount = node.GetDecimal("shipping-amount"); ShipsFromPostalCode = node.GetString("ships-from-postal-code"); NetworkTransactionId = node.GetString("network-transaction-id"); AuthorizationExpiresAt = node.GetDateTime("authorization-expires-at"); RetrievalReferenceNumber = node.GetString("retrieval-reference-number"); AcquirerReferenceNumber = node.GetString("acquirer-reference-number"); }
internal Transaction(NodeWrapper node, BraintreeService service) { Service = service; if (node == null) return; Id = node.GetString("id"); Amount = node.GetDecimal("amount"); AvsErrorResponseCode = node.GetString("avs-error-response-code"); AvsPostalCodeResponseCode = node.GetString("avs-postal-code-response-code"); AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code"); GatewayRejectionReason = (TransactionGatewayRejectionReason)CollectionUtil.Find( TransactionGatewayRejectionReason.ALL, node.GetString("gateway-rejection-reason"), null ); OrderId = node.GetString("order-id"); Status = (TransactionStatus)CollectionUtil.Find(TransactionStatus.ALL, node.GetString("status"), TransactionStatus.UNRECOGNIZED); List<NodeWrapper> statusNodes = node.GetList("status-history/status-event"); StatusHistory = new StatusEvent[statusNodes.Count]; for (int i = 0; i < statusNodes.Count; i++) { StatusHistory[i] = new StatusEvent(statusNodes[i]); } Type = (TransactionType)CollectionUtil.Find(TransactionType.ALL, node.GetString("type"), TransactionType.UNRECOGNIZED); MerchantAccountId = node.GetString("merchant-account-id"); ProcessorAuthorizationCode = node.GetString("processor-authorization-code"); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); PurchaseOrderNumber = node.GetString("purchase-order-number"); RefundedTransactionId = node.GetString("refunded-transaction-id"); #pragma warning disable 0618 RefundId = node.GetString("refund-id"); #pragma warning restore 0618 RefundIds = node.GetStrings("refund-ids/*"); SettlementBatchId = node.GetString("settlement-batch-id"); SubscriptionId = node.GetString("subscription-id"); TaxAmount = node.GetDecimal("tax-amount"); TaxExempt = node.GetBoolean("tax-exempt"); CustomFields = node.GetDictionary("custom-fields"); CreditCard = new CreditCard(node.GetNode("credit-card"), service); Subscription = new Subscription(node.GetNode("subscription"), service); Customer = new Customer(node.GetNode("customer"), service); CurrencyIsoCode = node.GetString("currency-iso-code"); CvvResponseCode = node.GetString("cvv-response-code"); Descriptor = new Descriptor(node.GetNode("descriptor")); BillingAddress = new Address(node.GetNode("billing")); ShippingAddress = new Address(node.GetNode("shipping")); CreatedAt = node.GetDateTime("created-at"); UpdatedAt = node.GetDateTime("updated-at"); AddOns = new List<AddOn>(); foreach (NodeWrapper addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List<Discount>(); foreach (NodeWrapper discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } }
public Subscription(NodeWrapper node, BraintreeService service) { Balance = node.GetDecimal("balance"); BillingDayOfMonth = node.GetInteger("billing-day-of-month"); BillingPeriodEndDate = node.GetDateTime("billing-period-end-date"); BillingPeriodStartDate = node.GetDateTime("billing-period-start-date"); CurrentBillingCycle = node.GetInteger("current-billing-cycle"); DaysPastDue = node.GetInteger("days-past-due"); Descriptor = new Descriptor(node.GetNode("descriptor")); FailureCount = node.GetInteger("failure-count"); FirstBillingDate = node.GetDateTime("first-billing-date"); Id = node.GetString("id"); NextBillAmount = node.GetDecimal("next-bill-amount"); NextBillingDate = node.GetDateTime("next-billing-date"); NextBillingPeriodAmount = node.GetDecimal("next-billing-period-amount"); NeverExpires = node.GetBoolean("never-expires"); NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles"); PaymentMethodToken = node.GetString("payment-method-token"); PaidThroughDate = node.GetDateTime("paid-through-date"); PlanId = node.GetString("plan-id"); Price = node.GetDecimal("price"); Status = (SubscriptionStatus)CollectionUtil.Find(SubscriptionStatus.STATUSES, node.GetString("status"), SubscriptionStatus.UNRECOGNIZED); HasTrialPeriod = node.GetBoolean("trial-period"); TrialDuration = node.GetInteger("trial-duration"); String trialDurationUnitStr = node.GetString("trial-duration-unit"); if (trialDurationUnitStr != null) { TrialDurationUnit = (SubscriptionDurationUnit)CollectionUtil.Find(SubscriptionDurationUnit.ALL, trialDurationUnitStr, SubscriptionDurationUnit.UNRECOGNIZED); } MerchantAccountId = node.GetString("merchant-account-id"); AddOns = new List<AddOn> (); foreach (NodeWrapper addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List<Discount> (); foreach (NodeWrapper discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } Transactions = new List<Transaction> (); foreach (NodeWrapper transactionResponse in node.GetList("transactions/transaction")) { Transactions.Add(new Transaction(transactionResponse, service)); } }
protected internal Transaction(NodeWrapper node, IBraintreeGateway gateway) { Gateway = gateway; if (node == null) { return; } Id = node.GetString("id"); Amount = node.GetDecimal("amount"); AvsErrorResponseCode = node.GetString("avs-error-response-code"); AvsPostalCodeResponseCode = node.GetString("avs-postal-code-response-code"); AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code"); GatewayRejectionReason = (TransactionGatewayRejectionReason)CollectionUtil.Find( TransactionGatewayRejectionReason.ALL, node.GetString("gateway-rejection-reason"), TransactionGatewayRejectionReason.UNRECOGNIZED ); PaymentInstrumentType = (PaymentInstrumentType)CollectionUtil.Find( PaymentInstrumentType.ALL, node.GetString("payment-instrument-type"), PaymentInstrumentType.UNKNOWN ); Channel = node.GetString("channel"); OrderId = node.GetString("order-id"); Status = (TransactionStatus)CollectionUtil.Find(TransactionStatus.ALL, node.GetString("status"), TransactionStatus.UNRECOGNIZED); EscrowStatus = (TransactionEscrowStatus)CollectionUtil.Find( TransactionEscrowStatus.ALL, node.GetString("escrow-status"), TransactionEscrowStatus.UNRECOGNIZED ); List <NodeWrapper> statusNodes = node.GetList("status-history/status-event"); StatusHistory = new StatusEvent[statusNodes.Count]; for (int i = 0; i < statusNodes.Count; i++) { StatusHistory[i] = new StatusEvent(statusNodes[i]); } Type = (TransactionType)CollectionUtil.Find(TransactionType.ALL, node.GetString("type"), TransactionType.UNRECOGNIZED); MerchantAccountId = node.GetString("merchant-account-id"); ProcessorAuthorizationCode = node.GetString("processor-authorization-code"); ProcessorResponseCode = node.GetString("processor-response-code"); ProcessorResponseText = node.GetString("processor-response-text"); ProcessorSettlementResponseCode = node.GetString("processor-settlement-response-code"); ProcessorSettlementResponseText = node.GetString("processor-settlement-response-text"); AdditionalProcessorResponse = node.GetString("additional-processor-response"); VoiceReferralNumber = node.GetString("voice-referral-number"); PurchaseOrderNumber = node.GetString("purchase-order-number"); Recurring = node.GetBoolean("recurring"); RefundedTransactionId = node.GetString("refunded-transaction-id"); #pragma warning disable 0618 RefundId = node.GetString("refund-id"); #pragma warning restore 0618 RefundIds = node.GetStrings("refund-ids/*"); PartialSettlementTransactionIds = node.GetStrings("partial-settlement-transaction-ids/*"); AuthorizedTransactionId = node.GetString("authorized-transaction-id"); SettlementBatchId = node.GetString("settlement-batch-id"); PlanId = node.GetString("plan-id"); SubscriptionId = node.GetString("subscription-id"); TaxAmount = node.GetDecimal("tax-amount"); TaxExempt = node.GetBoolean("tax-exempt"); CustomFields = node.GetDictionary("custom-fields"); CreditCard = new CreditCard(node.GetNode("credit-card"), gateway); Subscription = new Subscription(node.GetNode("subscription"), gateway); Customer = new Customer(node.GetNode("customer"), gateway); CurrencyIsoCode = node.GetString("currency-iso-code"); CvvResponseCode = node.GetString("cvv-response-code"); Descriptor = new Descriptor(node.GetNode("descriptor")); ServiceFeeAmount = node.GetDecimal("service-fee-amount"); DisbursementDetails = new DisbursementDetails(node.GetNode("disbursement-details")); var paypalNode = node.GetNode("paypal"); if (paypalNode != null) { PayPalDetails = new PayPalDetails(paypalNode); } var coinbaseNode = node.GetNode("coinbase-account"); if (coinbaseNode != null) { CoinbaseDetails = new CoinbaseDetails(coinbaseNode); } var applePayNode = node.GetNode("apple-pay"); if (applePayNode != null) { ApplePayDetails = new ApplePayDetails(applePayNode); } var androidPayNode = node.GetNode("android-pay-card"); if (androidPayNode != null) { AndroidPayDetails = new AndroidPayDetails(androidPayNode); } var amexExpressCheckoutNode = node.GetNode("amex-express-checkout-card"); if (amexExpressCheckoutNode != null) { AmexExpressCheckoutDetails = new AmexExpressCheckoutDetails(amexExpressCheckoutNode); } var venmoAccountNode = node.GetNode("venmo-account"); if (venmoAccountNode != null) { VenmoAccountDetails = new VenmoAccountDetails(venmoAccountNode); } BillingAddress = new Address(node.GetNode("billing")); ShippingAddress = new Address(node.GetNode("shipping")); CreatedAt = node.GetDateTime("created-at"); UpdatedAt = node.GetDateTime("updated-at"); AddOns = new List <AddOn>(); foreach (var addOnResponse in node.GetList("add-ons/add-on")) { AddOns.Add(new AddOn(addOnResponse)); } Discounts = new List <Discount>(); foreach (var discountResponse in node.GetList("discounts/discount")) { Discounts.Add(new Discount(discountResponse)); } Disputes = new List <Dispute>(); foreach (var dispute in node.GetList("disputes/dispute")) { Disputes.Add(new Dispute(dispute)); } var riskDataNode = node.GetNode("risk-data"); if (riskDataNode != null) { RiskData = new RiskData(riskDataNode); } var threeDSecureInfoNode = node.GetNode("three-d-secure-info"); if (threeDSecureInfoNode != null && !threeDSecureInfoNode.IsEmpty()) { ThreeDSecureInfo = new ThreeDSecureInfo(threeDSecureInfoNode); } }