Hi Keerthika, I have tried your use-case and notice your request is going with a payload. However, your back-end is not expecting that. Therefore you need to drop your message body in the request mediation flow.
In order to drop the message payload you need to perform two tasks in the wso2 ESB. Create empty payload using Payload mediator <https://docs.wso2.com/display/ESB481/PayloadFactory+Mediator> use the FORCE_POST_PUT_NOBODY <https://docs.wso2.com/display/ESB481/HTTP+Transport+Properties#HTTPTransportProperties-FORCE_POST_PUT_NOBODY>property to enforce. Example is given below that demonstrate the use case. <api xmlns="http://ws.apache.org/ns/synapse" name="strip" context="/strip"> <resource methods="POST GET"> <inSequence> <header name="Authorization" scope="transport" value="Bearer XXXXXXXXXXXXXXXXXXXXX"></header> <property name="uri.var.chargeId" expression="json-eval($.chargeId)" scope="default" type="STRING"></property> * <payloadFactory media-type="json"> * * <format></format> * * <args></args> * * </payloadFactory>* <property name="ContentType" value="application/x-www-form-urlencoded" scope="axis2"></property> <property name="messageType" value="application/x-www-form-urlencoded" scope="axis2"></property> * <property name="FORCE_POST_PUT_NOBODY" value="true" scope="axis2" type="BOOLEAN"></property>* <call> <endpoint> <address uri="https://api.stripe.com/v1/charges/{uri.var.chargeId}/refunds"></address> </endpoint> </call> <respond></respond> </inSequence> </resource> </api> On Thu, Dec 11, 2014 at 10:06 AM, Keerthika Mahendralingam < [email protected]> wrote: > Hi all, > I am trying to send a post request to https://api.stripe.com/v1/charges/ > <https://www.google.com/url?q=https%3A%2F%2Fapi.stripe.com%2Fv1%2Fcharges%2F&sa=D&sntz=1&usg=AFQjCNFej5mTQCtPacoinYr0qTl7-XDUeg> > {CHARGE_ID}/refunds. > There are some optional parameters for this request. When I invoked the > endpoint through esb with the optional parameters I am able to get the > expected response. But if I invoked the endpoint without the optional > parameters, an additional body is sent with the request. > Please find the wire log for the both requests with optional parameters > and mandatory parameter : > > *Wire log for the request with optional parameter:* > > [2014-12-11 09:35:54,151] DEBUG - wire >> "POST > /services/stripe_createANewRefund HTTP/1.1[\r][\n]" > > [2014-12-11 09:35:54,151] DEBUG - wire >> "Host: > keerthikas-macbook-pro.local:8280[\r][\n]" > > [2014-12-11 09:35:54,151] DEBUG - wire >> "Connection: keep-alive[\r][\n]" > > [2014-12-11 09:35:54,151] DEBUG - wire >> "Content-Length: 61[\r][\n]" > > [2014-12-11 09:35:54,151] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]" > > [2014-12-11 09:35:54,151] DEBUG - wire >> "Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" > > [2014-12-11 09:35:54,151] DEBUG - wire >> "User-Agent: Mozilla/5.0 > (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) > Chrome/39.0.2171.71 Safari/537.36[\r][\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "Content-Type: > application/json[\r][\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "Accept: */*[\r][\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "Accept-Encoding: gzip, > deflate[\r][\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "Accept-Language: > en-US,en;q=0.8[\r][\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "Cookie: SERVERID=djc19[\r][\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "[\r][\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "{[\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> > ""chargeId":"ch_158NuEDpl35Wu2ui6atArh0E",[\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> " "amount":"50"[\n]" > > [2014-12-11 09:35:54,152] DEBUG - wire >> "}" > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> POST > /services/stripe_createANewRefund HTTP/1.1 > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Host: > keerthikas-macbook-pro.local:8280 > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Connection: > keep-alive > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> > Content-Length: 61 > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> > Cache-Control: no-cache > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> User-Agent: > Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, > like Gecko) Chrome/39.0.2171.71 Safari/537.36 > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Content-Type: > application/json > > [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Accept: */* > > [2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >> > Accept-Encoding: gzip, deflate > > [2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >> > Accept-Language: en-US,en;q=0.8 > > [2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >> Cookie: > SERVERID=djc19 > > [2014-12-11 09:35:54,156] ERROR - SynapseJsonPath #stringValueOf. Error > evaluating JSON Path <$.refundApplicationFee>. Returning empty result. > Error>>> invalid path > > [2014-12-11 09:35:54,156] ERROR - SynapseJsonPath #stringValueOf. Error > evaluating JSON Path <$.reason>. Returning empty result. Error>>> invalid > path > > [2014-12-11 09:35:54,157] ERROR - SynapseJsonPath #stringValueOf. Error > evaluating JSON Path <$.metadata>. Returning empty result. Error>>> invalid > path > > [2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> POST > /v1/charges/ch_158NuEDpl35Wu2ui6atArh0E/refunds HTTP/1.1 > > [2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> > Accept-Language: en-US,en;q=0.8 > > [2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> Cookie: > SERVERID=djc19 > > [2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> > Authorization: Bearer sk_test_Gd3JGidPIzfPkMOC8ZGnPEdf > > [2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> > Accept-Encoding: gzip, deflate > > [2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm > > [2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Content-Type: > application/x-www-form-urlencoded > > [2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Accept: */* > > [2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> > Cache-Control: no-cache > > [2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> > Transfer-Encoding: chunked > > [2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Host: > api.stripe.com:80 > > [2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Connection: > Keep-Alive > > [2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> User-Agent: > Synapse-PT-HttpComponents-NIO > > [2014-12-11 09:35:55,266] DEBUG - wire << "POST /v1/charges/ > *ch_158NuEDpl35Wu2ui6atArh0E*/refunds HTTP/1.1[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Accept-Language: > en-US,en;q=0.8[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Cookie: SERVERID=djc19[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Authorization: Bearer > sk_test_Gd3JGidPIzfPkMOC8ZGnPEdf[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Accept-Encoding: gzip, > deflate[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Content-Type: > application/x-www-form-urlencoded[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Accept: */*[\r][\n]" > > [2014-12-11 09:35:55,266] DEBUG - wire << "Cache-Control: no-cache[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "Transfer-Encoding: > chunked[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "Host: api.stripe.com:80 > [\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "Connection: Keep-Alive[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "User-Agent: > Synapse-PT-HttpComponents-NIO[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "9[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "*amount=50*[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "0[\r][\n]" > > [2014-12-11 09:35:55,267] DEBUG - wire << "[\r][\n]" > > [2014-12-11 09:35:55,816] DEBUG - wire >> "HTTP/1.1 200 OK[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> "Server: nginx[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> "Date: Thu, 11 Dec 2014 04:03:19 > GMT[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> "Content-Type: > application/json;charset=utf-8[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> "Content-Length: 288[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> "Connection: keep-alive[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> > "Access-Control-Allow-Credentials: true[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> "Access-Control-Allow-Methods: > GET, POST, HEAD, OPTIONS, DELETE[\r][\n]" > > [2014-12-11 09:35:55,817] DEBUG - wire >> "Access-Control-Allow-Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> "Access-Control-Max-Age: > 300[\r][\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> "Cache-Control: no-cache, > no-store[\r][\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> "Request-Id: > req_uaeMx7C2V5alRIbX[\r][\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> "Stripe-Version: > 2014-11-20[\r][\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> "Strict-Transport-Security: > max-age=31556926; includeSubDomains[\r][\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> "[\r][\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> "{[\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> " "id": > "re_158OAdDpl35Wu2uiaDnuKJlF",[\n]" > > [2014-12-11 09:35:55,818] DEBUG - wire >> " "amount": 50,[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "currency": "usd",[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "created": 1418270599,[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "object": "refund",[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "balance_transaction": > "txn_158OAdDpl35Wu2uiUpoc8WfE",[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "metadata": {},[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "charge": > "ch_158NuEDpl35Wu2ui6atArh0E",[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "receipt_number": null,[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> " "reason": null[\n]" > > [2014-12-11 09:35:55,819] DEBUG - wire >> "}[\n]" > > [2014-12-11 09:35:55,820] DEBUG - headers http-outgoing-2 << HTTP/1.1 *200 > OK* > > *Wire log for the request without payload:* > > [2014-12-11 10:00:13,956] DEBUG - wire >> "POST > /services/stripe_createANewRefund HTTP/1.1[\r][\n]" > > [2014-12-11 10:00:13,956] DEBUG - wire >> "Host: > keerthikas-macbook-pro.local:8280[\r][\n]" > > [2014-12-11 10:00:13,956] DEBUG - wire >> "Connection: keep-alive[\r][\n]" > > [2014-12-11 10:00:13,956] DEBUG - wire >> "Content-Length: 44[\r][\n]" > > [2014-12-11 10:00:13,956] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]" > > [2014-12-11 10:00:13,956] DEBUG - wire >> "Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" > > [2014-12-11 10:00:13,956] DEBUG - wire >> "User-Agent: Mozilla/5.0 > (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) > Chrome/39.0.2171.71 Safari/537.36[\r][\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "Content-Type: > application/json[\r][\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "Accept: */*[\r][\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "Accept-Encoding: gzip, > deflate[\r][\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "Accept-Language: > en-US,en;q=0.8[\r][\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "Cookie: SERVERID=djc19[\r][\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "[\r][\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "{[\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> > ""chargeId":"ch_158NuEDpl35Wu2ui6atArh0E"[\n]" > > [2014-12-11 10:00:13,957] DEBUG - wire >> "}" > > [2014-12-11 10:00:13,957] DEBUG - headers http-incoming-5 >> POST > /services/stripe_createANewRefund HTTP/1.1 > > [2014-12-11 10:00:13,957] DEBUG - headers http-incoming-5 >> Host: > keerthikas-macbook-pro.local:8280 > > [2014-12-11 10:00:13,957] DEBUG - headers http-incoming-5 >> Connection: > keep-alive > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> > Content-Length: 44 > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> > Cache-Control: no-cache > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> User-Agent: > Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, > like Gecko) Chrome/39.0.2171.71 Safari/537.36 > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> Content-Type: > application/json > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> Accept: */* > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> > Accept-Encoding: gzip, deflate > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> > Accept-Language: en-US,en;q=0.8 > > [2014-12-11 10:00:13,958] DEBUG - headers http-incoming-5 >> Cookie: > SERVERID=djc19 > > [2014-12-11 10:00:13,959] ERROR - SynapseJsonPath #stringValueOf. Error > evaluating JSON Path <$.amount>. Returning empty result. Error>>> invalid > path > > [2014-12-11 10:00:13,960] ERROR - SynapseJsonPath #stringValueOf. Error > evaluating JSON Path <$.refundApplicationFee>. Returning empty result. > Error>>> invalid path > > [2014-12-11 10:00:13,960] ERROR - SynapseJsonPath #stringValueOf. Error > evaluating JSON Path <$.reason>. Returning empty result. Error>>> invalid > path > > [2014-12-11 10:00:13,960] ERROR - SynapseJsonPath #stringValueOf. Error > evaluating JSON Path <$.metadata>. Returning empty result. Error>>> invalid > path > > [2014-12-11 10:00:14,847] DEBUG - headers http-outgoing-3 >> POST > /v1/charges/*ch_158NuEDpl35Wu2ui6atArh0E*/refunds HTTP/1.1 > > [2014-12-11 10:00:14,847] DEBUG - headers http-outgoing-3 >> > Accept-Language: en-US,en;q=0.8 > > [2014-12-11 10:00:14,847] DEBUG - headers http-outgoing-3 >> Cookie: > SERVERID=djc19 > > [2014-12-11 10:00:14,847] DEBUG - headers http-outgoing-3 >> > Authorization: Bearer sk_test_Gd3JGidPIzfPkMOC8ZGnPEdf > > [2014-12-11 10:00:14,847] DEBUG - headers http-outgoing-3 >> > Accept-Encoding: gzip, deflate > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> Content-Type: > application/x-www-form-urlencoded > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> Accept: */* > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> > Cache-Control: no-cache > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> > Transfer-Encoding: chunked > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> Host: > api.stripe.com:80 > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> Connection: > Keep-Alive > > [2014-12-11 10:00:14,848] DEBUG - headers http-outgoing-3 >> User-Agent: > Synapse-PT-HttpComponents-NIO > > [2014-12-11 10:00:14,848] DEBUG - wire << "POST > /v1/charges/ch_158NuEDpl35Wu2ui6atArh0E/refunds HTTP/1.1[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Accept-Language: > en-US,en;q=0.8[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Cookie: SERVERID=djc19[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Authorization: Bearer > sk_test_Gd3JGidPIzfPkMOC8ZGnPEdf[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Accept-Encoding: gzip, > deflate[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Content-Type: > application/x-www-form-urlencoded[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Accept: */*[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Cache-Control: no-cache[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Transfer-Encoding: > chunked[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Host: api.stripe.com:80 > [\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "Connection: Keep-Alive[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "User-Agent: > Synapse-PT-HttpComponents-NIO[\r][\n]" > > [2014-12-11 10:00:14,849] DEBUG - wire << "[\r][\n]" > > [2014-12-11 10:00:14,850] DEBUG - wire << "24[\r][\n]" > > [2014-12-11 10:00:14,850] DEBUG - wire << " > *chargeId=ch_158NuEDpl35Wu2ui6atArh0E*[\r][\n]" > > [2014-12-11 10:00:14,850] DEBUG - wire << "0[\r][\n]" > > [2014-12-11 10:00:14,850] DEBUG - wire << "[\r][\n]" > > [2014-12-11 10:00:15,173] DEBUG - wire >> "HTTP/1.1 400 Bad > Request[\r][\n]" > > [2014-12-11 10:00:15,173] DEBUG - wire >> "Server: nginx[\r][\n]" > > [2014-12-11 10:00:15,173] DEBUG - wire >> "Date: Thu, 11 Dec 2014 04:27:38 > GMT[\r][\n]" > > [2014-12-11 10:00:15,173] DEBUG - wire >> "Content-Type: > application/json;charset=utf-8[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Content-Length: 137[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Connection: keep-alive[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> > "Access-Control-Allow-Credentials: true[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Access-Control-Allow-Methods: > GET, POST, HEAD, OPTIONS, DELETE[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Access-Control-Allow-Origin: > chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Access-Control-Max-Age: > 300[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Cache-Control: no-cache, > no-store[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Request-Id: > req_cuszgRZsgLEJRDOS[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "Stripe-Version: > 2014-11-20[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "[\r][\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> "{[\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> " "error": {[\n]" > > [2014-12-11 10:00:15,174] DEBUG - wire >> " "type": > "invalid_request_error",[\n]" > > [2014-12-11 10:00:15,175] DEBUG - wire >> " "message": "*Received > unknown parameter: chargeId*",[\n]" > > [2014-12-11 10:00:15,175] DEBUG - wire >> " "param": "chargeId"[\n]" > > [2014-12-11 10:00:15,175] DEBUG - wire >> " }[\n]" > > [2014-12-11 10:00:15,175] DEBUG - wire >> "}[\n]" > > [2014-12-11 10:00:15,175] DEBUG - headers http-outgoing-3 << HTTP/1.1 400 > Bad Request > > *Please note that if I hardcode the value for chargeId in the proxy and > send a get request from the rest client without the optional parameters I > got the correct response. I got the error only when I sent the post request > with the payload from rest client.* > > *The template for this request is:* > <template name="createANewRefund" xmlns="http://ws.apache.org/ns/synapse"> > <parameter name="chargeId" description="The identifier of the charge > to be refunded."/> > <parameter name="amount" description="card's expiration month"/> > <sequence> > <property name="uri.var.chargeId" expression="$func:chargeId"/> > <property name="uri.var.amount" expression="$func:amount"/> > <payloadFactory media-type="json"> > <format> > { > } > </format> > </payloadFactory> > <script language="js"><![CDATA[ > var amount=mc.getProperty('uri.var.amount'); > var payload = mc.getPayloadJSON(); > if (amount != null && amount != "") { > payload["amount"]=amount; > } > mc.setPayloadJSON(payload); > ]]> > </script> > <property name="messageType" > value="application/x-www-form-urlencoded" scope="axis2"/> > <header name="Content-Type" > value="application/x-www-form-urlencoded" scope="transport" /> > <header name="Authorization" value="Bearer > sk_test_Gd3JGidPIzfPkMOC8ZGnPEdf" scope="transport"/> > <call> > <endpoint> > <http method="post" > uri-template="https://api.stripe.com/v1/ > charges/{uri.var.chargeId}/refunds"/> > </endpoint> > </call> > </sequence> > </template> > > > > *Proxy for this service:* > <?xml version="1.0" encoding="UTF-8"?> > <proxy xmlns="http://ws.apache.org/ns/synapse" > name="stripe_createANewRefund" > transports="https,http" > statistics="disable" > trace="disable" > startOnLoad="true"> > <target> > <inSequence> > <property name="chargeId" expression="json-eval($.chargeId)"/> > <property name="amount" expression="json-eval($.amount)"/> > <stripe.createANewRefund> > <chargeId>{$ctx:chargeId}</chargeId> > <amount>{$ctx:amount}</amount> > </stripe.createANewRefund> > <respond/> > </inSequence> > <outSequence> > <send/> > </outSequence> > </target> > <description/> > </proxy> > > > Thank you. > -- > <[email protected]> > Keerthika Mahendralingam > Associate Software Engineer > Mobile :+94 (0) 776 121144 > [email protected] <[email protected]> > -- Sivajothy Vanjikumaran *Senior Software Engineer* *Integration Technologies Team* *WSO2 Inc. http://wso2.com <http://wso2.com/>* *Mobile:(+94)777219209* [image: Facebook] <https://www.facebook.com/vanjikumaran> [image: Twitter] <https://twitter.com/vanjikumaran> [image: LinkedIn] <http://www.linkedin.com/pub/vanjikumaran-sivajothy/25/b31/293> [image: Blogger] <http://vanjikumaran.blogspot.com/> [image: SlideShare] <http://www.slideshare.net/vanjikumaran> This communication may contain privileged or other confidential information and is intended exclusively for the addressee/s. If you are not the intended recipient/s, or believe that you may have received this communication in error, please reply to the sender indicating that fact and delete the copy you received and in addition, you should not print, copy, re-transmit, disseminate, or otherwise use the information contained in this communication. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
