def createRecurringPaymentsProfile(self, params, direct=False): """ Set direct to True to indicate that this is being called as a directPayment. Returns True PayPal successfully creates the profile otherwise False. """ defaults = {"method": "CreateRecurringPaymentsProfile"} required = [ "profilestartdate", "billingperiod", "billingfrequency", "amt" ] # Direct payments require CC data if direct: required + [ "creditcardtype", "acct", "expdate", "firstname", "lastname" ] else: required + ["token", "payerid"] nvp_obj = self._fetch(params, required, defaults) # Flag if profile_type != ActiveProfile if nvp_obj.flag: raise PayPalFailure(nvp_obj.flag_info, nvp=nvp_obj) payment_profile_created.send(sender=nvp_obj, **params) return nvp_obj
def createRecurringPaymentsProfile(self, params, direct=False): """ Set direct to True to indicate that this is being called as a directPayment. Returns True PayPal successfully creates the profile otherwise False. """ defaults = {"method": "CreateRecurringPaymentsProfile"} required = ["profilestartdate", "billingperiod", "billingfrequency", "amt"] # Direct payments require CC data if direct: required + ["creditcardtype", "acct", "expdate", "firstname", "lastname"] else: required + ["token", "payerid"] nvp_obj = self._fetch(params, required, defaults) # Flag if profile_type != ActiveProfile if nvp_obj.flag: raise PayPalFailure(nvp_obj.flag_info, nvp=nvp_obj) payment_profile_created.send(sender=nvp_obj, **params) return nvp_obj