Monday, 8 May 2017

Sending Soap Request Nodejs

Please help as i want to replicate the attached Postman request in Nodejs . I have tried soap node , easysoap etc but these libraries require a method to be defined and the POST URL should be ?WSDL to read from . In my case it is https://secure.paygate.co.za/payhost/process.trans

Header - Content-Type - text/xml

Request -

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hs="http://www.paygate.co.za/PayHOST">
 <soapenv:Body>
  <hs:SinglePaymentRequest>
<hs:CardPaymentRequest>
<hs:Account>
<hs:PayGateId>10011072130</hs:PayGateId>
<hs:Password>test</hs:Password>
</hs:Account>
<hs:Customer>
<hs:Title>Mr</hs:Title>
<hs:FirstName>Joe</hs:FirstName>
<hs:LastName>Soap</hs:LastName>
<hs:Telephone>0861234567</hs:Telephone>
<hs:Mobile>0735552233</hs:Mobile>
<hs:Email>joe@soap.com</hs:Email>
</hs:Customer>
<hs:CardNumber>4000000000000002</hs:CardNumber>
<hs:CardExpiryDate>122018</hs:CardExpiryDate>
<hs:CVV>999</hs:CVV>
<hs:BudgetPeriod>0</hs:BudgetPeriod>
<!-- 3D secure redirect object -->
<hs:Redirect>
<hs:NotifyUrl>https://www.mytestsite.com/notify</hs:NotifyUrl>
<hs:ReturnUrl>https://www.mytestsite.com/return</hs:ReturnUrl>
</hs:Redirect>
<hs:Order>
<hs:MerchantOrderId>INV101</hs:MerchantOrderId>
<hs:Currency>ZAR</hs:Currency>
<hs:Amount>100</hs:Amount>
</hs:Order>
</hs:CardPaymentRequest>
</hs:SinglePaymentRequest>
 </soapenv:Body>
</soapenv:Envelope>

ANy help or suggestions will be appreciated . Thanks



via prakhar srivastava

No comments:

Post a Comment