Hi,

I have the following issue when sending a json.

following is the required format

{
  "intent":"sale",
  "payer":{
    "payment_method":"credit_card",
    "funding_instruments":[
      {
        "credit_card":{
          "number":"4417119669820331",
          "type":"visa",
          "expire_month":11,
          "expire_year":2018,
          "cvv2":"874",
          "first_name":"Joe",
          "last_name":"Shopper",
          "billing_address":{
            "line1":"52 N Main ST",
            "city":"Johnstown",
            "country_code":"US",
            "postal_code":"43210",
            "state":"OH"
          }
        }
      }
    ]
  },
  "transactions":[
    {
      "amount":{
        "total":"7.47",
        "currency":"USD",
        "details":{
          "subtotal":"7.41",
          "tax":"0.03",
          "shipping":"0.03"
        }
      },
      "description":"This is the payment transaction description."
    }
  ]
}

So I set the payload using following configuration

         <payloadFactory media-type="json">

<format>{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"4417119669820331","type":"visa","expire_month":11,"expire_year":2018,"cvv2":"874","first_name":"Joe","last_name":"Shopper","billing_address":{"line1":"52
N Main
ST","city":"Johnstown","country_code":"US","postal_code":"43210","state":"OH"}}}]},"transactions":[{"amount":{"total":"0.47","currency":"USD","details":{"subtotal":"0.41","tax":"0.03","shipping":"0.03"}},"description":"This
is the payment transaction description."}]}</format>
            <args/>
         </payloadFactory>


However following is the actual wire log when sending.

{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":{"credit_card":{"number":"4417119669820331","type":"visa","expire_month":"11","expire_year":"2018","cvv2":"874","first_name":"Joe","last_name":"Shopper","billing_address":{"line1":"52
N Main
ST","city":"Johnstown","country_code":"US","postal_code":"43210","state":"OH"}}}},"transactions":{"amount":{"total":"0.47","currency":"USD","details":{"subtotal":"0.41","tax":"0.03","shipping":"0.03"}},"description":"This
is the payment transaction description."}}[\r][\n]"


I noticed that the '[' and ']'  are missing when sending to paypal. I guess
this is because it transforms the JSON to XML and XML to JSON before
sending. It is causing this.

Any idea to solve this?

thx

-- 
Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
T: +1 408 754 7388
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to