|
Rank: Starting Member
Groups: Registered
Joined: 8/29/2003 Posts: 13 Location: ,
|
Hello here,
I am trying to perform a reference transaction via SOAP-PHP, and currently I use the following XML schema which I am not sure it is correct:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" SOAP-ENV:mustUnderstand="1"> <Credentials xmlns="urn:ebay:apis:eBLBaseComponents"> <Username>[username]</Username> <Password>[password]</Password> <Subject/> </Credentials> </RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body> <DoReferenceTransactionReq xmlns="urn:ebay:api:PayPalAPI"> <DoReferenceTransactionRequest xsi:type="ns:DoReferenceTransactionRequestType"> <Version xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="xsd:string">1.0</Version> <ReferenceID xsi:type="xsd:string">0JE83805449092000</ReferenceID> <PaymentAction xsi:type="xsd:string">Sale</PaymentAction> <PaymentDetails xsi:type="ebl:PaymentDetailsType"> <OrderTotal currencyID="USD" xsl:type="cc:BasicAmountType">0.02</OrderTotal> </PaymentDetails> </DoReferenceTransactionRequest> </DoReferenceTransactionReq> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
I am asking this because if I send out that message to the PayPal API server, I get the following error response:
<?xml version="1.0" encoding="UTF-8"?> <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI"> <soap-env:header> <security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"></security> <requestercredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"> <credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"> <username xsi:type="xs:string"> </username><password xsi:type="xs:string"> </password><signature xsi:type="xs:string"> </signature><subject xsi:type="xs:string"> </subject> </credentials> </requestercredentials> </soap-env:header> <soap-env:body id="_0"> <doreferencetransactionresponse xmlns="urn:ebay:api:PayPalAPI"> <timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2012-01-25T21:33:48Z</timestamp> <ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</ack> <correlationid xmlns="urn:ebay:apis:eBLBaseComponents">fb701ea5a0f6c</correlationid> <errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType"> <shortmessage xsi:type="xs:string">Missing Parameter</shortmessage> <longmessage xsi:type="xs:string">ReferenceID : Mandatory parameter missing</longmessage> <errorcode xsi:type="xs:token">81253</errorcode> <severitycode xmlns="urn:ebay:apis:eBLBaseComponents">Error</severitycode> </errors><version xmlns="urn:ebay:apis:eBLBaseComponents">1.0</version> <build xmlns="urn:ebay:apis:eBLBaseComponents">2488002</build> <doreferencetransactionresponsedetails xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:DoReferenceTransactionResponseDetailsType"> </doreferencetransactionresponsedetails> </doreferencetransactionresponse> </soap-env:body> </soap-env:envelope>
Anyone can tell me what's wrong with my request above? How should I reformat it?
Thank you in advance for any help!
Sincerely, Fab.
|
|
Rank: Starting Member
Groups: Registered
Joined: 8/29/2003 Posts: 13 Location: ,
|
Problem solved, I forgot to add DoReferenceTransactionRequestDetails.
Here is the revised request:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" SOAP-ENV:mustUnderstand="1"> <Credentials xmlns="urn:ebay:apis:eBLBaseComponents"> <Username>au_xxxxx_biz_api1.gmail.com</Username> <Password>xxxx</Password> <Signature>xxxxxx-krqW-xt4ywNo5emjH3Pr9ztc</Signature> </Credentials> </RequesterCredentials> </SOAP-ENV:Header> <SOAP-ENV:Body> <DoReferenceTransactionReq xmlns="urn:ebay:api:PayPalAPI"> <DoReferenceTransactionRequest> <Version xmlns="urn:ebay:apis:eBLBaseComponents">85.0</Version> <DoReferenceTransactionRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents"> <ReferenceID>B-83T7xxxxxxx82N</ReferenceID> <PaymentAction>Sale</PaymentAction> <PaymentDetails> <OrderTotal currencyID="USD" xmlns="urn:ebay:apis:eBLBaseComponents">3.01</OrderTotal> </PaymentDetails> </DoReferenceTransactionRequestDetails> </DoReferenceTransactionRequest> </DoReferenceTransactionReq> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
|