PayPal Adaptive Payments ConvertCurrency - paypal

I am try to run the ConvertCurrency Adaptive Payments but can't find any sample code that doesn't use the SDK so I'm looking at the PDF from PayPal but I'm still confused. What format should these be in:
baseAmountList ap:CurrencyList
convertToCurrencyList ap:CurrencyCodeList
requestEnvelope common:RequestEnvelope
I have no idea what they mean by ap:CurrencyList. This doesn't work:
baseAmountList=".array( 'amount' => 15, 'code' => 'USD' )
So how should it be done?
Thanks in advance.

It would be XML. Here's a sample request and response.
<?xml version="1.0" encoding="utf-8"?>
<ConvertCurrencyRequest xmlns="http://svcs.paypal.com/types/ap">
<requestEnvelope xmlns="">
<detailLevel>ReturnAll</detailLevel>
<errorLanguage>en_US</errorLanguage>
</requestEnvelope>
<baseAmountList xmlns="">
<currency xmlns=""><code xmlns="">USD</code>
<amount xmlns="">100.00</amount>
</currency>
</baseAmountList>
<convertToCurrencyList xmlns="">
<currencyCode xmlns="">EUR</currencyCode>
<currencyCode xmlns="">AUD</currencyCode>
<currencyCode xmlns="">CAD</currencyCode>
</convertToCurrencyList>
</ConvertCurrencyRequest>
<?xml version='1.0' encoding='UTF-8'?>
<ns2:ConvertCurrencyResponse xmlns:ns2="http://svcs.paypal.com/types/ap">
<responseEnvelope>
<timestamp>2013-12-19T23:22:07.832-08:00</timestamp>
<ack>Success</ack>
<correlationId>0d0f271253d3c</correlationId>
<build>7935900</build>
</responseEnvelope>
<estimatedAmountTable>
<currencyConversionList>
<baseAmount><code>USD</code>
<amount>100.00</amount>
</baseAmount>
<currencyList>
<currency><code>EUR</code>
<amount>73.39</amount>
</currency>
<currency><code>AUD</code>
<amount>105.41</amount>
</currency>
<currency><code>CAD</code>
<amount>100.76</amount>
</currency>
</currencyList>
</currencyConversionList>
</estimatedAmountTable>
</ns2:ConvertCurrencyResponse>

Related

Fedex Delivery Date

