I'm currently trying to implements payment method of my client onto my application. To show the payment page, I need to perform request to their url with body information about the payment. The response is html of the payment page. Then I print the html to the view.
But whenever I clicked pay button on the generated view, error occured say that session is invalid, it's because even the payment page is showing up it's still on our host (cross domain problem). I need to click the pay button from their host, it's mean that my application need to be redirected to their host.
Can we redirect to another url but attach body on the header of the request?
I want to redirect to this url "http://payment.api.net/merchant/init?corpid=CN000001", but including this body request.
<order>
<corp>NN01</corp>
<amount>20.0</amount>
<currency>USD</currency>
<ordernumber>10010111</ordernumber>
<redirect>http://mycallback.api.net/store/payment/callback</redirect>
<randomstring>NnwLRINzhOgvmvyunzZIrUtCgvmvy</randomstring>
<hash>4792e72f5e1860b220420ad3f22f005c9d2fce83f3a138336869780153145700</hash>
</order>
How to achieve this?
UPDATE
It's impossible
SOLUTION
See ainur answer, I don't understand why, but it's working like a charm