13/10/22 - 21h

master
ChérifBALDE 2022-10-13 21:53:15 +02:00 committed by cherif
parent c2aa12c07e
commit 4a4ac24135
2 changed files with 12 additions and 4 deletions

View File

@ -221,8 +221,6 @@ def add_payement_mode(diction):
new_data['iban'] = ""
new_data['bic'] = ""
if ("nom_carte" in diction.keys()):
if 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['customerid'] = partner_stripe_account_id
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_year'] = str(tmp_tab[1])
new_stripe_card['cvc'] = new_data['cvv_carte']

View File

@ -138,10 +138,12 @@ def get_customer_payement_cards(diction):
type="card",
)
#print(" ### customer_payments = "+str(customer_payments.data))
print(" ### customer_payments = "+str(customer_payments.data))
RetObject = []
for val in customer_payments.data :
my_card = {}
my_card['nom_carte'] = str(val.billing_details.name)
my_card['brand'] = str(val.card.brand)
my_card['exp_month'] = str(val.card.exp_month)
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):
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:
if val not in diction:
mycommon.myprint(
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
return False, " Impossible de créer el moyen de payement"
name = ""
if ("name" in diction.keys()):
if diction['name']:
name = diction['name']
number = ""
if ("number" in diction.keys()):
@ -236,6 +242,9 @@ def create_update_payment_card(diction):
"exp_year": int(exp_year),
"cvc": cvc,
},
billing_details={
"name": str(name)
},
)
#print(" new_card = "+str(new_card))