浏览代码

setup upfront amount

pull/2/head
Saurabh 6 年前
父节点
当前提交
ea4968faf3
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. +6
    -6
      payments/payment_gateways/doctype/paypal_settings/paypal_settings.py
  2. +3
    -1
      payments/payment_gateways/doctype/razorpay_settings/razorpay_settings.py

+ 6
- 6
payments/payment_gateways/doctype/paypal_settings/paypal_settings.py 查看文件

@@ -34,7 +34,8 @@ Example:
"start_date": "2018-08-30",
"billing_period": "Month" #(Day, Week, SemiMonth, Month, Year),
"billing_frequency": 1,
"customer_notify": 1
"customer_notify": 1,
"upfront_amount": 1000
}
}

@@ -296,13 +297,12 @@ def create_recurring_profile(token, payerid):
"BILLINGPERIOD": subscription_details.get("billing_period"),
"BILLINGFREQUENCY": subscription_details.get("billing_frequency"),
"AMT": data.get("amount"),
"CURRENCYCODE": data.get("currency").upper()
"CURRENCYCODE": data.get("currency").upper(),
"INITAMT": subscription_details.get("upfront_amount")
})

if subscription_details.get("start_date"):
starts_at = subscription_details.get("start_date")
else:
starts_at = frappe.utils.now()
starts_at = subscription_details.get("start_date") if subscription_details.get("start_date")\
else frappe.utils.now()

params.update({
"PROFILESTARTDATE": datetime.utcfromtimestamp(get_timestamp(starts_at)).isoformat()


+ 3
- 1
payments/payment_gateways/doctype/razorpay_settings/razorpay_settings.py 查看文件

@@ -34,7 +34,8 @@ Example:
"start_date": "2018-08-30",
"billing_period": "Month" #(Day, Week, Month, Year),
"billing_frequency": 1,
"customer_notify": 1
"customer_notify": 1,
"upfront_amount": 1000
}
}

@@ -132,6 +133,7 @@ class RazorpaySettings(Document):
"start_at": cint(start_date),
"total_count": kwargs.get('subscription_details').get("billing_frequency"),
"customer_notify": kwargs.get('subscription_details').get("customer_notify"),
"upfront_amount": kwargs.get('subscription_details').get("upfront_amount")
}

try:


正在加载...
取消
保存