I'm tracking a order using SOAP API for my website to get delivery date of the ordered item through Postman , it is running successfully but I'm getting only ship date and Actual pickup date ,I need to get delivery date and transit date if possible.
Here is my code which I'm sending :
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:v14="http://fedex.com/ws/track/v14">
<soapenv:Header/>
<soapenv:Body>
<v14:TrackRequest>
<v14:WebAuthenticationDetail>
<v14:UserCredential>
<v14:Key>userkey</v14:Key>
<v14:Password>userpassword</v14:Password>
</v14:UserCredential>
</v14:WebAuthenticationDetail>
<v14:ClientDetail>
<v14:AccountNumber>user account number</v14:AccountNumber>
<v14:MeterNumber>meter number</v14:MeterNumber>
</v14:ClientDetail>
<v14:TransactionDetail>
<v14:CustomerTransactionId>Track By
Number_v14</v14:CustomerTransactionId>
<v14:Localization>
<v14:LanguageCode>EN</v14:LanguageCode>
<v14:LocaleCode>US</v14:LocaleCode>
</v14:Localization>
</v14:TransactionDetail>
<v14:Version>
<v14:ServiceId>trck</v14:ServiceId>
<v14:Major>14</v14:Major>
<v14:Intermediate>0</v14:Intermediate>
<v14:Minor>0</v14:Minor>
</v14:Version>
<v14:SelectionDetails>
<v14:CarrierCode>FDXE</v14:CarrierCode>
<v14:PackageIdentifier>
<v14:Type>TRACKING_NUMBER_OR_DOORTAG</v14:Type>
<v14:Value>trackingnumber</v14:Value>
</v14:PackageIdentifier>
<v14:ShipmentAccountNumber/>
<v14:SecureSpodAccount/>
<v14:Destination>
<v14:GeographicCoordinates/>
</v14:Destination>
</v14:SelectionDetails>
<v14:ProcessingOptions>INCLUDE_DETAILED_SCANS</v14:ProcessingOptions>
</v14:TrackRequest>
</soapenv:Body>
</soapenv:Envelope>
and in response I'm getting this :
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<TrackReply xmlns="http://fedex.com/ws/track/v14">
<HighestSeverity>SUCCESS</HighestSeverity>
<Notifications>
<Severity>SUCCESS</Severity>
<Source>trck</Source>
<Code>0</Code>
<Message>Request was successfully processed.</Message>
<LocalizedMessage>Request was successfully processed.</LocalizedMessage>
</Notifications>
<TransactionDetail>
<CustomerTransactionId>Track By Number_v14</CustomerTransactionId>
<Localization>
<LanguageCode>EN</LanguageCode>
<LocaleCode>US</LocaleCode>
</Localization>
</TransactionDetail>
<Version>
<ServiceId>trck</ServiceId>
<Major>14</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<CompletedTrackDetails>
<HighestSeverity>SUCCESS</HighestSeverity>
<Notifications>
<Severity>SUCCESS</Severity>
<Source>trck</Source>
<Code>0</Code>
<Message>Request was successfully processed.</Message>
<LocalizedMessage>Request was successfully processed.</LocalizedMessage>
</Notifications>
<DuplicateWaybill>false</DuplicateWaybill>
<MoreData>false</MoreData>
<TrackDetailsCount>0</TrackDetailsCount>
<TrackDetails>
<Notification>
<Severity>SUCCESS</Severity>
<Source>trck</Source>
<Code>0</Code>
<Message>Request was successfully processed.</Message>
<LocalizedMessage>Request was successfully processed.</LocalizedMessage>
</Notification>
<TrackingNumber>trackingnumber</TrackingNumber>
<TrackingNumberUniqueIdentifier>uniquetrackingnumberFDEG</TrackingNumberUniqueIdentifier>
<StatusDetail>
<Location>
<Residential>false</Residential>
</Location>
</StatusDetail>
<CarrierCode>FDXG</CarrierCode>
<OperatingCompanyOrCarrierDescription>FedEx Ground</OperatingCompanyOrCarrierDescription>
<Service>
<Type>FEDEX_GROUND</Type>
</Service>
<PackageSequenceNumber>0</PackageSequenceNumber>
<PackageCount>0</PackageCount>
<DatesOrTimes>
<Type>ACTUAL_PICKUP</Type>
<DateOrTimestamp>2018-02-01T00:00:00</DateOrTimestamp>
</DatesOrTimes>
<DatesOrTimes>
<Type>SHIP</Type>
<DateOrTimestamp>2018-02-01T00:00:00</DateOrTimestamp>
</DatesOrTimes>
<DeliveryAttempts>0</DeliveryAttempts>
<TotalUniqueAddressCountInConsolidation>0</TotalUniqueAddressCountInConsolidation>
<DeliveryOptionEligibilityDetails>
<Option>INDIRECT_SIGNATURE_RELEASE</Option>
<Eligibility>INELIGIBLE</Eligibility>
</DeliveryOptionEligibilityDetails>
<DeliveryOptionEligibilityDetails>
<Option>REDIRECT_TO_HOLD_AT_LOCATION</Option>
<Eligibility>INELIGIBLE</Eligibility>
</DeliveryOptionEligibilityDetails>
<DeliveryOptionEligibilityDetails>
<Option>REROUTE</Option>
<Eligibility>INELIGIBLE</Eligibility>
</DeliveryOptionEligibilityDetails>
<DeliveryOptionEligibilityDetails>
<Option>RESCHEDULE</Option>
<Eligibility>INELIGIBLE</Eligibility>
</DeliveryOptionEligibilityDetails>
</TrackDetails>
</CompletedTrackDetails>
</TrackReply>
</SOAP-ENV:Body>
Notes:- I'm passing no headers since in fedex documentation ,nothing is mention about them.

