def __init__(self, gateway, attributes): if "next_bill_amount" in attributes.keys(): self._next_bill_amount = Decimal(attributes["next_bill_amount"]) del (attributes["next_bill_amount"]) Resource.__init__(self, gateway, attributes) if "price" in attributes: self.price = Decimal(self.price) if "balance" in attributes: self.balance = Decimal(self.balance) if "next_billing_period_amount" in attributes: self.next_billing_period_amount = Decimal( self.next_billing_period_amount) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "discounts" in attributes: self.discounts = [ Discount(gateway, discount) for discount in self.discounts ] if "transactions" in attributes: self.transactions = [ Transaction(gateway, transaction) for transaction in self.transactions ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "three_d_secure_info" in attributes and not attributes["three_d_secure_info"] == None: self.three_d_secure_info = ThreeDSecureInfo(attributes["three_d_secure_info"]) else: self.three_d_secure_info = None
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "api_error_response" in attributes["subject"]: node_wrapper = attributes["subject"]["api_error_response"] else: node_wrapper = attributes["subject"] if "subscription" in node_wrapper: self.subscription = Subscription(gateway, node_wrapper['subscription']) elif "merchant_account" in node_wrapper: self.merchant_account = MerchantAccount( gateway, node_wrapper['merchant_account']) elif "transaction" in node_wrapper: self.transaction = Transaction(gateway, node_wrapper['transaction']) elif "partner_merchant" in node_wrapper: self.partner_merchant = PartnerMerchant( gateway, node_wrapper['partner_merchant']) elif "disbursement" in node_wrapper: self.disbursement = Disbursement(gateway, node_wrapper['disbursement']) if "errors" in node_wrapper: self.errors = ValidationErrorCollection(node_wrapper['errors']) self.message = node_wrapper['message']
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.payment_methods = [] if "credit_cards" in attributes: self.credit_cards = [CreditCard(gateway, credit_card) for credit_card in self.credit_cards] self.payment_methods += self.credit_cards if "addresses" in attributes: self.addresses = [Address(gateway, address) for address in self.addresses] if "paypal_accounts" in attributes: self.paypal_accounts = [PayPalAccount(gateway, paypal_account) for paypal_account in self.paypal_accounts] self.payment_methods += self.paypal_accounts if "apple_pay_cards" in attributes: self.apple_pay_cards = [ApplePayCard(gateway, apple_pay_card) for apple_pay_card in self.apple_pay_cards] self.payment_methods += self.apple_pay_cards if "android_pay_cards" in attributes: self.android_pay_cards = [AndroidPayCard(gateway, android_pay_card) for android_pay_card in self.android_pay_cards] self.payment_methods += self.android_pay_cards if "europe_bank_accounts" in attributes: self.europe_bank_accounts = [EuropeBankAccount(gateway, europe_bank_account) for europe_bank_account in self.europe_bank_accounts] self.payment_methods += self.europe_bank_accounts if "coinbase_accounts" in attributes: self.coinbase_accounts = [CoinbaseAccount(gateway, coinbase_account) for coinbase_account in self.coinbase_accounts] self.payment_methods += self.coinbase_accounts
def __init__(self, gateway, attributes): if "refund_id" in attributes.keys(): self._refund_id = attributes["refund_id"] del(attributes["refund_id"]) else: self._refund_id = None Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) if self.tax_amount: self.tax_amount = Decimal(self.tax_amount) if "billing" in attributes: self.billing_details = Address(gateway, attributes.pop("billing")) if "credit_card" in attributes: self.credit_card_details = CreditCard(gateway, attributes.pop("credit_card")) if "customer" in attributes: self.customer_details = Customer(gateway, attributes.pop("customer")) if "shipping" in attributes: self.shipping_details = Address(gateway, attributes.pop("shipping")) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts] if "status_history" in attributes: self.status_history = [StatusEvent(gateway, status_event) for status_event in self.status_history] if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor"))
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.individual_details = IndividualDetails(attributes.get("individual", {})) self.business_details = BusinessDetails(attributes.get("business", {})) self.funding_details = FundingDetails(attributes.get("funding", {})) if "master_merchant_account" in attributes: self.master_merchant_account = MerchantAccount(gateway, attributes.pop("master_merchant_account"))
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "price" in attributes: self.price = Decimal(self.price) if "balance" in attributes: self.balance = Decimal(self.balance) if "next_billing_period_amount" in attributes: self.next_billing_period_amount = Decimal( self.next_billing_period_amount) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "description" in attributes: self.description = attributes["description"] if "discounts" in attributes: self.discounts = [ Discount(gateway, discount) for discount in self.discounts ] if "status_history" in attributes: self.status_history = [ SubscriptionStatusEvent(gateway, status_event) for status_event in self.status_history ] if "transactions" in attributes: self.transactions = [ Transaction(gateway, transaction) for transaction in self.transactions ]
def __init__(self, attributes): Resource.__init__(self, attributes) self.is_expired = self.expired if "billing_address" in attributes: self.billing_address = Address(self.billing_address) if "subscriptions" in attributes: self.subscriptions = [braintree.subscription.Subscription(subscription) for subscription in self.subscriptions]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.individual_details = IndividualDetails(attributes.get("individual", {})) self.business_details = BusinessDetails(attributes.get("business", {})) self.funding_details = FundingDetails(attributes.get("funding", {})) if "master_merchant_account" in attributes: self.master_merchant_account = MerchantAccount(gateway, attributes.pop("master_merchant_account"))
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "accepted_at" in attributes: self.accepted_at = datetime.strptime(attributes["accepted_at"], "%Y-%m-%dT%H:%M:%S.%fZ") else: self.accepted_at = None
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if attributes.get('iban_bank_account') is not None: self.iban_bank_account = IbanBankAccount(gateway, self.iban_bank_account) else: self.iban_bank_account = None
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if hasattr(self, 'expired'): self.is_expired = self.expired if "subscriptions" in attributes: self.subscriptions = [braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions]
def __init__(self, attributes): Resource.__init__(self, attributes) self.price = Decimal(self.price) if "transactions" in attributes: self.transactions = [ Transaction(transaction) for transaction in self.transactions ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "three_d_secure_info" in attributes and not attributes["three_d_secure_info"] is None: self.three_d_secure_info = ThreeDSecureInfo(attributes["three_d_secure_info"]) else: self.three_d_secure_info = None
def __init__(self, gateway, attributes): if "refund_id" in attributes.keys(): self._refund_id = attributes["refund_id"] del(attributes["refund_id"]) else: self._refund_id = None Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) if self.tax_amount: self.tax_amount = Decimal(self.tax_amount) if "billing" in attributes: self.billing_details = Address(gateway, attributes.pop("billing")) if "credit_card" in attributes: self.credit_card_details = CreditCard(gateway, attributes.pop("credit_card")) if "customer" in attributes: self.customer_details = Customer(gateway, attributes.pop("customer")) if "shipping" in attributes: self.shipping_details = Address(gateway, attributes.pop("shipping")) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts] if "status_history" in attributes: self.status_history = [StatusEvent(gateway, status_event) for status_event in self.status_history] if "subscription" in attributes: self.subscription_details = SubscriptionDetails(attributes.pop("subscription")) if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor"))
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "api_error_response" in attributes["subject"]: node_wrapper = attributes["subject"]["api_error_response"] else: node_wrapper = attributes["subject"] if "subscription" in node_wrapper: self.subscription = Subscription(gateway, node_wrapper['subscription']) elif "merchant_account" in node_wrapper: self.merchant_account = MerchantAccount(gateway, node_wrapper['merchant_account']) elif "transaction" in node_wrapper: self.transaction = Transaction(gateway, node_wrapper['transaction']) elif "partner_merchant" in node_wrapper: self.partner_merchant = PartnerMerchant(gateway, node_wrapper['partner_merchant']) elif "disbursement" in node_wrapper: self.disbursement = Disbursement(gateway, node_wrapper['disbursement']) elif "dispute" in node_wrapper: self.dispute = Dispute(node_wrapper['dispute']) elif "account_updater_daily_report" in node_wrapper: self.account_updater_daily_report = AccountUpdaterDailyReport(gateway, node_wrapper['account_updater_daily_report']) if "errors" in node_wrapper: self.errors = ValidationErrorCollection(node_wrapper['errors']) self.message = node_wrapper['message']
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "subscriptions" in attributes: self.subscriptions = [ braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "source_merchant_id" not in attributes: self.source_merchant_id = None if "api_error_response" in attributes["subject"]: node_wrapper = attributes["subject"]["api_error_response"] else: node_wrapper = attributes["subject"] if "subscription" in node_wrapper: self.subscription = Subscription(gateway, node_wrapper['subscription']) elif "merchant_account" in node_wrapper: self.merchant_account = MerchantAccount( gateway, node_wrapper['merchant_account']) elif "transaction" in node_wrapper: self.transaction = Transaction(gateway, node_wrapper['transaction']) elif "connected_merchant_status_transitioned" in node_wrapper: self.connected_merchant_status_transitioned = ConnectedMerchantStatusTransitioned( gateway, node_wrapper['connected_merchant_status_transitioned']) elif "connected_merchant_paypal_status_changed" in node_wrapper: self.connected_merchant_paypal_status_changed = ConnectedMerchantPayPalStatusChanged( gateway, node_wrapper['connected_merchant_paypal_status_changed']) elif "partner_merchant" in node_wrapper: self.partner_merchant = PartnerMerchant( gateway, node_wrapper['partner_merchant']) elif "oauth_application_revocation" in node_wrapper: self.oauth_access_revocation = OAuthAccessRevocation( node_wrapper["oauth_application_revocation"]) elif "disbursement" in node_wrapper: self.disbursement = Disbursement(gateway, node_wrapper['disbursement']) elif "dispute" in node_wrapper: self.dispute = Dispute(node_wrapper['dispute']) elif "account_updater_daily_report" in node_wrapper: self.account_updater_daily_report = AccountUpdaterDailyReport( gateway, node_wrapper['account_updater_daily_report']) elif "ideal_payment" in node_wrapper: self.ideal_payment = IdealPayment(gateway, node_wrapper['ideal_payment']) elif "granted_payment_instrument_update" in node_wrapper: self.granted_payment_instrument_update = GrantedPaymentInstrumentUpdate( gateway, node_wrapper["granted_payment_instrument_update"]) elif WebhookNotification.Kind.GrantedPaymentMethodRevoked == attributes[ "kind"]: self.revoked_payment_method_metadata = RevokedPaymentMethodMetadata( gateway, node_wrapper) elif "local_payment" in node_wrapper: self.local_payment_completed = LocalPaymentCompleted( gateway, node_wrapper["local_payment"]) if "errors" in node_wrapper: self.errors = ValidationErrorCollection(node_wrapper['errors']) self.message = node_wrapper['message']
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [ Discount(gateway, discount) for discount in self.discounts ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "merchant_accounts" in attributes: self.merchant_accounts = [ MerchantAccount(gateway, ma) for ma in attributes.get("merchant_accounts") ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "credit_cards" in attributes: self.credit_cards = [CreditCard(gateway, credit_card) for credit_card in self.credit_cards] if "addresses" in attributes: self.addresses = [Address(gateway, address) for address in self.addresses] if "paypal_accounts" in attributes: self.paypal_accounts = [PayPalAccount(gateway, paypal_account) for paypal_account in self.paypal_accounts]
def __init__(self, gateway, attributes): warn("AmexExpressCheckoutCard is deprecated") Resource.__init__(self, gateway, attributes) if "subscriptions" in attributes: self.subscriptions = [ braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if hasattr(self, 'expired'): self.is_expired = self.expired if "subscriptions" in attributes: self.subscriptions = [ braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "billing_address" in attributes: self.billing_address = Address(gateway, self.billing_address) else: self.billing_address = None if "subscriptions" in attributes: self.subscriptions = [braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions]
def __init__(self, gateway, attributes): if "refund_id" in attributes: self._refund_id = attributes["refund_id"] del(attributes["refund_id"]) else: self._refund_id = None Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) if self.tax_amount: self.tax_amount = Decimal(self.tax_amount) if "billing" in attributes: self.billing_details = Address(gateway, attributes.pop("billing")) if "credit_card" in attributes: self.credit_card_details = CreditCard(gateway, attributes.pop("credit_card")) if "paypal" in attributes: self.paypal_details = PayPalAccount(gateway, attributes.pop("paypal")) if "europe_bank_account" in attributes: self.europe_bank_account_details = EuropeBankAccount(gateway, attributes.pop("europe_bank_account")) if "apple_pay" in attributes: self.apple_pay_details = ApplePayCard(gateway, attributes.pop("apple_pay")) if "coinbase_account" in attributes: self.coinbase_details = CoinbaseAccount(gateway, attributes.pop("coinbase_account")) if "android_pay_card" in attributes: self.android_pay_card_details = AndroidPayCard(gateway, attributes.pop("android_pay_card")) if "customer" in attributes: self.customer_details = Customer(gateway, attributes.pop("customer")) if "shipping" in attributes: self.shipping_details = Address(gateway, attributes.pop("shipping")) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts] if "status_history" in attributes: self.status_history = [StatusEvent(gateway, status_event) for status_event in self.status_history] if "subscription" in attributes: self.subscription_details = SubscriptionDetails(attributes.pop("subscription")) if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "disbursement_details" in attributes: self.disbursement_details = DisbursementDetail(attributes.pop("disbursement_details")) if "disputes" in attributes: self.disputes = [Dispute(dispute) for dispute in self.disputes] if "payment_instrument_type" in attributes: self.payment_instrument_type = attributes["payment_instrument_type"] if "risk_data" in attributes: self.risk_data = RiskData(attributes["risk_data"]) else: self.risk_data = None if "three_d_secure_info" in attributes and not attributes["three_d_secure_info"] == None: self.three_d_secure_info = ThreeDSecureInfo(attributes["three_d_secure_info"]) else: self.three_d_secure_info = None
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if attributes.get("ach_mandate") is not None: self.ach_mandate = AchMandate(gateway, self.ach_mandate) else: self.ach_mandate = None if attributes.get("verifications") is not None: self.verifications = [UsBankAccountVerification(gateway, v) for v in self.verifications] else: self.verifications = None
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "credit_cards" in attributes: self.credit_cards = [ CreditCard(gateway, credit_card) for credit_card in self.credit_cards ] if "addresses" in attributes: self.addresses = [ Address(gateway, address) for address in self.addresses ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "three_d_secure_info" in attributes and not attributes["three_d_secure_info"] is None: self.three_d_secure_info = ThreeDSecureInfo(attributes["three_d_secure_info"]) else: self.three_d_secure_info = None if "bin_data" in attributes and not attributes["bin_data"] is None: self.bin_data = BinData(attributes["bin_data"]) else: self.bin_data = None
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "partner_merchant_id" in attributes: self.partner_merchant_id = attributes.pop("partner_merchant_id") if "private_key" in attributes: self.private_key = attributes.pop("private_key") if "public_key" in attributes: self.public_key = attributes.pop("public_key") if "merchant_public_id" in attributes: self.merchant_public_id = attributes.pop("merchant_public_id") if "client_side_encryption_key" in attributes: self.client_side_encryption_key = attributes.pop("client_side_encryption_key")
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.payment_methods = [] if "credit_cards" in attributes: self.credit_cards = [CreditCard(gateway, credit_card) for credit_card in self.credit_cards] self.payment_methods += self.credit_cards if "addresses" in attributes: self.addresses = [Address(gateway, address) for address in self.addresses] if "paypal_accounts" in attributes: self.paypal_accounts = [PayPalAccount(gateway, paypal_account) for paypal_account in self.paypal_accounts] self.payment_methods += self.paypal_accounts if "apple_pay_cards" in attributes: self.apple_pay_cards = [ApplePayCard(gateway, apple_pay_card) for apple_pay_card in self.apple_pay_cards] self.payment_methods += self.apple_pay_cards if "android_pay_cards" in attributes: self.android_pay_cards = [AndroidPayCard(gateway, android_pay_card) for android_pay_card in self.android_pay_cards] self.payment_methods += self.android_pay_cards if "amex_express_checkout_cards" in attributes: self.amex_express_checkout_cards = [AmexExpressCheckoutCard(gateway, amex_express_checkout_card) for amex_express_checkout_card in self.amex_express_checkout_cards] self.payment_methods += self.amex_express_checkout_cards if "europe_bank_accounts" in attributes: self.europe_bank_accounts = [EuropeBankAccount(gateway, europe_bank_account) for europe_bank_account in self.europe_bank_accounts] self.payment_methods += self.europe_bank_accounts if "coinbase_accounts" in attributes: self.coinbase_accounts = [CoinbaseAccount(gateway, coinbase_account) for coinbase_account in self.coinbase_accounts] self.payment_methods += self.coinbase_accounts if "venmo_accounts" in attributes: self.venmo_accounts = [VenmoAccount(gateway, venmo_account) for venmo_account in self.venmo_accounts] self.payment_methods += self.venmo_accounts if "us_bank_accounts" in attributes: self.us_bank_accounts = [UsBankAccount(gateway, us_bank_account) for us_bank_account in self.us_bank_accounts] self.payment_methods += self.us_bank_accounts if "visa_checkout_cards" in attributes: self.visa_checkout_cards = [VisaCheckoutCard(gateway, visa_checkout_card) for visa_checkout_card in self.visa_checkout_cards] self.payment_methods += self.visa_checkout_cards if "masterpass_cards" in attributes: self.masterpass_cards = [MasterpassCard(gateway, masterpass_card) for masterpass_card in self.masterpass_cards] self.payment_methods += self.masterpass_cards if "samsung_pay_cards" in attributes: self.samsung_pay_cards = [SamsungPayCard(gateway, samsung_pay_card) for samsung_pay_card in self.samsung_pay_cards] self.payment_methods += self.samsung_pay_cards
def __init__(self, gateway, attributes): if "refund_id" in attributes: self._refund_id = attributes["refund_id"] del (attributes["refund_id"]) else: self._refund_id = None Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) if self.tax_amount: self.tax_amount = Decimal(self.tax_amount) if "billing" in attributes: self.billing_details = Address(gateway, attributes.pop("billing")) if "credit_card" in attributes: self.credit_card_details = CreditCard( gateway, attributes.pop("credit_card")) if "paypal" in attributes: self.paypal_details = PayPalAccount(gateway, attributes.pop("paypal")) if "sepa_bank_account" in attributes: self.sepa_bank_account_details = SEPABankAccount( gateway, attributes.pop("sepa_bank_account")) if "customer" in attributes: self.customer_details = Customer(gateway, attributes.pop("customer")) if "shipping" in attributes: self.shipping_details = Address(gateway, attributes.pop("shipping")) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [ Discount(gateway, discount) for discount in self.discounts ] if "status_history" in attributes: self.status_history = [ StatusEvent(gateway, status_event) for status_event in self.status_history ] if "subscription" in attributes: self.subscription_details = SubscriptionDetails( attributes.pop("subscription")) if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "disbursement_details" in attributes: self.disbursement_details = DisbursementDetail( attributes.pop("disbursement_details")) if "disputes" in attributes: self.disputes = [Dispute(dispute) for dispute in self.disputes] if "payment_instrument_type" in attributes: self.payment_instrument_type = attributes[ "payment_instrument_type"]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "billing_address" in attributes: self.billing_address = Address(gateway, self.billing_address) else: self.billing_address = None if "subscriptions" in attributes: self.subscriptions = [ braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "partner_merchant_id" in attributes: self.partner_merchant_id = attributes.pop("partner_merchant_id") if "private_key" in attributes: self.private_key = attributes.pop("private_key") if "public_key" in attributes: self.public_key = attributes.pop("public_key") if "merchant_public_id" in attributes: self.merchant_public_id = attributes.pop("merchant_public_id") if "client_side_encryption_key" in attributes: self.client_side_encryption_key = attributes.pop( "client_side_encryption_key")
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.payment_methods = [] if "credit_cards" in attributes: self.credit_cards = [CreditCard(gateway, credit_card) for credit_card in self.credit_cards] self.payment_methods += self.credit_cards if "addresses" in attributes: self.addresses = [Address(gateway, address) for address in self.addresses] if "paypal_accounts" in attributes: self.paypal_accounts = [PayPalAccount(gateway, paypal_account) for paypal_account in self.paypal_accounts] self.payment_methods += self.paypal_accounts if "apple_pay_cards" in attributes: self.apple_pay_cards = [ApplePayCard(gateway, apple_pay_card) for apple_pay_card in self.apple_pay_cards] self.payment_methods += self.apple_pay_cards if "android_pay_cards" in attributes: self.android_pay_cards = [AndroidPayCard(gateway, android_pay_card) for android_pay_card in self.android_pay_cards] self.payment_methods += self.android_pay_cards if "amex_express_checkout_cards" in attributes: self.amex_express_checkout_cards = [AmexExpressCheckoutCard(gateway, amex_express_checkout_card) for amex_express_checkout_card in self.amex_express_checkout_cards] self.payment_methods += self.amex_express_checkout_cards if "europe_bank_accounts" in attributes: self.europe_bank_accounts = [EuropeBankAccount(gateway, europe_bank_account) for europe_bank_account in self.europe_bank_accounts] self.payment_methods += self.europe_bank_accounts if "coinbase_accounts" in attributes: self.coinbase_accounts = [CoinbaseAccount(gateway, coinbase_account) for coinbase_account in self.coinbase_accounts] self.payment_methods += self.coinbase_accounts if "venmo_accounts" in attributes: self.venmo_accounts = [VenmoAccount(gateway, venmo_account) for venmo_account in self.venmo_accounts] self.payment_methods += self.venmo_accounts if "us_bank_accounts" in attributes: self.us_bank_accounts = [UsBankAccount(gateway, us_bank_account) for us_bank_account in self.us_bank_accounts] self.payment_methods += self.us_bank_accounts if "visa_checkout_cards" in attributes: self.visa_checkout_cards = [VisaCheckoutCard(gateway, visa_checkout_card) for visa_checkout_card in self.visa_checkout_cards] self.payment_methods += self.visa_checkout_cards if "masterpass_cards" in attributes: self.masterpass_cards = [MasterpassCard(gateway, masterpass_card) for masterpass_card in self.masterpass_cards] self.payment_methods += self.masterpass_cards
def __init__(self, attributes): if "billing" in attributes: attributes["billing_details"] = Address(attributes.pop("billing")) if "credit_card" in attributes: attributes["credit_card_details"] = CreditCard(attributes.pop("credit_card")) if "customer" in attributes: attributes["customer_details"] = Customer(attributes.pop("customer")) if "shipping" in attributes: attributes["shipping_details"] = Address(attributes.pop("shipping")) Resource.__init__(self, attributes) self.amount = Decimal(self.amount) if "status_history" in attributes: self.status_history = [StatusEvent(status_event) for status_event in self.status_history]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.is_expired = self.expired if "billing_address" in attributes: self.billing_address = Address(gateway, self.billing_address) else: self.billing_address = None if "subscriptions" in attributes: self.subscriptions = [braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions] if "verifications" in attributes: sorted_verifications = sorted(attributes["verifications"], key=lambda verification: verification["created_at"], reverse=True) if len(sorted_verifications) > 0: self.verification = CreditCardVerification(gateway, sorted_verifications[0])
def __init__(self, gateway, attributes): if "next_bill_amount" in attributes.keys(): self._next_bill_amount = Decimal(attributes["next_bill_amount"]) del(attributes["next_bill_amount"]) Resource.__init__(self, gateway, attributes) self.price = Decimal(self.price) self.balance = Decimal(self.balance) self.next_billing_period_amount = Decimal(self.next_billing_period_amount) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts] if "transactions" in attributes: self.transactions = [Transaction(gateway, transaction) for transaction in self.transactions]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "api_error_response" in attributes["subject"]: node_wrapper = attributes["subject"]["api_error_response"] else: node_wrapper = attributes["subject"] if "subscription" in node_wrapper: self.subscription = Subscription(gateway, node_wrapper['subscription']) elif "merchant_account" in node_wrapper: self.merchant_account = MerchantAccount( gateway, node_wrapper['merchant_account']) elif "transaction" in node_wrapper: self.transaction = Transaction(gateway, node_wrapper['transaction']) elif "connected_merchant_status_transitioned" in node_wrapper: self.connected_merchant_status_transitioned = ConnectedMerchantStatusTransitioned( gateway, node_wrapper['connected_merchant_status_transitioned']) elif "connected_merchant_paypal_status_changed" in node_wrapper: self.connected_merchant_paypal_status_changed = ConnectedMerchantPayPalStatusChanged( gateway, node_wrapper['connected_merchant_paypal_status_changed']) elif "partner_merchant" in node_wrapper: self.partner_merchant = PartnerMerchant( gateway, node_wrapper['partner_merchant']) elif "disbursement" in node_wrapper: self.disbursement = Disbursement(gateway, node_wrapper['disbursement']) elif "dispute" in node_wrapper: self.dispute = Dispute(node_wrapper['dispute']) elif "account_updater_daily_report" in node_wrapper: self.account_updater_daily_report = AccountUpdaterDailyReport( gateway, node_wrapper['account_updater_daily_report']) elif "ideal_payment" in node_wrapper: self.ideal_payment = IdealPayment(gateway, node_wrapper['ideal_payment']) elif "granted_payment_instrument_update" in node_wrapper: self.granted_payment_instrument_update = GrantedPaymentInstrumentUpdate( gateway, node_wrapper["granted_payment_instrument_update"]) if "errors" in node_wrapper: self.errors = ValidationErrorCollection(node_wrapper['errors']) self.message = node_wrapper['message']
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "credit_cards" in attributes: self.credit_cards = [ CreditCard(gateway, credit_card) for credit_card in self.credit_cards ] if "addresses" in attributes: self.addresses = [ Address(gateway, address) for address in self.addresses ] if "paypal_accounts" in attributes: self.paypal_accounts = [ PayPalAccount(gateway, paypal_account) for paypal_account in self.paypal_accounts ]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "source_merchant_id" not in attributes: self.source_merchant_id = None if "api_error_response" in attributes["subject"]: node_wrapper = attributes["subject"]["api_error_response"] else: node_wrapper = attributes["subject"] if "subscription" in node_wrapper: self.subscription = Subscription(gateway, node_wrapper['subscription']) elif "merchant_account" in node_wrapper: self.merchant_account = MerchantAccount(gateway, node_wrapper['merchant_account']) elif "transaction" in node_wrapper: self.transaction = Transaction(gateway, node_wrapper['transaction']) elif "connected_merchant_status_transitioned" in node_wrapper: self.connected_merchant_status_transitioned = ConnectedMerchantStatusTransitioned(gateway, node_wrapper['connected_merchant_status_transitioned']) elif "connected_merchant_paypal_status_changed" in node_wrapper: self.connected_merchant_paypal_status_changed = ConnectedMerchantPayPalStatusChanged(gateway, node_wrapper['connected_merchant_paypal_status_changed']) elif "partner_merchant" in node_wrapper: self.partner_merchant = PartnerMerchant(gateway, node_wrapper['partner_merchant']) elif "oauth_application_revocation" in node_wrapper: self.oauth_access_revocation = OAuthAccessRevocation(node_wrapper["oauth_application_revocation"]) elif "disbursement" in node_wrapper: self.disbursement = Disbursement(gateway, node_wrapper['disbursement']) elif "dispute" in node_wrapper: self.dispute = Dispute(node_wrapper['dispute']) elif "account_updater_daily_report" in node_wrapper: self.account_updater_daily_report = AccountUpdaterDailyReport(gateway, node_wrapper['account_updater_daily_report']) # NEXT_MAJOR_VERSION Remove this class as legacy Ideal has been removed/disabled in the Braintree Gateway # DEPRECATED If you're looking to accept iDEAL as a payment method contact [email protected] for a solution. elif "ideal_payment" in node_wrapper: self.ideal_payment = IdealPayment(gateway, node_wrapper['ideal_payment']) elif "granted_payment_instrument_update" in node_wrapper: self.granted_payment_instrument_update = GrantedPaymentInstrumentUpdate(gateway, node_wrapper["granted_payment_instrument_update"]) elif WebhookNotification.Kind.GrantedPaymentMethodRevoked == attributes["kind"]: self.revoked_payment_method_metadata = RevokedPaymentMethodMetadata(gateway, node_wrapper) elif "local_payment" in node_wrapper: self.local_payment_completed = LocalPaymentCompleted(gateway, node_wrapper["local_payment"]) if "errors" in node_wrapper: self.errors = ValidationErrorCollection(node_wrapper['errors']) self.message = node_wrapper['message']
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) if "billing" in attributes: self.billing_details = Address(gateway, attributes.pop("billing")) if "credit_card" in attributes: self.credit_card_details = CreditCard(gateway, attributes.pop("credit_card")) if "customer" in attributes: self.customer_details = Customer(gateway, attributes.pop("customer")) if "shipping" in attributes: self.shipping_details = Address(gateway, attributes.pop("shipping")) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts] if "status_history" in attributes: self.status_history = [StatusEvent(gateway, status_event) for status_event in self.status_history]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "api_error_response" in attributes["subject"]: node_wrapper = attributes["subject"]["api_error_response"] else: node_wrapper = attributes["subject"] if "subscription" in node_wrapper: self.subscription = Subscription(gateway, node_wrapper['subscription']) elif "merchant_account" in node_wrapper: self.merchant_account = MerchantAccount(gateway, node_wrapper['merchant_account']) elif "transaction" in node_wrapper: self.transaction = Transaction(gateway, node_wrapper['transaction']) if "errors" in node_wrapper: self.errors = ValidationErrorCollection(node_wrapper['errors']) self.message = node_wrapper['message']
def __init__(self, gateway, attributes): if "refund_id" in attributes: self._refund_id = attributes["refund_id"] del(attributes["refund_id"]) else: self._refund_id = None Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) if self.tax_amount: self.tax_amount = Decimal(self.tax_amount) if "billing" in attributes: self.billing_details = Address(gateway, attributes.pop("billing")) if "credit_card" in attributes: self.credit_card_details = CreditCard(gateway, attributes.pop("credit_card")) if "paypal" in attributes: self.paypal_details = PayPalAccount(gateway, attributes.pop("paypal")) if "sepa_bank_account" in attributes: self.sepa_bank_account_details = SEPABankAccount(gateway, attributes.pop("sepa_bank_account")) if "apple_pay" in attributes: self.apple_pay_details = ApplePayCard(gateway, attributes.pop("apple_pay")) if "customer" in attributes: self.customer_details = Customer(gateway, attributes.pop("customer")) if "shipping" in attributes: self.shipping_details = Address(gateway, attributes.pop("shipping")) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts] if "status_history" in attributes: self.status_history = [StatusEvent(gateway, status_event) for status_event in self.status_history] if "subscription" in attributes: self.subscription_details = SubscriptionDetails(attributes.pop("subscription")) if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "disbursement_details" in attributes: self.disbursement_details = DisbursementDetail(attributes.pop("disbursement_details")) if "disputes" in attributes: self.disputes = [Dispute(dispute) for dispute in self.disputes] if "payment_instrument_type" in attributes: self.payment_instrument_type = attributes["payment_instrument_type"]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "three_d_secure_info" in attributes and not attributes[ "three_d_secure_info"] is None: self.three_d_secure_info = ThreeDSecureInfo( attributes["three_d_secure_info"]) else: self.three_d_secure_info = None if "authentication_insight" in attributes and not attributes[ "authentication_insight"] is None: self.authentication_insight = attributes["authentication_insight"] else: self.authentication_insight = None if "bin_data" in attributes and not attributes["bin_data"] is None: self.bin_data = BinData(attributes["bin_data"]) else: self.bin_data = None
def __init__(self, attributes): if "billing" in attributes: attributes["billing_details"] = Address(attributes.pop("billing")) if "credit_card" in attributes: attributes["credit_card_details"] = CreditCard( attributes.pop("credit_card")) if "customer" in attributes: attributes["customer_details"] = Customer( attributes.pop("customer")) if "shipping" in attributes: attributes["shipping_details"] = Address( attributes.pop("shipping")) Resource.__init__(self, attributes) self.amount = Decimal(self.amount) if "status_history" in attributes: self.status_history = [ StatusEvent(status_event) for status_event in self.status_history ]
def __init__(self, gateway, attributes): if "next_bill_amount" in attributes: self._next_bill_amount = Decimal(attributes["next_bill_amount"]) del(attributes["next_bill_amount"]) Resource.__init__(self, gateway, attributes) if "price" in attributes: self.price = Decimal(self.price) if "balance" in attributes: self.balance = Decimal(self.balance) if "next_billing_period_amount" in attributes: self.next_billing_period_amount = Decimal(self.next_billing_period_amount) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts] if "status_history" in attributes: self.status_history = [SubscriptionStatusEvent(gateway, status_event) for status_event in self.status_history] if "transactions" in attributes: self.transactions = [Transaction(gateway, transaction) for transaction in self.transactions]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) self.merchant_account = MerchantAccount(gateway, attributes["merchant_account"])
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "subscriptions" in attributes: self.subscriptions = [braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes)
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount) if "tax_amount" in attributes and getattr(self, "tax_amount", None): self.tax_amount = Decimal(self.tax_amount) if "discount_amount" in attributes and getattr(self, "discount_amount", None): self.discount_amount = Decimal(self.discount_amount) if "shipping_amount" in attributes and getattr(self, "shipping_amount", None): self.shipping_amount = Decimal(self.shipping_amount) if "billing" in attributes: self.billing_details = Address(gateway, attributes.pop("billing")) if "credit_card" in attributes: self.credit_card_details = CreditCard( gateway, attributes.pop("credit_card")) if "paypal" in attributes: self.paypal_details = PayPalAccount(gateway, attributes.pop("paypal")) if "paypal_here" in attributes: self.paypal_here_details = PayPalHere( gateway, attributes.pop("paypal_here")) if "local_payment" in attributes: self.local_payment_details = LocalPayment( gateway, attributes.pop("local_payment")) if "europe_bank_account" in attributes: self.europe_bank_account_details = EuropeBankAccount( gateway, attributes.pop("europe_bank_account")) if "us_bank_account" in attributes: self.us_bank_account = UsBankAccount( gateway, attributes.pop("us_bank_account")) if "apple_pay" in attributes: self.apple_pay_details = ApplePayCard(gateway, attributes.pop("apple_pay")) # NEXT_MAJOR_VERSION rename to google_pay_card_details if "android_pay_card" in attributes: self.android_pay_card_details = AndroidPayCard( gateway, attributes.pop("android_pay_card")) # NEXT_MAJOR_VERSION remove amex express checkout if "amex_express_checkout_card" in attributes: self.amex_express_checkout_card_details = AmexExpressCheckoutCard( gateway, attributes.pop("amex_express_checkout_card")) if "venmo_account" in attributes: self.venmo_account_details = VenmoAccount( gateway, attributes.pop("venmo_account")) if "visa_checkout_card" in attributes: self.visa_checkout_card_details = VisaCheckoutCard( gateway, attributes.pop("visa_checkout_card")) # NEXt_MAJOR_VERSION remove masterpass if "masterpass_card" in attributes: self.masterpass_card_details = MasterpassCard( gateway, attributes.pop("masterpass_card")) if "samsung_pay_card" in attributes: self.samsung_pay_card_details = SamsungPayCard( gateway, attributes.pop("samsung_pay_card")) if "customer" in attributes: self.customer_details = Customer(gateway, attributes.pop("customer")) if "shipping" in attributes: self.shipping_details = Address(gateway, attributes.pop("shipping")) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [ Discount(gateway, discount) for discount in self.discounts ] if "status_history" in attributes: self.status_history = [ StatusEvent(gateway, status_event) for status_event in self.status_history ] if "subscription" in attributes: self.subscription_details = SubscriptionDetails( attributes.pop("subscription")) if "descriptor" in attributes: self.descriptor = Descriptor(gateway, attributes.pop("descriptor")) if "disbursement_details" in attributes: self.disbursement_details = DisbursementDetail( attributes.pop("disbursement_details")) if "disputes" in attributes: self.disputes = [Dispute(dispute) for dispute in self.disputes] if "authorization_adjustments" in attributes: self.authorization_adjustments = [ AuthorizationAdjustment(authorization_adjustment) for authorization_adjustment in self.authorization_adjustments ] if "payment_instrument_type" in attributes: self.payment_instrument_type = attributes[ "payment_instrument_type"] if "risk_data" in attributes: self.risk_data = RiskData(attributes["risk_data"]) else: self.risk_data = None if "three_d_secure_info" in attributes and not attributes[ "three_d_secure_info"] is None: self.three_d_secure_info = ThreeDSecureInfo( attributes["three_d_secure_info"]) else: self.three_d_secure_info = None if "facilitated_details" in attributes: self.facilitated_details = FacilitatedDetails( attributes.pop("facilitated_details")) if "facilitator_details" in attributes: self.facilitator_details = FacilitatorDetails( attributes.pop("facilitator_details")) if "network_transaction_id" in attributes: self.network_transaction_id = attributes["network_transaction_id"]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "master_merchant_account" in attributes: self.master_merchant_account = MerchantAccount(gateway, attributes.pop("master_merchant_account"))
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "subscription" in attributes['subject']: self.subscription = Subscription(gateway, attributes['subject']['subscription'])
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "credit_cards" in attributes: self.credit_cards = [CreditCard(gateway, credit_card) for credit_card in self.credit_cards] if "addresses" in attributes: self.addresses = [Address(gateway, address) for address in self.addresses]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "add_ons" in attributes: self.add_ons = [AddOn(gateway, add_on) for add_on in self.add_ons] if "discounts" in attributes: self.discounts = [Discount(gateway, discount) for discount in self.discounts]
def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) self.amount = Decimal(self.amount)