Ver código fonte

setup upfront amount

pull/2/head
Saurabh 6 anos atrás
pai
commit
ea4968faf3
2 arquivos alterados com 9 adições e 7 exclusões
  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 Ver arquivo

@@ -34,7 +34,8 @@ Example:
"start_date": "2018-08-30", "start_date": "2018-08-30",
"billing_period": "Month" #(Day, Week, SemiMonth, Month, Year), "billing_period": "Month" #(Day, Week, SemiMonth, Month, Year),
"billing_frequency": 1, "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"), "BILLINGPERIOD": subscription_details.get("billing_period"),
"BILLINGFREQUENCY": subscription_details.get("billing_frequency"), "BILLINGFREQUENCY": subscription_details.get("billing_frequency"),
"AMT": data.get("amount"), "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({ params.update({
"PROFILESTARTDATE": datetime.utcfromtimestamp(get_timestamp(starts_at)).isoformat() "PROFILESTARTDATE": datetime.utcfromtimestamp(get_timestamp(starts_at)).isoformat()


+ 3
- 1
payments/payment_gateways/doctype/razorpay_settings/razorpay_settings.py Ver arquivo

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


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


try: try:


Carregando…
Cancelar
Salvar