DocuSign API not asking or setting the dateSigned though it is present in the xml

Having followed the example found earlier here on StackOverflow (dateSignedTabs does not work), I still fail to get a signature date to appear. Here's a snippet of the xml.
<?xml version="1.0" encoding="UTF-8"?>
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<emailSubject>Boiler Contract -00006)</emailSubject>
<status>sent</status>
<documents>
<document>
<documentId>1</documentId>
<name>VDBK SW6-CSIK-0001.pdf</name>
</document>
</documents>
<recipients>
<signers>
<signer>
<recipientId>1</recipientId>
<routingOrder>1</routingOrder>
<note>Team</note>
<email>joebloggs#gmail.com</email>
<name>Eric Test6-1</name>
<tabs>
<signHereTabs>
<signHere>
<xPosition>58</xPosition>
<yPosition>617</yPosition>
<documentId>1</documentId>
<pageNumber>1</pageNumber>
</signHere>
</signHereTabs>
<dateSignedTabs>
<dateSigned>
<xPosition>58</xPosition>
<yPosition>440</yPosition>
<tabLabel>Date Signed</tabLabel>
<name>Date Signed</name>
<documentId>1</documentId>
<pageNumber>1</pageNumber>
<recipientId>1</recipientId>
</dateSigned>
</dateSignedTabs>
</tabs>
</signer>
</signers>
</recipients>
</envelopeDefinition>
Can anybody spot why this is off?

Invalid Soap Call

