diff --git a/com/alipay/ams/api/model/customer_belongs_to.py b/com/alipay/ams/api/model/customer_belongs_to.py index a761902..2794894 100644 --- a/com/alipay/ams/api/model/customer_belongs_to.py +++ b/com/alipay/ams/api/model/customer_belongs_to.py @@ -3,32 +3,36 @@ class CustomerBelongsTo(Enum): """CustomerBelongsTo枚举类""" - RABBIT_LINE_PAY = "RABBIT_LINE_PAY" - TRUEMONEY = "TRUEMONEY" - ALIPAY_HK = "ALIPAY_HK" - TNG = "TNG" ALIPAY_CN = "ALIPAY_CN" - GCASH = "GCASH" + ALIPAY_HK = "ALIPAY_HK" + MPAY = "MPAY" DANA = "DANA" - KAKAOPAY = "KAKAOPAY" - BKASH = "BKASH" - EASYPAISA = "EASYPAISA" PAYPAY = "PAYPAY" BOOST = "BOOST" + TNG = "TNG" GRABPAY_MY = "GRABPAY_MY" + HIPAY = "HIPAY" + GCASH = "GCASH" MAYA = "MAYA" GRABPAY_PH = "GRABPAY_PH" GRABPAY_SG = "GRABPAY_SG" + KAKAOPAY = "KAKAOPAY" NAVERPAY = "NAVERPAY" - JKOPAY = "JKOPAY" + TOSSPAY = "TOSSPAY" + RABBIT_LINE_PAY = "RABBIT_LINE_PAY" + TRUEMONEY = "TRUEMONEY" KPLUS = "KPLUS" DIRECT_DEBIT_SIAMCOMMERCIALBANK = "DIRECT_DEBIT_SIAMCOMMERCIALBANK" DIRECT_DEBIT_KRUNGTHAIBANK = "DIRECT_DEBIT_KRUNGTHAIBANK" + ACH_DIRECT_DEBIT = "ACH_DIRECT_DEBIT" ZALOPAY = "ZALOPAY" - DIRECTDEBIT_YAPILY = "DIRECTDEBIT_YAPILY" - TOSSPAY = "TOSSPAY" MOMO = "MOMO" - ANTOM_BIZ_ACCOUNT = "ANTOM_BIZ_ACCOUNT" + VIETTELMONEY = "VIETTELMONEY" + JKOPAY = "JKOPAY" + BKASH = "BKASH" + EASYPAISA = "EASYPAISA" + DIRECTDEBIT_YAPILY = "DIRECTDEBIT_YAPILY" + ANTIM_BIZ_ACCOUNT = "ANTIM_BIZ_ACCOUNT" def to_ams_dict(self) -> str: return self.name @@ -38,56 +42,64 @@ def value_of(value): if not value: return None - if CustomerBelongsTo.RABBIT_LINE_PAY.value == value: - return CustomerBelongsTo.RABBIT_LINE_PAY - if CustomerBelongsTo.TRUEMONEY.value == value: - return CustomerBelongsTo.TRUEMONEY - if CustomerBelongsTo.ALIPAY_HK.value == value: - return CustomerBelongsTo.ALIPAY_HK - if CustomerBelongsTo.TNG.value == value: - return CustomerBelongsTo.TNG if CustomerBelongsTo.ALIPAY_CN.value == value: return CustomerBelongsTo.ALIPAY_CN - if CustomerBelongsTo.GCASH.value == value: - return CustomerBelongsTo.GCASH + if CustomerBelongsTo.ALIPAY_HK.value == value: + return CustomerBelongsTo.ALIPAY_HK + if CustomerBelongsTo.MPAY.value == value: + return CustomerBelongsTo.MPAY if CustomerBelongsTo.DANA.value == value: return CustomerBelongsTo.DANA - if CustomerBelongsTo.KAKAOPAY.value == value: - return CustomerBelongsTo.KAKAOPAY - if CustomerBelongsTo.BKASH.value == value: - return CustomerBelongsTo.BKASH - if CustomerBelongsTo.EASYPAISA.value == value: - return CustomerBelongsTo.EASYPAISA if CustomerBelongsTo.PAYPAY.value == value: return CustomerBelongsTo.PAYPAY if CustomerBelongsTo.BOOST.value == value: return CustomerBelongsTo.BOOST + if CustomerBelongsTo.TNG.value == value: + return CustomerBelongsTo.TNG if CustomerBelongsTo.GRABPAY_MY.value == value: return CustomerBelongsTo.GRABPAY_MY + if CustomerBelongsTo.HIPAY.value == value: + return CustomerBelongsTo.HIPAY + if CustomerBelongsTo.GCASH.value == value: + return CustomerBelongsTo.GCASH if CustomerBelongsTo.MAYA.value == value: return CustomerBelongsTo.MAYA if CustomerBelongsTo.GRABPAY_PH.value == value: return CustomerBelongsTo.GRABPAY_PH if CustomerBelongsTo.GRABPAY_SG.value == value: return CustomerBelongsTo.GRABPAY_SG + if CustomerBelongsTo.KAKAOPAY.value == value: + return CustomerBelongsTo.KAKAOPAY if CustomerBelongsTo.NAVERPAY.value == value: return CustomerBelongsTo.NAVERPAY - if CustomerBelongsTo.JKOPAY.value == value: - return CustomerBelongsTo.JKOPAY + if CustomerBelongsTo.TOSSPAY.value == value: + return CustomerBelongsTo.TOSSPAY + if CustomerBelongsTo.RABBIT_LINE_PAY.value == value: + return CustomerBelongsTo.RABBIT_LINE_PAY + if CustomerBelongsTo.TRUEMONEY.value == value: + return CustomerBelongsTo.TRUEMONEY if CustomerBelongsTo.KPLUS.value == value: return CustomerBelongsTo.KPLUS if CustomerBelongsTo.DIRECT_DEBIT_SIAMCOMMERCIALBANK.value == value: return CustomerBelongsTo.DIRECT_DEBIT_SIAMCOMMERCIALBANK if CustomerBelongsTo.DIRECT_DEBIT_KRUNGTHAIBANK.value == value: return CustomerBelongsTo.DIRECT_DEBIT_KRUNGTHAIBANK + if CustomerBelongsTo.ACH_DIRECT_DEBIT.value == value: + return CustomerBelongsTo.ACH_DIRECT_DEBIT if CustomerBelongsTo.ZALOPAY.value == value: return CustomerBelongsTo.ZALOPAY - if CustomerBelongsTo.DIRECTDEBIT_YAPILY.value == value: - return CustomerBelongsTo.DIRECTDEBIT_YAPILY - if CustomerBelongsTo.TOSSPAY.value == value: - return CustomerBelongsTo.TOSSPAY if CustomerBelongsTo.MOMO.value == value: return CustomerBelongsTo.MOMO - if CustomerBelongsTo.ANTOM_BIZ_ACCOUNT.value == value: - return CustomerBelongsTo.ANTOM_BIZ_ACCOUNT + if CustomerBelongsTo.VIETTELMONEY.value == value: + return CustomerBelongsTo.VIETTELMONEY + if CustomerBelongsTo.JKOPAY.value == value: + return CustomerBelongsTo.JKOPAY + if CustomerBelongsTo.BKASH.value == value: + return CustomerBelongsTo.BKASH + if CustomerBelongsTo.EASYPAISA.value == value: + return CustomerBelongsTo.EASYPAISA + if CustomerBelongsTo.DIRECTDEBIT_YAPILY.value == value: + return CustomerBelongsTo.DIRECTDEBIT_YAPILY + if CustomerBelongsTo.ANTIM_BIZ_ACCOUNT.value == value: + return CustomerBelongsTo.ANTIM_BIZ_ACCOUNT return None diff --git a/com/alipay/ams/api/model/payment_method_category_type.py b/com/alipay/ams/api/model/payment_method_category_type.py index 52337c8..7263682 100644 --- a/com/alipay/ams/api/model/payment_method_category_type.py +++ b/com/alipay/ams/api/model/payment_method_category_type.py @@ -10,6 +10,7 @@ class PaymentMethodCategoryType(Enum): ONLINE_BANKING = "ONLINE_BANKING" CARD = "CARD" OTC = "OTC" + VA = "VA" def to_ams_dict(self) -> str: return self.name @@ -33,4 +34,6 @@ def value_of(value): return PaymentMethodCategoryType.CARD if PaymentMethodCategoryType.OTC.value == value: return PaymentMethodCategoryType.OTC + if PaymentMethodCategoryType.VA.value == value: + return PaymentMethodCategoryType.VA return None diff --git a/com/alipay/ams/api/model/payment_result_info.py b/com/alipay/ams/api/model/payment_result_info.py index fb22100..245ec51 100644 --- a/com/alipay/ams/api/model/payment_result_info.py +++ b/com/alipay/ams/api/model/payment_result_info.py @@ -36,6 +36,7 @@ def __init__(self): self.__credential_type_used = None # type: str self.__rrn = None # type: str self.__user_authorization_status = None # type: str + self.__authorization_code = None # type: str @property @@ -231,7 +232,7 @@ def last_four(self, value): @property def expiry_month(self): """ - The month the card expires. Pass in two digits representing the month. For example, if the expiry month is February, the value of this parameter is 02. Note: This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD for specific merchants in specific regions. More information: Maximum length: 2 characters + The month the card expires. Pass in two digits representing the month. For example, if the expiry month is February, the value of this parameter is 02. Note: This parameter is returned when the value of paymentMethodType in the pay (One-time Payments) API is CARD. """ return self.__expiry_month @@ -241,7 +242,7 @@ def expiry_month(self, value): @property def expiry_year(self): """ - The year the card expires. Pass in the last two digits of the year number. For example, if the expiry year is 2025, the value of this parameter is 25. Note: This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD for specific merchants in specific regions. More information: Maximum length: 2 characters + The year the card expires. Pass in the last two digits of the year number. For example, if the expiry year is 2025, the value of this parameter is 25. Note: This parameter is returned when the value of paymentMethodType in the pay (One-time Payments) API is CARD. """ return self.__expiry_year @@ -308,6 +309,16 @@ def user_authorization_status(self): @user_authorization_status.setter def user_authorization_status(self, value): self.__user_authorization_status = value + @property + def authorization_code(self): + """ + The authorization code returned by the payment channel upon successful authorization. + """ + return self.__authorization_code + + @authorization_code.setter + def authorization_code(self, value): + self.__authorization_code = value @@ -368,6 +379,8 @@ def to_ams_dict(self): params['rrn'] = self.rrn if hasattr(self, "user_authorization_status") and self.user_authorization_status is not None: params['userAuthorizationStatus'] = self.user_authorization_status + if hasattr(self, "authorization_code") and self.authorization_code is not None: + params['authorizationCode'] = self.authorization_code return params @@ -431,3 +444,5 @@ def parse_rsp_body(self, response_body): self.__rrn = response_body['rrn'] if 'userAuthorizationStatus' in response_body: self.__user_authorization_status = response_body['userAuthorizationStatus'] + if 'authorizationCode' in response_body: + self.__authorization_code = response_body['authorizationCode'] diff --git a/com/alipay/ams/api/model/subscription_info.py b/com/alipay/ams/api/model/subscription_info.py index cfc3e8b..a6423fd 100644 --- a/com/alipay/ams/api/model/subscription_info.py +++ b/com/alipay/ams/api/model/subscription_info.py @@ -1,5 +1,10 @@ import json +from com.alipay.ams.api.model.subscription_status import SubscriptionStatus +from com.alipay.ams.api.model.period_type import PeriodType from com.alipay.ams.api.model.period_rule import PeriodRule +from com.alipay.ams.api.model.payment_method import PaymentMethod +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.trial_plan import TrialPlan from com.alipay.ams.api.model.trial import Trial from com.alipay.ams.api.model.amount import Amount @@ -9,10 +14,23 @@ class SubscriptionInfo: def __init__(self): + self.__subscription_id = None # type: str + self.__description = None # type: str self.__subscription_description = None # type: str + self.__status = None # type: SubscriptionStatus self.__subscription_start_time = None # type: str self.__subscription_end_time = None # type: str + self.__period_type = None # type: PeriodType + self.__period_count = None # type: int self.__period_rule = None # type: PeriodRule + self.__current_period_start = None # type: str + self.__current_period_end = None # type: str + self.__current_phase_no = None # type: int + self.__payment_method = None # type: PaymentMethod + self.__payment_amount = None # type: Amount + self.__last_update_time = None # type: str + self.__related_subscription_id = None # type: str + self.__trial_plan = None # type: TrialPlan self.__trials = None # type: [Trial] self.__subscription_notify_url = None # type: str self.__subscription_expiry_time = None # type: str @@ -20,6 +38,26 @@ def __init__(self): self.__max_amount_floor = None # type: Amount + @property + def subscription_id(self): + """ + The unique ID assigned by Antom to identify a subscription. + """ + return self.__subscription_id + + @subscription_id.setter + def subscription_id(self, value): + self.__subscription_id = value + @property + def description(self): + """ + The description of the subscription, used for displaying user consumption records and other actions. + """ + return self.__description + + @description.setter + def description(self, value): + self.__description = value @property def subscription_description(self): """ @@ -31,9 +69,19 @@ def subscription_description(self): def subscription_description(self, value): self.__subscription_description = value @property + def status(self): + """Gets the status of this SubscriptionInfo. + + """ + return self.__status + + @status.setter + def status(self, value): + self.__status = value + @property def subscription_start_time(self): """ - Start time of the subscription in ISO 8601 format + The date and time when the subscription becomes active. The value follows the ISO 8601 standard format. """ return self.__subscription_start_time @@ -43,7 +91,7 @@ def subscription_start_time(self, value): @property def subscription_end_time(self): """ - End time of the subscription in ISO 8601 format + The date and time when the subscription ends. The value follows the ISO 8601 standard format. The subscriptionEndTime can be NULL. """ return self.__subscription_end_time @@ -51,6 +99,26 @@ def subscription_end_time(self): def subscription_end_time(self, value): self.__subscription_end_time = value @property + def period_type(self): + """Gets the period_type of this SubscriptionInfo. + + """ + return self.__period_type + + @period_type.setter + def period_type(self, value): + self.__period_type = value + @property + def period_count(self): + """ + The number of times the period type repeats in one subscription cycle. For example, a periodCount of 2 with periodType MONTH means the subscription period is 2 months. + """ + return self.__period_count + + @period_count.setter + def period_count(self, value): + self.__period_count = value + @property def period_rule(self): """Gets the period_rule of this SubscriptionInfo. @@ -61,6 +129,86 @@ def period_rule(self): def period_rule(self, value): self.__period_rule = value @property + def current_period_start(self): + """ + Start time of current period. + """ + return self.__current_period_start + + @current_period_start.setter + def current_period_start(self, value): + self.__current_period_start = value + @property + def current_period_end(self): + """ + End time of current period. + """ + return self.__current_period_end + + @current_period_end.setter + def current_period_end(self, value): + self.__current_period_end = value + @property + def current_phase_no(self): + """ + Indicates current phase of subscription period, start from 1. + """ + return self.__current_phase_no + + @current_phase_no.setter + def current_phase_no(self, value): + self.__current_phase_no = value + @property + def payment_method(self): + """Gets the payment_method of this SubscriptionInfo. + + """ + return self.__payment_method + + @payment_method.setter + def payment_method(self, value): + self.__payment_method = value + @property + def payment_amount(self): + """Gets the payment_amount of this SubscriptionInfo. + + """ + return self.__payment_amount + + @payment_amount.setter + def payment_amount(self, value): + self.__payment_amount = value + @property + def last_update_time(self): + """ + DateTime when the subscription is changed using the Change/Update API. + """ + return self.__last_update_time + + @last_update_time.setter + def last_update_time(self, value): + self.__last_update_time = value + @property + def related_subscription_id(self): + """ + When merchants use Change API, a new subscription is created base on the current one. This field stores the ID of the original subscription and represents the relationship between the old and new subscription. + """ + return self.__related_subscription_id + + @related_subscription_id.setter + def related_subscription_id(self, value): + self.__related_subscription_id = value + @property + def trial_plan(self): + """Gets the trial_plan of this SubscriptionInfo. + + """ + return self.__trial_plan + + @trial_plan.setter + def trial_plan(self, value): + self.__trial_plan = value + @property def trials(self): """ List of trial periods for the subscription @@ -93,7 +241,7 @@ def subscription_expiry_time(self, value): @property def allow_retry(self): """ - Field is used only in the PIX recurrence scenario. Whether to allow a retry in the event that a recurring payment fails due to insufficient balance. + Field is used only in the PIX recurrence scenario. Whether to allow a retry in the event that a recurring payment fails due to insufficient balance. """ return self.__allow_retry @@ -116,14 +264,40 @@ def max_amount_floor(self, value): def to_ams_dict(self): params = dict() + if hasattr(self, "subscription_id") and self.subscription_id is not None: + params['subscriptionId'] = self.subscription_id + if hasattr(self, "description") and self.description is not None: + params['description'] = self.description if hasattr(self, "subscription_description") and self.subscription_description is not None: params['subscriptionDescription'] = self.subscription_description + if hasattr(self, "status") and self.status is not None: + params['status'] = self.status if hasattr(self, "subscription_start_time") and self.subscription_start_time is not None: params['subscriptionStartTime'] = self.subscription_start_time if hasattr(self, "subscription_end_time") and self.subscription_end_time is not None: params['subscriptionEndTime'] = self.subscription_end_time + if hasattr(self, "period_type") and self.period_type is not None: + params['periodType'] = self.period_type + if hasattr(self, "period_count") and self.period_count is not None: + params['periodCount'] = self.period_count if hasattr(self, "period_rule") and self.period_rule is not None: params['periodRule'] = self.period_rule + if hasattr(self, "current_period_start") and self.current_period_start is not None: + params['currentPeriodStart'] = self.current_period_start + if hasattr(self, "current_period_end") and self.current_period_end is not None: + params['currentPeriodEnd'] = self.current_period_end + if hasattr(self, "current_phase_no") and self.current_phase_no is not None: + params['currentPhaseNo'] = self.current_phase_no + if hasattr(self, "payment_method") and self.payment_method is not None: + params['paymentMethod'] = self.payment_method + if hasattr(self, "payment_amount") and self.payment_amount is not None: + params['paymentAmount'] = self.payment_amount + if hasattr(self, "last_update_time") and self.last_update_time is not None: + params['lastUpdateTime'] = self.last_update_time + if hasattr(self, "related_subscription_id") and self.related_subscription_id is not None: + params['relatedSubscriptionId'] = self.related_subscription_id + if hasattr(self, "trial_plan") and self.trial_plan is not None: + params['trialPlan'] = self.trial_plan if hasattr(self, "trials") and self.trials is not None: params['trials'] = self.trials if hasattr(self, "subscription_notify_url") and self.subscription_notify_url is not None: @@ -140,19 +314,52 @@ def to_ams_dict(self): def parse_rsp_body(self, response_body): if isinstance(response_body, str): response_body = json.loads(response_body) + if 'subscriptionId' in response_body: + self.__subscription_id = response_body['subscriptionId'] + if 'description' in response_body: + self.__description = response_body['description'] if 'subscriptionDescription' in response_body: self.__subscription_description = response_body['subscriptionDescription'] + if 'status' in response_body: + status_temp = SubscriptionStatus.value_of(response_body['status']) + self.__status = status_temp if 'subscriptionStartTime' in response_body: self.__subscription_start_time = response_body['subscriptionStartTime'] if 'subscriptionEndTime' in response_body: self.__subscription_end_time = response_body['subscriptionEndTime'] + if 'periodType' in response_body: + period_type_temp = PeriodType.value_of(response_body['periodType']) + self.__period_type = period_type_temp + if 'periodCount' in response_body: + self.__period_count = response_body['periodCount'] if 'periodRule' in response_body: self.__period_rule = PeriodRule() self.__period_rule.parse_rsp_body(response_body['periodRule']) + if 'currentPeriodStart' in response_body: + self.__current_period_start = response_body['currentPeriodStart'] + if 'currentPeriodEnd' in response_body: + self.__current_period_end = response_body['currentPeriodEnd'] + if 'currentPhaseNo' in response_body: + self.__current_phase_no = response_body['currentPhaseNo'] + if 'paymentMethod' in response_body: + self.__payment_method = PaymentMethod() + self.__payment_method.parse_rsp_body(response_body['paymentMethod']) + if 'paymentAmount' in response_body: + self.__payment_amount = Amount() + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'lastUpdateTime' in response_body: + self.__last_update_time = response_body['lastUpdateTime'] + if 'relatedSubscriptionId' in response_body: + self.__related_subscription_id = response_body['relatedSubscriptionId'] + if 'trialPlan' in response_body: + self.__trial_plan = TrialPlan() + self.__trial_plan.parse_rsp_body(response_body['trialPlan']) if 'trials' in response_body: self.__trials = [] for item in response_body['trials']: - self.__trials.append(item) + obj = Trial() + obj.parse_rsp_body(item) + self.__trials.append(obj) if 'subscriptionNotifyUrl' in response_body: self.__subscription_notify_url = response_body['subscriptionNotifyUrl'] if 'subscriptionExpiryTime' in response_body: diff --git a/com/alipay/ams/api/model/transfer_from_detail.py b/com/alipay/ams/api/model/transfer_from_detail.py index 0af752d..241beaa 100644 --- a/com/alipay/ams/api/model/transfer_from_detail.py +++ b/com/alipay/ams/api/model/transfer_from_detail.py @@ -1,5 +1,4 @@ import json -from com.alipay.ams.api.model.payment_method import PaymentMethod from com.alipay.ams.api.model.amount import Amount @@ -8,20 +7,9 @@ class TransferFromDetail: def __init__(self): - self.__transfer_from_method = None # type: PaymentMethod self.__transfer_from_amount = None # type: Amount - @property - def transfer_from_method(self): - """Gets the transfer_from_method of this TransferFromDetail. - - """ - return self.__transfer_from_method - - @transfer_from_method.setter - def transfer_from_method(self, value): - self.__transfer_from_method = value @property def transfer_from_amount(self): """Gets the transfer_from_amount of this TransferFromDetail. @@ -38,8 +26,6 @@ def transfer_from_amount(self, value): def to_ams_dict(self): params = dict() - if hasattr(self, "transfer_from_method") and self.transfer_from_method is not None: - params['transferFromMethod'] = self.transfer_from_method if hasattr(self, "transfer_from_amount") and self.transfer_from_amount is not None: params['transferFromAmount'] = self.transfer_from_amount return params @@ -48,9 +34,6 @@ def to_ams_dict(self): def parse_rsp_body(self, response_body): if isinstance(response_body, str): response_body = json.loads(response_body) - if 'transferFromMethod' in response_body: - self.__transfer_from_method = PaymentMethod() - self.__transfer_from_method.parse_rsp_body(response_body['transferFromMethod']) if 'transferFromAmount' in response_body: self.__transfer_from_amount = Amount() self.__transfer_from_amount.parse_rsp_body(response_body['transferFromAmount']) diff --git a/com/alipay/ams/api/model/transfer_to_detail.py b/com/alipay/ams/api/model/transfer_to_detail.py index 4391514..25ac4d8 100644 --- a/com/alipay/ams/api/model/transfer_to_detail.py +++ b/com/alipay/ams/api/model/transfer_to_detail.py @@ -1,7 +1,6 @@ import json from com.alipay.ams.api.model.payment_method import PaymentMethod from com.alipay.ams.api.model.amount import Amount -from com.alipay.ams.api.model.amount import Amount @@ -10,12 +9,10 @@ class TransferToDetail: def __init__(self): self.__transfer_to_method = None # type: PaymentMethod - self.__transfer_to_currency = None # type: str - self.__fee_amount = None # type: Amount - self.__actual_transfer_to_amount = None # type: Amount - self.__purpose_code = None # type: str + self.__transfer_to_amount = None # type: Amount self.__transfer_notify_url = None # type: str self.__transfer_remark = None # type: str + self.__transfer_memo = None # type: str @property @@ -29,49 +26,19 @@ def transfer_to_method(self): def transfer_to_method(self, value): self.__transfer_to_method = value @property - def transfer_to_currency(self): - """ - A 3-character ISO-4217 currency code representing the currency that the beneficiary collects. More information: Maximum length: 3 characters - """ - return self.__transfer_to_currency - - @transfer_to_currency.setter - def transfer_to_currency(self, value): - self.__transfer_to_currency = value - @property - def fee_amount(self): - """Gets the fee_amount of this TransferToDetail. - - """ - return self.__fee_amount - - @fee_amount.setter - def fee_amount(self, value): - self.__fee_amount = value - @property - def actual_transfer_to_amount(self): - """Gets the actual_transfer_to_amount of this TransferToDetail. + def transfer_to_amount(self): + """Gets the transfer_to_amount of this TransferToDetail. """ - return self.__actual_transfer_to_amount + return self.__transfer_to_amount - @actual_transfer_to_amount.setter - def actual_transfer_to_amount(self, value): - self.__actual_transfer_to_amount = value - @property - def purpose_code(self): - """ - Defines the purpose of the transfer. The value of this parameter is fixed to GSD, which means goods bought or sold. More information: Maximum length: 3 characters - """ - return self.__purpose_code - - @purpose_code.setter - def purpose_code(self, value): - self.__purpose_code = value + @transfer_to_amount.setter + def transfer_to_amount(self, value): + self.__transfer_to_amount = value @property def transfer_notify_url(self): """ - If you specify this parameter, Antom will send the transfer result notification to this URL. The URL must be either specified in the request or set in Antom Dashboard. Specify this parameter if you want to receive an asynchronous notification of the transfer result. If this URL is specified in both the request and Antom Dashboard, the value specified in the request takes precedence. More information: Maximum length: 2048 characters + The URL that is used to receive the transfer result notification. """ return self.__transfer_notify_url @@ -81,13 +48,23 @@ def transfer_notify_url(self, value): @property def transfer_remark(self): """ - Remark information for the transfer. Specify this parameter if you want to provide additional remarks or relevant information regarding the payout. More information: Maximum length: 1024 characters + Information provided for bank settlements. """ return self.__transfer_remark @transfer_remark.setter def transfer_remark(self, value): self.__transfer_remark = value + @property + def transfer_memo(self): + """ + The transfer memo that the merchant leaves. + """ + return self.__transfer_memo + + @transfer_memo.setter + def transfer_memo(self, value): + self.__transfer_memo = value @@ -96,18 +73,14 @@ def to_ams_dict(self): params = dict() if hasattr(self, "transfer_to_method") and self.transfer_to_method is not None: params['transferToMethod'] = self.transfer_to_method - if hasattr(self, "transfer_to_currency") and self.transfer_to_currency is not None: - params['transferToCurrency'] = self.transfer_to_currency - if hasattr(self, "fee_amount") and self.fee_amount is not None: - params['feeAmount'] = self.fee_amount - if hasattr(self, "actual_transfer_to_amount") and self.actual_transfer_to_amount is not None: - params['actualTransferToAmount'] = self.actual_transfer_to_amount - if hasattr(self, "purpose_code") and self.purpose_code is not None: - params['purposeCode'] = self.purpose_code + if hasattr(self, "transfer_to_amount") and self.transfer_to_amount is not None: + params['transferToAmount'] = self.transfer_to_amount if hasattr(self, "transfer_notify_url") and self.transfer_notify_url is not None: params['transferNotifyUrl'] = self.transfer_notify_url if hasattr(self, "transfer_remark") and self.transfer_remark is not None: params['transferRemark'] = self.transfer_remark + if hasattr(self, "transfer_memo") and self.transfer_memo is not None: + params['transferMemo'] = self.transfer_memo return params @@ -117,17 +90,12 @@ def parse_rsp_body(self, response_body): if 'transferToMethod' in response_body: self.__transfer_to_method = PaymentMethod() self.__transfer_to_method.parse_rsp_body(response_body['transferToMethod']) - if 'transferToCurrency' in response_body: - self.__transfer_to_currency = response_body['transferToCurrency'] - if 'feeAmount' in response_body: - self.__fee_amount = Amount() - self.__fee_amount.parse_rsp_body(response_body['feeAmount']) - if 'actualTransferToAmount' in response_body: - self.__actual_transfer_to_amount = Amount() - self.__actual_transfer_to_amount.parse_rsp_body(response_body['actualTransferToAmount']) - if 'purposeCode' in response_body: - self.__purpose_code = response_body['purposeCode'] + if 'transferToAmount' in response_body: + self.__transfer_to_amount = Amount() + self.__transfer_to_amount.parse_rsp_body(response_body['transferToAmount']) if 'transferNotifyUrl' in response_body: self.__transfer_notify_url = response_body['transferNotifyUrl'] if 'transferRemark' in response_body: self.__transfer_remark = response_body['transferRemark'] + if 'transferMemo' in response_body: + self.__transfer_memo = response_body['transferMemo'] diff --git a/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py b/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py index e91d070..56e24b3 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py @@ -8,7 +8,7 @@ class AlipayCreateTransferRequest(AlipayRequest): def __init__(self): - super(AlipayCreateTransferRequest, self).__init__("/ams/api/v1/funds/createTransfer") + super(AlipayCreateTransferRequest, self).__init__("/ams/api/v1/aba/funds/createTransfer") self.__transfer_request_id = None # type: str self.__transfer_from_detail = None # type: TransferFromDetail @@ -18,7 +18,7 @@ def __init__(self): @property def transfer_request_id(self): """ - The unique ID assigned by the marketplace to identify a transfer request. More information: This field is an API idempotency field.For requests that are initiated with the same value of transferRequestId and reach a final status (S or F), the same result is to be returned for the request. Maximum length: 64 characters + The unique ID assigned by the merchant to identify a transfer request. This field is an API idempotency field. """ return self.__transfer_request_id diff --git a/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py b/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py index 126a9aa..defc771 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py @@ -1,7 +1,7 @@ import json from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.model.transfer_from_detail import TransferFromDetail -from com.alipay.ams.api.model.transfer_to_detail import TransferToDetail +from com.alipay.ams.api.model.transfer_from_detail_response import TransferFromDetailResponse +from com.alipay.ams.api.model.transfer_to_detail_response import TransferToDetailResponse @@ -12,10 +12,10 @@ def __init__(self, rsp_body): super(AlipayResponse, self).__init__() self.__result = None # type: Result - self.__transfer_id = None # type: str self.__transfer_request_id = None # type: str - self.__transfer_from_detail = None # type: TransferFromDetail - self.__transfer_to_detail = None # type: TransferToDetail + self.__transfer_id = None # type: str + self.__transfer_from_detail = None # type: TransferFromDetailResponse + self.__transfer_to_detail = None # type: TransferToDetailResponse self.parse_rsp_body(rsp_body) @@ -30,19 +30,9 @@ def result(self): def result(self, value): self.__result = value @property - def transfer_id(self): - """ - The unique ID assigned by Antom to identify a transfer. This parameter is returned when the value of result.resultStatus is U. More information: Maximum length: 64 characters - """ - return self.__transfer_id - - @transfer_id.setter - def transfer_id(self, value): - self.__transfer_id = value - @property def transfer_request_id(self): """ - The unique ID assigned by the marketplace to identify a transfer request. This parameter is returned when the value of result.resultStatus is U. More information: Maximum length: 64 characters + The unique ID assigned by the merchant to identify a transfer request. Note: This field is returned on demand only when the value of result.resultStatus is S. """ return self.__transfer_request_id @@ -50,6 +40,16 @@ def transfer_request_id(self): def transfer_request_id(self, value): self.__transfer_request_id = value @property + def transfer_id(self): + """ + The unique ID assigned by Antom to identify a transfer. Note: This field is returned on demand only when the value of result.resultStatus is S. + """ + return self.__transfer_id + + @transfer_id.setter + def transfer_id(self, value): + self.__transfer_id = value + @property def transfer_from_detail(self): """Gets the transfer_from_detail of this AlipayCreateTransferResponse. @@ -77,10 +77,10 @@ def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: params['result'] = self.result - if hasattr(self, "transfer_id") and self.transfer_id is not None: - params['transferId'] = self.transfer_id if hasattr(self, "transfer_request_id") and self.transfer_request_id is not None: params['transferRequestId'] = self.transfer_request_id + if hasattr(self, "transfer_id") and self.transfer_id is not None: + params['transferId'] = self.transfer_id if hasattr(self, "transfer_from_detail") and self.transfer_from_detail is not None: params['transferFromDetail'] = self.transfer_from_detail if hasattr(self, "transfer_to_detail") and self.transfer_to_detail is not None: @@ -93,13 +93,13 @@ def parse_rsp_body(self, response_body): if 'result' in response_body: self.__result = Result() self.__result.parse_rsp_body(response_body['result']) - if 'transferId' in response_body: - self.__transfer_id = response_body['transferId'] if 'transferRequestId' in response_body: self.__transfer_request_id = response_body['transferRequestId'] + if 'transferId' in response_body: + self.__transfer_id = response_body['transferId'] if 'transferFromDetail' in response_body: - self.__transfer_from_detail = TransferFromDetail() + self.__transfer_from_detail = TransferFromDetailResponse() self.__transfer_from_detail.parse_rsp_body(response_body['transferFromDetail']) if 'transferToDetail' in response_body: - self.__transfer_to_detail = TransferToDetail() + self.__transfer_to_detail = TransferToDetailResponse() self.__transfer_to_detail.parse_rsp_body(response_body['transferToDetail']) diff --git a/com/alipay/ams/api/response/marketplace/payment_method_response.py b/com/alipay/ams/api/response/marketplace/payment_method_response.py new file mode 100644 index 0000000..6e5de3d --- /dev/null +++ b/com/alipay/ams/api/response/marketplace/payment_method_response.py @@ -0,0 +1,54 @@ +import json + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class PaymentMethodResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__payment_method_type = None # type: str + self.__customer_id = None # type: str + self.parse_rsp_body(rsp_body) + + + @property + def payment_method_type(self): + """ + The payment method type that is included in payment method options. The value is fixed as: - ANTOM_BIZ_ACCOUNT: Use Antom Biz Account to send or receive funds. + """ + return self.__payment_method_type + + @payment_method_type.setter + def payment_method_type(self, value): + self.__payment_method_type = value + @property + def customer_id(self): + """ + The unique ID to identify a customer. + """ + return self.__customer_id + + @customer_id.setter + def customer_id(self, value): + self.__customer_id = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type + if hasattr(self, "customer_id") and self.customer_id is not None: + params['customerId'] = self.customer_id + return params + + + def parse_rsp_body(self, response_body): + response_body = super(PaymentMethodResponse, self).parse_rsp_body(response_body) + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'customerId' in response_body: + self.__customer_id = response_body['customerId'] diff --git a/com/alipay/ams/api/response/marketplace/transfer_from_detail_response.py b/com/alipay/ams/api/response/marketplace/transfer_from_detail_response.py new file mode 100644 index 0000000..57e5eff --- /dev/null +++ b/com/alipay/ams/api/response/marketplace/transfer_from_detail_response.py @@ -0,0 +1,75 @@ +import json +from com.alipay.ams.api.model.payment_method_response import PaymentMethodResponse +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.amount import Amount + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class TransferFromDetailResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__transfer_from_method = None # type: PaymentMethodResponse + self.__transfer_from_amount = None # type: Amount + self.__fee_amount = None # type: Amount + self.parse_rsp_body(rsp_body) + + + @property + def transfer_from_method(self): + """Gets the transfer_from_method of this TransferFromDetailResponse. + + """ + return self.__transfer_from_method + + @transfer_from_method.setter + def transfer_from_method(self, value): + self.__transfer_from_method = value + @property + def transfer_from_amount(self): + """Gets the transfer_from_amount of this TransferFromDetailResponse. + + """ + return self.__transfer_from_amount + + @transfer_from_amount.setter + def transfer_from_amount(self, value): + self.__transfer_from_amount = value + @property + def fee_amount(self): + """Gets the fee_amount of this TransferFromDetailResponse. + + """ + return self.__fee_amount + + @fee_amount.setter + def fee_amount(self, value): + self.__fee_amount = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "transfer_from_method") and self.transfer_from_method is not None: + params['transferFromMethod'] = self.transfer_from_method + if hasattr(self, "transfer_from_amount") and self.transfer_from_amount is not None: + params['transferFromAmount'] = self.transfer_from_amount + if hasattr(self, "fee_amount") and self.fee_amount is not None: + params['feeAmount'] = self.fee_amount + return params + + + def parse_rsp_body(self, response_body): + response_body = super(TransferFromDetailResponse, self).parse_rsp_body(response_body) + if 'transferFromMethod' in response_body: + self.__transfer_from_method = PaymentMethodResponse() + self.__transfer_from_method.parse_rsp_body(response_body['transferFromMethod']) + if 'transferFromAmount' in response_body: + self.__transfer_from_amount = Amount() + self.__transfer_from_amount.parse_rsp_body(response_body['transferFromAmount']) + if 'feeAmount' in response_body: + self.__fee_amount = Amount() + self.__fee_amount.parse_rsp_body(response_body['feeAmount']) diff --git a/com/alipay/ams/api/response/marketplace/transfer_to_detail_response.py b/com/alipay/ams/api/response/marketplace/transfer_to_detail_response.py new file mode 100644 index 0000000..5b74c7a --- /dev/null +++ b/com/alipay/ams/api/response/marketplace/transfer_to_detail_response.py @@ -0,0 +1,75 @@ +import json +from com.alipay.ams.api.model.payment_method import PaymentMethod +from com.alipay.ams.api.model.amount import Amount +from com.alipay.ams.api.model.amount import Amount + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class TransferToDetailResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__transfer_to_method = None # type: PaymentMethod + self.__transfer_to_amount = None # type: Amount + self.__fee_amount = None # type: Amount + self.parse_rsp_body(rsp_body) + + + @property + def transfer_to_method(self): + """Gets the transfer_to_method of this TransferToDetailResponse. + + """ + return self.__transfer_to_method + + @transfer_to_method.setter + def transfer_to_method(self, value): + self.__transfer_to_method = value + @property + def transfer_to_amount(self): + """Gets the transfer_to_amount of this TransferToDetailResponse. + + """ + return self.__transfer_to_amount + + @transfer_to_amount.setter + def transfer_to_amount(self, value): + self.__transfer_to_amount = value + @property + def fee_amount(self): + """Gets the fee_amount of this TransferToDetailResponse. + + """ + return self.__fee_amount + + @fee_amount.setter + def fee_amount(self, value): + self.__fee_amount = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "transfer_to_method") and self.transfer_to_method is not None: + params['transferToMethod'] = self.transfer_to_method + if hasattr(self, "transfer_to_amount") and self.transfer_to_amount is not None: + params['transferToAmount'] = self.transfer_to_amount + if hasattr(self, "fee_amount") and self.fee_amount is not None: + params['feeAmount'] = self.fee_amount + return params + + + def parse_rsp_body(self, response_body): + response_body = super(TransferToDetailResponse, self).parse_rsp_body(response_body) + if 'transferToMethod' in response_body: + self.__transfer_to_method = PaymentMethod() + self.__transfer_to_method.parse_rsp_body(response_body['transferToMethod']) + if 'transferToAmount' in response_body: + self.__transfer_to_amount = Amount() + self.__transfer_to_amount.parse_rsp_body(response_body['transferToAmount']) + if 'feeAmount' in response_body: + self.__fee_amount = Amount() + self.__fee_amount.parse_rsp_body(response_body['feeAmount'])