Gateway - Procesamiento
Procesamiento
3 min
desde el servidor tab request url https api sugaway com p operations intent token name procesamiento de la operaci n method post request pathparameters queryparameters headerparameters bodydataparameters kind required name source type string description token obtenido al tokenizar kind optional name installment type string description reference obtenido de cuotas al detectar la tarjeta kind optional name wallet type string description indica si la tarjeta debe ser guardada al finalizar el proceso valores true false kind optional name numberofinstallments type number description cantidad de cuotas cuando no se utiliza la detecci n de cuotas numberofinstallments kind optional name customer type object description informaci n del comprador children name name kind optional type string description nombre del cliente name identification kind optional type string description n mero de id personal ej dni name email kind optional type string description email del cliente name phone kind optional type string description tel fono del cliente name authcode kind optional type string description c digo de autenticaci n de la operaci n s lo para operaciones donde el mismo sea requerido children name sources kind optional type array description children name sourcereference kind optional type string description children formdataparameters results languages id z y 2rp7h75vzqzd mx6v code n id ks6d18und n status n code 200 n text aprobado n message transacci n aprobada n n language 200 selectedlanguageid z y 2rp7h75vzqzd mx6v examples languages id o4ufzaxjtmzdkexdvmp5w language curl code curl location g request post https api sugaway com p operations intent token n header accept application json n data raw source string installment string wallet string installmentcount string customer object authcode string customlabel id pmgswslcq 0krulprvr r language nodejs code var request require request ; nvar options n method post n url https api sugaway com p operations intent token n headers n accept application json n n body source string installment string wallet string installmentcount string customer object authcode string n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n customlabel id vt66ow4dqauqn5lzpqj0h language javascript code var myheaders new headers ; nmyheaders append accept application json ; n nvar raw source string installment string wallet string installmentcount string customer object authcode string ; n nvar requestoptions n method post n headers myheaders n body raw n redirect follow n ; n nfetch https api sugaway com p operations intent token requestoptions n then response response text n then result console log result n catch error console log error error ; customlabel id 3vfeqnhohgvku1gwt8at language python code import requests n nurl https api sugaway com p operations intent token n npayload source string installment string wallet string installmentcount string customer object authcode string nheaders n accept application json n n nresponse requests request post url headers headers data payload n nprint response text n customlabel id 8njjcr1wywr4obcbuvv0t language ruby code require uri nrequire net http n nurl uri https api sugaway com p operations intent token n nhttps net http new url host url port nhttps use ssl true n nrequest net http post new url nrequest accept application json nrequest body source string installment string wallet string installmentcount string customer object authcode string n nresponse https request request nputs response read body n customlabel selectedlanguageid o4ufzaxjtmzdkexdvmp5w description permite procesar la operaci n con toda la informaci n recolectada currentnewparameter label body parameter value bodydataparameters ejemplo { 	"installment" "1", 	"source" "t 3qhgwzul5wczha9d4sdw0o" } procesamiento simplificado bajo este esquema se permite el procesamiento sin necesidad de crear el token del medio de pago de manera anticipada al procesamiento en este modo sólo se soporta el procesamiento con un medio de pago en este tipo de procesamiento se recomienda enviar la información del customer al crear el intent token tab request url https api sugaway com p operations intent token name procesamiento de la operaci n method post request pathparameters queryparameters headerparameters bodydataparameters kind required name source type object description medio de pago a procesar ver ejemplo abajo kind optional name installmentcount type number description cantidad de cuotas cuando no se utiliza la detecci n de cuotas kind optional name customer type object description informaci n del comprador children name name kind optional type string description nombre del cliente name identification kind optional type string description n mero de id personal ej dni name email kind optional type string description email del cliente name phone kind optional type string description tel fono del cliente name authcode kind optional type string description c digo de autenticaci n de la operaci n s lo para operaciones donde el mismo sea requerido children formdataparameters results languages id z y 2rp7h75vzqzd mx6v code n id ks6d18und n status n code 200 n text aprobado n message transacci n aprobada n n language 200 selectedlanguageid z y 2rp7h75vzqzd mx6v examples languages id o4ufzaxjtmzdkexdvmp5w language curl code curl location g request post https api sugaway com p operations intent token n header accept application json n data raw source string installment string wallet string installmentcount string customer object authcode string customlabel id pmgswslcq 0krulprvr r language nodejs code var request require request ; nvar options n method post n url https api sugaway com p operations intent token n headers n accept application json n n body source string installment string wallet string installmentcount string customer object authcode string n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n customlabel id vt66ow4dqauqn5lzpqj0h language javascript code var myheaders new headers ; nmyheaders append accept application json ; n nvar raw source string installment string wallet string installmentcount string customer object authcode string ; n nvar requestoptions n method post n headers myheaders n body raw n redirect follow n ; n nfetch https api sugaway com p operations intent token requestoptions n then response response text n then result console log result n catch error console log error error ; customlabel id 3vfeqnhohgvku1gwt8at language python code import requests n nurl https api sugaway com p operations intent token n npayload source string installment string wallet string installmentcount string customer object authcode string nheaders n accept application json n n nresponse requests request post url headers headers data payload n nprint response text n customlabel id 8njjcr1wywr4obcbuvv0t language ruby code require uri nrequire net http n nurl uri https api sugaway com p operations intent token n nhttps net http new url host url port nhttps use ssl true n nrequest net http post new url nrequest accept application json nrequest body source string installment string wallet string installmentcount string customer object authcode string n nresponse https request request nputs response read body n customlabel selectedlanguageid o4ufzaxjtmzdkexdvmp5w description permite procesar la operaci n con toda la informaci n recolectada currentnewparameter label body parameter value bodydataparameters en la propiedad source debe enviarse la información del medio de pago como se explica aqui { 	"installmentcount" 1, 	"source" { 	 "card" { 	 "number" "4507990000000010", 	 "month" 10, 	 "year" 25, 	 "identification" "12123123", 	 "name" "demo mobbex" 	 } 	} }