Why doesn't this soap call work for this URL ?
http://services.aonaware.com/DictService/DictService.asmx?op=Define
<v:Envelope xmlns:i="http://www.w3.org/1999/XMLSchema-instance" xmlns:d="http://www.w3.org/1999/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<Define xmlns="http://tempuri.org/" id="o0" c:root="1">
<word i:type="d:string">Name</word>
</Define>
</v:Body>
</v:Envelope>
But this one does
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://services.aonaware.com/webservices/">
<soapenv:Header/>
<soapenv:Body>
<web:Define>
<!--Optional:-->
<web:word>Test</web:word>
</web:Define>
</soapenv:Body>
</soapenv:Envelope>
Because they are different: not only in content but also in namespace definition, to correct the first one you've to atleast use the correct namespace so use http://services.aonaware.com/webservices/ for your <Define> element as you do in the second one:
<v:Envelope xmlns:i="http://www.w3.org/1999/XMLSchema-instance" xmlns:d="http://www.w3.org/1999/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<Define xmlns="http://services.aonaware.com/webservices/" id="o0" c:root="1">
<word i:type="d:string">Name</word>
</Define>
</v:Body>
</v:Envelope>
Then make sure also that id an c:root are valid attributes in your xsd for <Definition> and i:type it's a correct one for <word>.
EDIT
I invoke http://services.aonaware.com/DictService/DictService.asmx with SOAPUI using my corrected request and it response correctly:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<DefineResponse xmlns="http://services.aonaware.com/webservices/">
<DefineResult>
<Word>Name</Word>
<Definitions>
<Definition>
<Word>Name</Word>
<Dictionary>
<Id>gcide</Id>
<Name>The Collaborative International Dictionary of English v.0.44</Name>
</Dictionary>
<WordDefinition>Name \Name\ (n[=a]m), n. [AS. nama; akin to D. naam, OS. & OHG.
...
[1913 Webster]</WordDefinition>
</Definition>
<Definition>
<Word>Name</Word>
<Dictionary>
<Id>gcide</Id>
<Name>The Collaborative International Dictionary of English v.0.44</Name>
</Dictionary>
<WordDefinition>Name \Name\ (n[=a]m), v. t. [imp. & p. p. {Named} (n[=a]md); p.
...
</WordDefinition>
</Definition>
</Definitions>
</DefineResult>
</DefineResponse>
</soap:Body>
</soap:Envelope>
Hope this helps,

Customer attributes not saving on Add

So I've been experimenting with adding customers to QuickBooks Online from a local database instance at our business. I want to keep track of our internal customer reference numbers in QBO, so have tried to save those to several different attributes like AcctNum, ExternalKey, ExternalId, AlternateId, or even directly to the Id attribute. After attempting to save to these fields, the return result looks good.
var qbCustomer = new Customer
{
AcctNum = customer.CustRef.ToString(CultureInfo.InvariantCulture),
ExternalKey = new IdType {idDomain = idDomainEnum.NG, Value = customer.CustRef.ToString(CultureInfo.InvariantCulture)},
Id = new IdType {idDomain = idDomainEnum.NG, Value = customer.CustRef.ToString(CultureInfo.InvariantCulture)},
Name = customer.CustName1,
FamilyName = customer.CustRef.ToString(CultureInfo.InvariantCulture),
};
Customer resultCustomer = dataServices.Add(qbCustomer);
But the next time I retrieve those customers, all of those fields are just null. Why are these fields not saving? Is there another more appropriate field to use to store an external ID besides just using one of the plain text fields (Name, Address, etc.)?
UPDATE:
Here's the raw XML exchange.
What I sent when adding a new customer:
<?xml version="1.0" encoding="utf-8"?>
<q1:Customer xmlns="http://www.intuit.com/sb/cdm/qbo" xmlns:q1="http://www.intuit.com/sb/cdm/v2">
<q1:Id>7</q1:Id>
<q1:ExternalKey>7</q1:ExternalKey>
<q1:TypeOf>Person</q1:TypeOf>
<q1:Name>Customer Name</q1:Name>
<q1:FamilyName>7</q1:FamilyName>
<q1:AcctNum>7</q1:AcctNum>
</q1:Customer>
Intuit's response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Customer xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<Id idDomain="QBO">12</Id>
<SyncToken>0</SyncToken>
<MetaData><CreateTime>2013-07-25T13:51:43-07:00</CreateTime><LastUpdatedTime>2013-07-25T13:51:43-07:00</LastUpdatedTime></MetaData>
<Name>Customer Name</Name>
<WebSite/>
<Email/>
<FamilyName>7</FamilyName>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField"><DefinitionId>Preferred Delivery Method</DefinitionId><Value>DONT</Value></CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField"><DefinitionId>Resale Number</DefinitionId></CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BooleanTypeCustomField"><DefinitionId>Bill With Parent</DefinitionId><Value>false</Value></CustomField>
<ShowAs>Erik Kunze/Magdalena Guarda Munoz</ShowAs>
<OpenBalance><Amount>0</Amount></OpenBalance>
</Customer>
My retrieval later:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<qbo:SearchResults xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<qbo:CdmCollections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Customers">
<Customer>
<Id idDomain="QBO">12</Id>
<SyncToken>0</SyncToken>
<MetaData><CreateTime>2013-07-25T13:51:43-07:00</CreateTime><LastUpdatedTime>2013-07-25T13:51:43-07:00</LastUpdatedTime></MetaData>
<Name>Customer Name</Name>
<WebSite/>
<Email/>
<FamilyName>7</FamilyName>
<CustomField xsi:type="BooleanTypeCustomField"><DefinitionId>Bill With Parent</DefinitionId><Value>false</Value></CustomField>
<CustomField xsi:type="StringTypeCustomField"><DefinitionId>Preferred Delivery Method</DefinitionId><Value>DONT</Value></CustomField>
<ShowAs>Erik Kunze/Magdalena Guarda Munoz</ShowAs>
<OpenBalance><Amount>0</Amount></OpenBalance>
</Customer>
</qbo:CdmCollections>
<qbo:Count>1</qbo:Count>
<qbo:CurrentPage>1</qbo:CurrentPage>
</qbo:SearchResults>
There's no AcctNum in the raw XML anywhere.
You are referring QBD's customer endpoint in apiexplorer.
Correct QBO link - https://developer.intuit.com/apiexplorer?apiname=V2QBO#Customer
Api Docs & Sample Create request - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/customer#Sample_Create_Request_XML
Simplest request body to create QBO customer -
<Customer xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns3="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd">
<TypeOf>Person</TypeOf>
<Name>TestQBCustomer12345</Name>
</Customer>
Simplest Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Customer xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<Id idDomain="QBO">14</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-07-25T14:08:49-07:00</CreateTime>
<LastUpdatedTime>2013-07-25T14:08:49-07:00</LastUpdatedTime>
</MetaData>
<Name>TestQBCustomer12345</Name>
<WebSite/>
<Email/>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField">
<DefinitionId>Preferred Delivery Method</DefinitionId>
<Value>DONT</Value>
</CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField">
<DefinitionId>Resale Number</DefinitionId>
</CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BooleanTypeCustomField">
<DefinitionId>Bill With Parent</DefinitionId>
<Value>false</Value>
</CustomField>
<ShowAs>TestQBCustomer12345</ShowAs>
<OpenBalance>
<Amount>0</Amount>
</OpenBalance>
</Customer>
You can test it first using apiexplorer then use the proper setters to do the same in your code.
Please let me know how it goes.
Thanks
Refer to the documentation:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/customer
You'll note that:
Id is an internal key generated by IPP/IDS - it's NOT something you can set yourself.
ExternalKey is the same situation - it's generated by IPP/IDS, not set-able by you.
ExternalId is marked "UNSUPPORTED FIELD."
AlternateId is marked "NOT SUPPORTED."
The only one of these fields that should work is:
AcctNum
If you're still having problems with that field, the way to troubleshoot is to get the raw XML outgoing request from Intuit, the raw XML that you get back (showing success) and then the raw response that you get back when you query it, showing that it's NULL.

Perl + SOAP::Lite

This is the SOAP document I'm trying to model using SOAP::Lite.
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<GetOrderByPartnerOrderID xmlns="http://api.geotrust.com/webtrust/query">
<Request>
<QueryRequestHeader>
<PartnerCode>partnercode</PartnerCode>
<AuthToken>
<UserName>username</UserName>
<Password>password</Password>
</AuthToken>
</QueryRequestHeader>
<PartnerOrderID>partnerid</PartnerOrderID>
</Request>
</GetOrderByPartnerOrderID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is the Perl code I'm using to model this document.
my $params = SOAP::Data->name("Request" =>
\SOAP::Data->value => (
\SOAP::Data->name("QueryRequestHeader" =>
\SOAP::Data->value(
SOAP::Data->name("PartnerCode" => $partnercode),
SOAP::Data->name("AuthToken" =>
\SOAP::Data->value(
SOAP::Data->name("UserName" => $username),
SOAP::Data->name("Password" => $password)
)
)
)
),
\SOAP::Data->name("PartnerOrderID" => $poid)
);
However, the SOAP Document generated by this code (I'm using SOAP::Lite with trace on) is as follows:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<GetOrderByPartnerOrderID xmlns="http://api.geotrust.com/webtrust/query">
<Request>
<QueryRequestHeader>
<PartnerCode>partnercode</PartnerCode>
<AuthToken>
<UserName>username</UserName>
<Password>password</Password>
</AuthToken>
</QueryRequestHeader>
</Request>
<Request>
<PartnerOrderID>partnerid</PartnerOrderID>
</Request>
</GetOrderByPartnerOrderID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
For some reason, it closes the Request tag, and then opens it again. It seems like it should be an easy fix, but I've tried everything I can think of and can't figure it out. Any help would be greatly appreciated.
Figured it out. Had \SOAP::Data->value => ( instead of \SOAP::Data->value(.