Domaines - API - Payment d'une commande d'un domaine de domaine
... / API - Payment d'une comma...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

API - Payment d'une commande d'un domaine de domaine

Von
SebastienG70
Erstellungsdatum 2021-02-25 21:42:39 (edited on 2024-09-04 11:18:14) in Domaines

Bonjour,

Je développe une application PHP pour pouvoir acheter un nom de domaine.
J'ai exploré l'OVH API et je me suis aussi inspiré de ce post : https://community.ovhcloud.com/community/fr/commande-domaine-via-api?id=community_question&sys_id=da84fd44585e42d02d4c51cec5fc96a2

Lorsque j'arrive à l'étape pour récupérer les moyens de paiements disponibles pour la commande, cela me retourne un tableau vide :
`GET /me/order/{orderId}/availableRegisteredPaymentMean`

Pourtant, j'ai bien un moyen de paiement par défaut défini dans mon espace.

J'ai essayé une autre approche, en récupérant mon moyen de paiement :
`GET /me/payment/method`
Puis :
`GET /me/order/{orderId}/pay (avec le method id)`
Mais je reçois l'erreur suivante :
`PayWithPaymentMethod Data is not a hash for a complex type`

Pourriez-vous me guider ?
Merci par avance


3 Antworten ( Latest reply on 2021-10-07 10:03:03 Von
Pierre-OlivierB
)

J'ai activité dans https://www.ovh.com/manager/dedicated/index.html#/useraccount/advanced
Les fonctionnalités beta et le mode développeur mais j'obtiens toujours un tableau vide avec :

`$ovh->get('/me/order/'.$orderId.'/availableRegisteredPaymentMean');`

Help !

Je rencontre exactement le même problème et impossible de trouver une aide à ce sujet. :/

Si ça peut aider, en php, l'exemple API donne comme syntaxe :

$result = $ovh->post('/me/order/'.$orderId.'/pay', array(
'paymentMethod' => '{"id":'.$id_payment.'}', // Payment method informations for pay (type: billing.order.PayWithPaymentMethod)
));

mais il faut en réalité :

$result = $ovh->post('/me/order/'.$orderId.'/pay', array(
'paymentMethod' => array("id"=>$id_payment) // Payment method informations for pay (type: billing.order.PayWithPaymentMethod)
));