| GET,POST | /payment_initiate/{payment_target}/{payment_run_mode}/{payment_type}/{id_origin}/{id_societe}/{id_client}/{id_commande}/{type_paiement}/{amount}/{email} | Paiements : initier un règlement | |
|---|---|---|---|
| GET,POST | /payment_initiate/{payment_target}/{payment_run_mode}/{payment_type}/{id_origin}/{id_societe}/{id_client}/{id_commande}/{type_paiement}/{amount}/{email}/{commentaire} | Paiements : initier un règlement |
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
enum eapi_payment_target_enum : string
{
case LABANQUEPOSTALE = 'LABANQUEPOSTALE';
case PAYBOX = 'PAYBOX';
case MILLIET = 'MILLIET';
}
enum eapi_payment_run_mode_enum : string
{
case TEST = 'TEST';
case LIVE = 'LIVE';
case FORCE_LIVE = 'FORCE_LIVE';
}
enum eapi_payment_type_enum : string
{
case DIRECT_SEPA = 'DIRECT_SEPA';
case SEPA = 'SEPA';
case CB = 'CB';
case AMEX = 'AMEX';
case COMPTABILITE = 'COMPTABILITE';
}
/** @description Paiements : initier un règlement */
// @Api(Description="Paiements : initier un règlement")
class payment_initiate implements JsonSerializable
{
public function __construct(
/** @description environnement cible : PAYBOX, LA BANQUE POSTALE, MILLIET */
// @ApiMember(Description="environnement cible : PAYBOX, LA BANQUE POSTALE, MILLIET", IsRequired=true, Name="payment_target")
/** @var eapi_payment_target_enum|null */
public ?eapi_payment_target_enum $payment_target=null,
/** @description mode : LIVE, TEST */
// @ApiMember(Description="mode : LIVE, TEST", IsRequired=true, Name="payment_run_mode")
/** @var eapi_payment_run_mode_enum|null */
public ?eapi_payment_run_mode_enum $payment_run_mode=null,
/** @description type de paiement : CB, AMEX, SEPA, SEPA_DIRECT, COMPTABILITE */
// @ApiMember(Description="type de paiement : CB, AMEX, SEPA, SEPA_DIRECT, COMPTABILITE", IsRequired=true, Name="payment_type")
/** @var eapi_payment_type_enum|null */
public ?eapi_payment_type_enum $payment_type=null,
/** @description initiateur de la demande : web, dcp, télévente, compta, ibar, etc */
// @ApiMember(Description="initiateur de la demande : web, dcp, télévente, compta, ibar, etc", IsRequired=true, Name="id_origin")
/** @var string */
public string $id_origin='',
/** @description numéro société : 1-J. Milliet BBC, 2-BCASH Chapelle, 3-BCASH Bagneux, 6-BCASH Clichy, etc... */
// @ApiMember(Description="numéro société : 1-J. Milliet BBC, 2-BCASH Chapelle, 3-BCASH Bagneux, 6-BCASH Clichy, etc...", IsRequired=true, Name="id_societe")
/** @var string */
public string $id_societe='',
/** @description numéro client : 2263-David, 13846-Fabien, etc... */
// @ApiMember(Description="numéro client : 2263-David, 13846-Fabien, etc...", IsRequired=true, Name="id_client")
/** @var string */
public string $id_client='',
/** @description numéro commande : dans le cas du DCP, sinon 0 ... OU PAS !!! (évolution pour télévente, compta, etc...) */
// @ApiMember(Description="numéro commande : dans le cas du DCP, sinon 0 ... OU PAS !!! (évolution pour télévente, compta, etc...)", IsRequired=true, Name="id_commande")
/** @var string */
public string $id_commande='',
/** @description type : CB, AMEX, SEPA, SEPA_DIRECT */
// @ApiMember(Description="type : CB, AMEX, SEPA, SEPA_DIRECT", IsRequired=true, Name="type_paiement")
/** @var eapi_payment_type_enum|null */
public ?eapi_payment_type_enum $type_paiement=null,
/** @description montant du paiement dans sa plus petite unité monétaire (le centime pour l'euro) */
// @ApiMember(Description="montant du paiement dans sa plus petite unité monétaire (le centime pour l'euro)", IsRequired=true, Name="amount")
/** @var string */
public string $amount='',
/** @description email client */
// @ApiMember(Description="email client", IsRequired=true, Name="email")
/** @var string */
public string $email='',
/** @description commentaire */
// @ApiMember(Description="commentaire", Name="commentaire")
/** @var string|null */
public ?string $commentaire=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['payment_target'])) $this->payment_target = JsonConverters::from('eapi_payment_target_enum', $o['payment_target']);
if (isset($o['payment_run_mode'])) $this->payment_run_mode = JsonConverters::from('eapi_payment_run_mode_enum', $o['payment_run_mode']);
if (isset($o['payment_type'])) $this->payment_type = JsonConverters::from('eapi_payment_type_enum', $o['payment_type']);
if (isset($o['id_origin'])) $this->id_origin = $o['id_origin'];
if (isset($o['id_societe'])) $this->id_societe = $o['id_societe'];
if (isset($o['id_client'])) $this->id_client = $o['id_client'];
if (isset($o['id_commande'])) $this->id_commande = $o['id_commande'];
if (isset($o['type_paiement'])) $this->type_paiement = JsonConverters::from('eapi_payment_type_enum', $o['type_paiement']);
if (isset($o['amount'])) $this->amount = $o['amount'];
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['commentaire'])) $this->commentaire = $o['commentaire'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->payment_target)) $o['payment_target'] = JsonConverters::to('eapi_payment_target_enum', $this->payment_target);
if (isset($this->payment_run_mode)) $o['payment_run_mode'] = JsonConverters::to('eapi_payment_run_mode_enum', $this->payment_run_mode);
if (isset($this->payment_type)) $o['payment_type'] = JsonConverters::to('eapi_payment_type_enum', $this->payment_type);
if (isset($this->id_origin)) $o['id_origin'] = $this->id_origin;
if (isset($this->id_societe)) $o['id_societe'] = $this->id_societe;
if (isset($this->id_client)) $o['id_client'] = $this->id_client;
if (isset($this->id_commande)) $o['id_commande'] = $this->id_commande;
if (isset($this->type_paiement)) $o['type_paiement'] = JsonConverters::to('eapi_payment_type_enum', $this->type_paiement);
if (isset($this->amount)) $o['amount'] = $this->amount;
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->commentaire)) $o['commentaire'] = $this->commentaire;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /payment_initiate/{payment_target}/{payment_run_mode}/{payment_type}/{id_origin}/{id_societe}/{id_client}/{id_commande}/{type_paiement}/{amount}/{email} HTTP/1.1
Host: milliet.io
Accept: application/json
Content-Type: application/json
Content-Length: length
{"payment_target":"LABANQUEPOSTALE","payment_run_mode":"TEST","payment_type":"DIRECT_SEPA","id_origin":"String","id_societe":"String","id_client":"String","id_commande":"String","type_paiement":"DIRECT_SEPA","amount":"String","email":"String","commentaire":"String"}