13/10/22 - 21h
parent
c2aa12c07e
commit
4a4ac24135
|
@ -221,8 +221,6 @@ def add_payement_mode(diction):
|
||||||
new_data['iban'] = ""
|
new_data['iban'] = ""
|
||||||
new_data['bic'] = ""
|
new_data['bic'] = ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ("nom_carte" in diction.keys()):
|
if ("nom_carte" in diction.keys()):
|
||||||
if diction['nom_carte']:
|
if diction['nom_carte']:
|
||||||
new_data['nom_carte'] = diction['nom_carte']
|
new_data['nom_carte'] = diction['nom_carte']
|
||||||
|
@ -287,6 +285,7 @@ def add_payement_mode(diction):
|
||||||
new_stripe_card = {}
|
new_stripe_card = {}
|
||||||
new_stripe_card['customerid'] = partner_stripe_account_id
|
new_stripe_card['customerid'] = partner_stripe_account_id
|
||||||
new_stripe_card['number'] = new_data['num_carte']
|
new_stripe_card['number'] = new_data['num_carte']
|
||||||
|
new_stripe_card['name'] = new_data['nom_carte']
|
||||||
new_stripe_card['exp_month'] = str(tmp_tab[0])
|
new_stripe_card['exp_month'] = str(tmp_tab[0])
|
||||||
new_stripe_card['exp_year'] = str(tmp_tab[1])
|
new_stripe_card['exp_year'] = str(tmp_tab[1])
|
||||||
new_stripe_card['cvc'] = new_data['cvv_carte']
|
new_stripe_card['cvc'] = new_data['cvv_carte']
|
||||||
|
|
|
@ -138,10 +138,12 @@ def get_customer_payement_cards(diction):
|
||||||
type="card",
|
type="card",
|
||||||
)
|
)
|
||||||
|
|
||||||
#print(" ### customer_payments = "+str(customer_payments.data))
|
print(" ### customer_payments = "+str(customer_payments.data))
|
||||||
|
|
||||||
RetObject = []
|
RetObject = []
|
||||||
for val in customer_payments.data :
|
for val in customer_payments.data :
|
||||||
my_card = {}
|
my_card = {}
|
||||||
|
my_card['nom_carte'] = str(val.billing_details.name)
|
||||||
my_card['brand'] = str(val.card.brand)
|
my_card['brand'] = str(val.card.brand)
|
||||||
my_card['exp_month'] = str(val.card.exp_month)
|
my_card['exp_month'] = str(val.card.exp_month)
|
||||||
my_card['exp_year'] = str(val.card.exp_year)
|
my_card['exp_year'] = str(val.card.exp_year)
|
||||||
|
@ -167,13 +169,17 @@ Creation d'une carte de payement
|
||||||
def create_update_payment_card(diction):
|
def create_update_payment_card(diction):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
field_list_obligatoire = ['number', 'exp_month', 'exp_year', 'cvc', 'customerid', 'stripe_paymentmethod_id']
|
field_list_obligatoire = ['name', 'number', 'exp_month', 'exp_year', 'cvc', 'customerid', 'stripe_paymentmethod_id']
|
||||||
for val in field_list_obligatoire:
|
for val in field_list_obligatoire:
|
||||||
if val not in diction:
|
if val not in diction:
|
||||||
mycommon.myprint(
|
mycommon.myprint(
|
||||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
||||||
return False, " Impossible de créer el moyen de payement"
|
return False, " Impossible de créer el moyen de payement"
|
||||||
|
|
||||||
|
name = ""
|
||||||
|
if ("name" in diction.keys()):
|
||||||
|
if diction['name']:
|
||||||
|
name = diction['name']
|
||||||
|
|
||||||
number = ""
|
number = ""
|
||||||
if ("number" in diction.keys()):
|
if ("number" in diction.keys()):
|
||||||
|
@ -236,6 +242,9 @@ def create_update_payment_card(diction):
|
||||||
"exp_year": int(exp_year),
|
"exp_year": int(exp_year),
|
||||||
"cvc": cvc,
|
"cvc": cvc,
|
||||||
},
|
},
|
||||||
|
billing_details={
|
||||||
|
"name": str(name)
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
#print(" new_card = "+str(new_card))
|
#print(" new_card = "+str(new_card))
|
||||||
|
|
Loading…
Reference in New Issue