Sessions de paiement
L’API Checkout fournit des endpoints pour créer et gérer des sessions de paiement. Une session peut être créée, récupérée par ID, expirée lorsque nécessaire et supprimée pour le nettoyage.
Créer une session de paiement
Créez une nouvelle session de paiement pour les paiements hébergés.
- Nom
amount- Type
- decimal
- Obligatoire
- obligatoire
- Description
Montant en unités monétaires mineures (centimes)
- Nom
cancel_url- Type
- uri
- Obligatoire
- obligatoire
- Description
URL de redirection si le client annule le paiement
- Nom
success_url- Type
- uri
- Obligatoire
- obligatoire
- Description
URL de redirection après un paiement réussi. Utilisez {CHECKOUT_SESSION_ID} comme variable de remplacement
- Nom
branding_settings- Type
- object | nullable
- Description
Paramètres d’identité visuelle de cette session
- Nom
branding_settings > background_color- Parent
- dans
branding_settings - Type
- string
- Description
Une couleur hexadécimale commençant par
#représentant la couleur d’arrière-plan
- Nom
branding_settings > border_style- Parent
- dans
branding_settings - Type
- enum
- Description
Le style de bordure du widget.
pill- pillrectangular- rectangularrounded- rounded
- Nom
branding_settings > button_color- Parent
- dans
branding_settings - Type
- string
- Description
Une couleur hexadécimale commençant par
#représentant la couleur du bouton du widget de paiement
- Nom
branding_settings > display_name- Parent
- dans
branding_settings - Type
- string
- Description
Une chaîne remplaçant le nom de l’entreprise affiché en haut de la page de paiement. Votre nom habituel reste affiché dans les conditions, les reçus et les autres emplacements.
- Nom
branding_settings > font_family- Parent
- dans
branding_settings - Type
- enum
- Description
La police de la session de paiement, choisie parmi les [polices prises en charge]
be_vietnam_pro- be_vietnam_probitter- bitterchakra_petch- chakra_petchdefault- defaulthahmlet- hahmletinconsolata- inconsolatainter- interlato- latolora- loram_plus_1_code- m_plus_1_codemontserrat- montserratnoto_sans- noto_sansnoto_sans_jp- noto_sans_jpnoto_serif- noto_serifnunito- nunitoopen_sans- open_sanspridi- pridipt_sans- pt_sanspt_serif- pt_serifraleway- ralewayroboto- robotoroboto_slab- roboto_slabsource_sans_pro- source_sans_protitillium_web- titillium_webubuntu_mono- ubuntu_monozen_maru_gothic- zen_maru_gothic
- Nom
call_to_action- Type
- enum
- Valeur par défaut
- Valeur par défaut :pay
- Description
Décrit le type de transaction pour adapter les textes de la page de paiement, notamment le bouton de confirmation.
pay- Payerbook- Réserverdonate- Faire un donauto- Automatiquesubscribe- S’abonner
- Nom
client_reference_id- Type
- string
- Description
Votre identifiant interne de commande ou de transaction pour le rapprochement
- Nom
consent_collection- Type
- object | nullable
- Description
Configurez les champs de la session de paiement pour recueillir le consentement explicite des clients.
- Nom
consent_collection > promotions- Parent
- dans
consent_collection - Type
- enum
- Description
Si la valeur est
auto, active la collecte du consentement des clients aux communications promotionnelles.auto- autonone- none
- Nom
consent_collection > terms_of_service- Parent
- dans
consent_collection - Type
- enum
- Description
Si la valeur est
required, oblige les clients à accepter les conditions générales avant de payer. Une URL valide des conditions générales doit être définie dans les paramètres de l’application.none- nonerequired- required
- Nom
conversion- Type
- boolean
- Description
Indique si MeSomb doit convertir les montants en devise étrangère
- Nom
currency- Type
- string
- Valeur par défaut
- Valeur par défaut :XAF
- Description
Code ISO de devise à trois lettres, par exemple XAF, EUR ou USD
- Nom
custom_fields- Type
- array
- Description
Recueillez des informations supplémentaires avec des champs personnalisés. Jusqu’à trois champs sont pris en charge.
- Nom
custom_fields > label- Parent
- dans
custom_fields - Type
- string
- Obligatoire
- obligatoire
- Description
Libellé du champ de saisie
- Nom
custom_fields > type- Parent
- dans
custom_fields - Type
- enum
- Obligatoire
- obligatoire
- Description
- Nom
custom_fields > limit_max- Parent
- dans
custom_fields - Type
- double
- Description
Valeur maximale autorisée
- Nom
custom_fields > limit_min- Parent
- dans
custom_fields - Type
- double
- Description
Valeur minimale autorisée
- Nom
custom_fields > limit_type- Parent
- dans
custom_fields - Type
- enum
- Description
Type de limite à appliquer à la valeur
max- Au maximummin- Au minimumbetween- Entreequal- Exactement
- Nom
custom_fields > optional- Parent
- dans
custom_fields - Type
- boolean
- Description
Rendre ce champ facultatif
- Nom
custom_fields > set_limit- Parent
- dans
custom_fields - Type
- boolean
- Description
Définir une limite pour la valeur de ce champ
- Nom
custom_text- Type
- object | nullable
- Description
Affichez des textes supplémentaires pour vos clients à l’aide de textes personnalisés.
- Nom
custom_text > after_submit- Parent
- dans
custom_text - Type
- string
- Description
Texte personnalisé affiché après le bouton de confirmation du paiement.
- Nom
custom_text > submit- Parent
- dans
custom_text - Type
- string
- Description
Texte personnalisé affiché à côté du bouton de confirmation du paiement.
- Nom
custom_text > terms_of_service_acceptance- Parent
- dans
custom_text - Type
- string
- Description
Texte personnalisé remplaçant le texte d’acceptation des conditions générales par défaut.
- Nom
customer- Type
- object | nullable
- Description
Informations client facultatives pour préremplir la page de paiement
- Nom
customer > address- Parent
- dans
customer - Type
- undefined
- Description
- Nom
customer > country- Parent
- dans
customer - Type
- string | nullable
- Description
Pays de résidence du client
- Nom
customer > email- Parent
- dans
customer - Type
- email | nullable
- Description
Adresse e-mail du client
- Nom
customer > first_name- Parent
- dans
customer - Type
- string | nullable
- Description
Prénom du client
- Nom
customer > last_name- Parent
- dans
customer - Type
- string | nullable
- Description
Nom de famille du client
- Nom
customer > phone- Parent
- dans
customer - Type
- string | nullable
- Description
Téléphone de contact du client
- Nom
customer > region- Parent
- dans
customer - Type
- string | nullable
- Description
Région de résidence du client
- Nom
customer > town- Parent
- dans
customer - Type
- string | nullable
- Description
Ville de résidence du client
- Nom
customer_id- Type
- string | nullable
- Description
Identifiant d’un client existant à associer à cette session, par exemple cus_...
- Nom
description- Type
- string
- Description
Description du paiement affichée au client
- Nom
discounts- Type
- object | nullable
- Description
Le coupon ou code promotionnel à appliquer à la session. Un seul peut être indiqué.
- Nom
discounts > coupon- Parent
- dans
discounts - Type
- string
- Description
Identifiant du coupon à appliquer à cette session.
- Nom
discounts > promotion_code- Parent
- dans
discounts - Type
- string
- Description
Identifiant du code promotionnel à appliquer à cette session.
- Nom
expires_in- Type
- integer
- Valeur par défaut
- Valeur par défaut :1800
- Description
Délai d’expiration de la session en secondes (de 5 minutes à 2 heures)
- Nom
fees_included- Type
- boolean
- Valeur par défaut
- Valeur par défaut :true
- Description
Si la valeur est false, les frais supplémentaires sont ajoutés au montant prélevé au client
- Nom
line_items- Type
- array
- Description
Éléments de ligne de produit facultatifs à afficher lors du paiement
- Nom
line_items > adjustable- Parent
- dans
line_items - Type
- boolean
- Description
Si la valeur est
true, la quantité de cette ligne d’article pourra être ajustée.
- Nom
line_items > currency- Parent
- dans
line_items - Type
- string
- Valeur par défaut
- Valeur par défaut :XAF
- Description
Devise de la transaction : devise locale du pays ou devise étrangère
- Nom
line_items > limit_max- Parent
- dans
line_items - Type
- integer
- Description
Quantité maximale autorisée pour cette ligne d’article.
- Nom
line_items > limit_min- Parent
- dans
line_items - Type
- integer
- Description
Quantité minimale autorisée pour cette ligne d’article.
- Nom
line_items > product- Parent
- dans
line_items - Type
- string
- Description
Identifiant d’un produit existant à ajouter à cette session
- Nom
line_items > product_data- Parent
- dans
line_items - Type
- object | nullable
- Description
Données utilisées pour créer un nouveau [produit]
- Nom
line_items > product_data > name- Parent
- dans
line_items.product_data - Type
- string
- Obligatoire
- obligatoire
- Description
Nom du produit acheté.
- Nom
line_items > product_data > description- Parent
- dans
line_items.product_data - Type
- string | nullable
- Description
Description de ce produit.
- Nom
line_items > product_data > images- Parent
- dans
line_items.product_data - Type
- array
- Description
Liste contenant jusqu’à huit URL d’images pour ce produit.
- Nom
line_items > product_data > metadata- Parent
- dans
line_items.product_data - Type
- object
- Description
Métadonnées associées à ce produit.
- Nom
line_items > product_data > unit_label- Parent
- dans
line_items.product_data - Type
- string | nullable
- Description
Libellé représentant l’unité de ce produit.
- Nom
line_items > quantity- Parent
- dans
line_items - Type
- integer
- Valeur par défaut
- Valeur par défaut :1
- Description
- Nom
line_items > unit_amount- Parent
- dans
line_items - Type
- double
- Description
- Nom
location- Type
- object | nullable
- Description
Informations de localisation facultatives pour les statistiques
- Nom
location > country- Parent
- dans
location - Type
- string | nullable
- Description
Pays où la transaction a été effectuée
- Nom
location > ip- Parent
- dans
location - Type
- string
- Description
Indique si l’adresse IP doit être utilisée pour localiser la transaction
- Nom
location > region- Parent
- dans
location - Type
- string | nullable
- Description
Région où la transaction a été effectuée
- Nom
location > town- Parent
- dans
location - Type
- string
- Description
Ville où la transaction a été effectuée
- Nom
metadata- Type
- object
- Description
Paires clé-valeur contenant des informations supplémentaires
- Nom
mode- Type
- enum
- Valeur par défaut
- Valeur par défaut :payment
- Description
Mode de paiement
payment- Paiement
- Nom
required_contact_info- Type
- boolean | nullable
- Description
Demander les coordonnées du client
- Nom
secure_pay- Type
- object | nullable
- Description
Pour activer le paiement sécurisé, fournissez les informations suivantes :
- Nom
secure_pay > auto_release_delay_hours- Parent
- dans
secure_pay - Type
- integer
- Description
Nombre d’heures après confirmation de la livraison avant la libération automatique du paiement sécurisé
- Nom
secure_pay > commitment_fee- Parent
- dans
secure_pay - Type
- decimal
- Description
Frais d’engagement prélevés à l’acheteur lors du paiement sécurisé. Ils sont remboursés si les fonds sont libérés ou si le paiement est annulé sans litige, mais pas si un litige est résolu en faveur du vendeur
- Nom
secure_pay > delivery_required- Parent
- dans
secure_pay - Type
- boolean
- Valeur par défaut
- Valeur par défaut :true
- Description
Indique si la confirmation de livraison est obligatoire pour les paiements sécurisés
- Nom
secure_pay > dispute_enabled- Parent
- dans
secure_pay - Type
- boolean
- Valeur par défaut
- Valeur par défaut :true
- Description
Indique si la résolution des litiges est activée pour les paiements sécurisés
- Nom
secure_pay > fee_payer- Parent
- dans
secure_pay - Type
- enum
- Valeur par défaut
- Valeur par défaut :buyer
- Description
Personne prenant en charge les frais du paiement sécurisé : acheteur ou vendeur
buyer- Frais payés par l’acheteurseller- Frais payés par le marchandsplit- Frais partagés à parts égales entre l’acheteur et le marchandno_fee- Aucun frais
- Nom
secure_pay > pay_mode- Parent
- dans
secure_pay - Type
- enum
- Valeur par défaut
- Valeur par défaut :mandatory
- Description
Mode du paiement : sécurisé ou instantané
disabled- SecurePay désactivéoptional- L’acheteur peut choisir SecurePaymandatory- SecurePay obligatoire
- Nom
secure_pay > terms_accepted- Parent
- dans
secure_pay - Type
- boolean
- Description
Indique si les conditions générales des paiements sécurisés ont été acceptées
- Nom
success_url- Type
- string
- Obligatoire
- obligatoire
- Description
URL de redirection après un paiement réussi
- Nom
cancel_url- Type
- string
- Obligatoire
- obligatoire
- Description
URL de redirection vers laquelle envoyer l'utilisateur si le paiement est annulé
- Nom
line_items- Type
- array
- Description
Éléments de ligne de produit facultatifs à afficher lors du paiement
- Nom
conversion- Type
- boolean
- Description
Si vrai, MeSomb convertira en cas de devise étrangère
Requête
<span><span style="color: var(--shiki-token-keyword)">import</span><span style="color: var(--shiki-color-text)"> {CheckoutOperation} </span><span style="color: var(--shiki-token-keyword)">from</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'@hachther/mesomb'</span><span style="color: var(--shiki-color-text)">;</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">applicationKey</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your application key>'</span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">accessKey</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your access key>'</span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">secretKey</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your secret key>'</span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">new</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-function)">CheckoutOperation</span><span style="color: var(--shiki-color-text)">({applicationKey</span><span style="color: var(--shiki-token-punctuation)">,</span><span style="color: var(--shiki-color-text)"> accessKey</span><span style="color: var(--shiki-token-punctuation)">,</span><span style="color: var(--shiki-color-text)"> secretKey});</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">session</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">await</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-token-function)">.create</span><span style="color: var(--shiki-color-text)">({</span></span> <span><span style="color: var(--shiki-color-text)"> success_url</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'https://example.com/success'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> cancel_url</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'https://example.com/cancel'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> line_items</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> [</span></span> <span><span style="color: var(--shiki-color-text)"> {</span></span> <span><span style="color: var(--shiki-color-text)"> name</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'Premium Bag'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> amount</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">99999</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> currency</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'XAF'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> quantity</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">1</span></span> <span><span style="color: var(--shiki-color-text)"> }</span></span> <span><span style="color: var(--shiki-color-text)"> ]</span></span> <span><span style="color: var(--shiki-color-text)">});</span></span> <span></span> <span><span style="color: var(--shiki-token-constant)">console</span><span style="color: var(--shiki-token-function)">.log</span><span style="color: var(--shiki-color-text)">(</span><span style="color: var(--shiki-token-constant)">session</span><span style="color: var(--shiki-color-text)">.url);</span></span> <span></span>
Consulter une session de paiement
Récupérez une session de paiement par ID.
- Nom
id- Type
- string
- Obligatoire
- obligatoire
- Description
ID de la session de paiement.
Requête
<span><span style="color: var(--shiki-token-keyword)">import</span><span style="color: var(--shiki-color-text)"> {CheckoutOperation} </span><span style="color: var(--shiki-token-keyword)">from</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'@hachther/mesomb'</span><span style="color: var(--shiki-color-text)">;</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">new</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-function)">CheckoutOperation</span><span style="color: var(--shiki-color-text)">({</span></span> <span><span style="color: var(--shiki-color-text)"> applicationKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your application key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> accessKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your access key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> secretKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your secret key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)">});</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">session</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">await</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-token-function)">.retrieve</span><span style="color: var(--shiki-color-text)">(</span><span style="color: var(--shiki-token-string-expression)">'cs_test_123'</span><span style="color: var(--shiki-color-text)">);</span></span> <span><span style="color: var(--shiki-token-constant)">console</span><span style="color: var(--shiki-token-function)">.log</span><span style="color: var(--shiki-color-text)">(</span><span style="color: var(--shiki-token-constant)">session</span><span style="color: var(--shiki-color-text)">.status);</span></span> <span></span>
Faire expirer une session de paiement
Expirer une session de paiement active.
- Nom
id- Type
- string
- Obligatoire
- obligatoire
- Description
ID de la session de paiement.
Requête
<span><span style="color: var(--shiki-token-keyword)">import</span><span style="color: var(--shiki-color-text)"> {CheckoutOperation} </span><span style="color: var(--shiki-token-keyword)">from</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'@hachther/mesomb'</span><span style="color: var(--shiki-color-text)">;</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">new</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-function)">CheckoutOperation</span><span style="color: var(--shiki-color-text)">({</span></span> <span><span style="color: var(--shiki-color-text)"> applicationKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your application key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> accessKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your access key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> secretKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your secret key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)">});</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">session</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">await</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-token-function)">.expire</span><span style="color: var(--shiki-color-text)">(</span><span style="color: var(--shiki-token-string-expression)">'cs_test_123'</span><span style="color: var(--shiki-color-text)">);</span></span> <span><span style="color: var(--shiki-token-constant)">console</span><span style="color: var(--shiki-token-function)">.log</span><span style="color: var(--shiki-color-text)">(</span><span style="color: var(--shiki-token-constant)">session</span><span style="color: var(--shiki-color-text)">.status);</span></span> <span></span>
Supprimer une session de paiement
Supprimer une session de paiement par ID.
- Nom
id- Type
- string
- Obligatoire
- obligatoire
- Description
ID de la session de paiement.
Requête
<span><span style="color: var(--shiki-token-keyword)">import</span><span style="color: var(--shiki-color-text)"> {CheckoutOperation} </span><span style="color: var(--shiki-token-keyword)">from</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'@hachther/mesomb'</span><span style="color: var(--shiki-color-text)">;</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">const</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">=</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-keyword)">new</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-function)">CheckoutOperation</span><span style="color: var(--shiki-color-text)">({</span></span> <span><span style="color: var(--shiki-color-text)"> applicationKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your application key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> accessKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your access key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)"> secretKey</span><span style="color: var(--shiki-token-keyword)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'<your secret key>'</span><span style="color: var(--shiki-token-punctuation)">,</span></span> <span><span style="color: var(--shiki-color-text)">});</span></span> <span></span> <span><span style="color: var(--shiki-token-keyword)">await</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-constant)">client</span><span style="color: var(--shiki-token-function)">.delete</span><span style="color: var(--shiki-color-text)">(</span><span style="color: var(--shiki-token-string-expression)">'cs_test_123'</span><span style="color: var(--shiki-color-text)">);</span></span> <span><span style="color: var(--shiki-token-constant)">console</span><span style="color: var(--shiki-token-function)">.log</span><span style="color: var(--shiki-color-text)">(</span><span style="color: var(--shiki-token-string-expression)">'Checkout session deleted'</span><span style="color: var(--shiki-color-text)">);</span></span> <span></span>
