Sales Receipt Process Credit Card Payment QBO V2 - intuit-partner-platform

I am trying to automatically create a sales receipt AND charge the credit card through QBOE. The APIs appear to indicate this is possible by setting the Detail->CreditCard->CreditChargeInfo. I would expect to receive some information in the CreditChargeResponse Element, however I receive no information in the response regarding the attempted CC charge. Furthermore a sales receipt is created and the proper payment method is selected but no CC information is saved under the payment and it does not appear that there is an attempt to charge the card provided in the below request. I'm left with the following questions
Are there elements required that I am missing in order to retain and charge the CC within QBOE?
Is there any documentation regarding the business logic required in order to process a CC using the IPP APIs?
Can anyone provide a working example of how this request should look?
REQUEST :::
<SalesReceipt xmlns='http://www.intuit.com/sb/cdm/v2'>
<Header xmlns:ns3='http://www.intuit.com/sb/cdm/v2'>
<ns3:TxnDate>2013-04-17-07:00</ns3:TxnDate>
<ns3:TaxRate>9.2</ns3:TaxRate>
<ns3:TaxAmt>0.138</ns3:TaxAmt>
<ns3:CustomerId>1027</ns3:CustomerId>
<ns3:TotalAmt>1.64</ns3:TotalAmt>
<ShipAddr>
<Line1>1234 Fake St SE</Line1>
<City>Fake City</City>
<CountrySubDivisionCode>WA</CountrySubDivisionCode>
<PostalCode>98258</PostalCode>
</ShipAddr>
<ns3:PaymentMethodId>13</ns3:PaymentMethodId>
<ns3:PaymentMethodName>MasterCard</ns3:PaymentMethodName>
<ns3:Detail xmlns:ns5='http://www.intuit.com/sb/cdm/v2'>
<ns5:CreditCard xmlns:ns7='http://www.intuit.com/sb/cdm/v2'>
<ns7:CreditChargeInfo xmlns:ns8='http://www.intuit.com/sb/cdm/v2'>
<ns8:Number>[ACTUALY_VALID_CC#]</ns8:Number>
<ns8:Token>************1111</ns8:Token>
<ns8:Type>MasterCard</ns8:Type>
<ns8:NameOnAcct>Andrew L Reifers</ns8:NameOnAcct>
<ns8:CcExpirMn>**</ns8:CcExpirMn>
<ns8:CcExpirYr>**</ns8:CcExpirYr>
<ns8:BillAddrStreet>1234 Fake St SE</ns8:BillAddrStreet>
<ns8:ZipCode>98258</ns8:ZipCode>
<ns8:Cvv>***</ns8:Cvv>
<ns8:CCTxnMode>CardPresent</ns8:CCTxnMode>
<ns8:CCTxnType>Charge</ns8:CCTxnType>
</ns7:CreditChargeInfo>
</ns5:CreditCard>
</ns3:Detail>
</Header>
<Line xmlns:ns11='http://www.intuit.com/sb/cdm/v2'>
<ns11:Id>1</ns11:Id>
<ns11:Desc>Fake Sale Item</ns11:Desc>
<ns11:Amount>1.50</ns11:Amount>
<ns11:Taxable>true</ns11:Taxable>
<ns11:ItemId>359</ns11:ItemId>
<ns11:UnitPrice>0.50</ns11:UnitPrice>
<ns11:Qty>3</ns11:Qty>
</Line>
RESPONSE :::
<SalesReceipt 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">7413</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-04-17T11:50:06-07:00</CreateTime>
<LastUpdatedTime>2013-04-17T11:50:06-07:00</LastUpdatedTime>
</MetaData>
<Header>
<DocNumber>4170</DocNumber>
<TxnDate>2013-04-17-07:00</TxnDate>
<CustomerId idDomain="QBO">1027</CustomerId>
<SalesTaxCodeId idDomain="QBO">1</SalesTaxCodeId>
<SalesTaxCodeName>IS_TAXABLE</SalesTaxCodeName>
<SubTotalAmt>1.50</SubTotalAmt>
<TaxRate>9.2</TaxRate>
<TaxAmt>0.14</TaxAmt>
<TotalAmt>1.64</TotalAmt>
<ToBePrinted>false</ToBePrinted>
<ToBeEmailed>false</ToBeEmailed>
<ShipAddr>
<Line1>1234 Fake St SE</Line1>
<City>Fake City</City>
<CountrySubDivisionCode>WA</CountrySubDivisionCode>
<PostalCode>98258</PostalCode>
<GeoCode>LAT=47.974638,LNG=-122.073567</GeoCode>
</ShipAddr>
<ShipMethodId idDomain="QBO"/>
<DepositToAccountId idDomain="QBO">37</DepositToAccountId>
<DepositToAccountName>Undeposited Funds</DepositToAccountName>
<PaymentMethodId idDomain="QBO">13</PaymentMethodId>
<PaymentMethodName>MasterCard</PaymentMethodName>
<DiscountTaxable>true</DiscountTaxable>
</Header>
<Line>
<Id>1</Id>
<Desc>Fake Sale Item</Desc>
<Amount>1.50</Amount>
<Taxable>true</Taxable>
<ItemId>359</ItemId>
<UnitPrice>0.5</UnitPrice>
<Qty>3</Qty>
</Line>

Unfortunately v2 does not support credit card, the annotation explains that it is a readonly field.
There is no v2 workaround. The supported api is v3, if you would like to sign up for the v3 beta here:
http://ippblog.intuit.com/blog/2013/03/application-for-early-access-to-quickbooks-api-v3.html
thanks
Jarred

The workaround for the V2 IPP APIs is to create an invoice rather than a sales receipt and then immediately accept payment for the invoice using the Payment API with an appropriate Credit Card and setting the ProcessPayment boolean to true. As Jared mentioned : It is not possible to apply this payment to a Sales Receipt.

Related

Meeting request properties not settable in EWS SOAP calls?

I (re)create (recurrent) events in Exchange Server talking to Exchange Web Services with pure SOAP calls.
When these events are actually meeting requests I try to maintain some meeting properties that were previously retrieved, so I put them in the CreateItem call:
AllowNewTimeProposal
AppointmentReplyTime
ConferenceType
IsCancelled
IsOnlineMeeting
IsResponseRequested
MeetingWorkspaceURL
MeetingRequestWasSent
MyResponseType
NetShowURL
Organizer
OptionalAttendees
RequiredAttendees
Resources
At first I got the error Set action is invalid for property for the properties IsCancelled and IsOnlineMeeting, and thought O, these are probably set automatically, but now I even get them for the Organizer on the event where the user is the organizer.
What is going on?
Are all these meeting properties not settable in a CreateItem call?
Have I just accidentally bumped into three that are not settable - where can I find a list of what is actually settable (the docs at e.g. https://msdn.microsoft.com/en-us/library/aa580675%28v=exchg.80%29.aspx do mention the occasional read-only element, but not these)?
Request:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
<soapenv:Header>
<typ:RequestServerVersion Version="Exchange2007_SP1"/>
<typ:MailboxCulture>en-US</typ:MailboxCulture>
<typ:TimeZoneContext>
<typ:TimeZoneDefinition Id="W. Europe Standard Time"/>
</typ:TimeZoneContext>
</soapenv:Header>
<soapenv:Body>
<mes:CreateItem SendMeetingInvitations="SendToNone">
<mes:SavedItemFolderId>
<typ:DistinguishedFolderId Id="calendar">
<typ:Mailbox>
<typ:EmailAddress>jan#TimeTellBV567.onmicrosoft.com</typ:EmailAddress>
</typ:Mailbox>
</typ:DistinguishedFolderId>
</mes:SavedItemFolderId>
<mes:Items>
<typ:CalendarItem>
<typ:Subject>recuir MODI</typ:Subject>
<typ:Body BodyType="Text"></typ:Body>
<typ:Categories>
<typ:String>TimeTell</typ:String>
</typ:Categories>
<typ:ReminderIsSet>false</typ:ReminderIsSet>
<typ:Start>2015-07-23T11:30:00.000+02:00</typ:Start>
<typ:End>2015-07-23T12:00:00.000+02:00</typ:End>
<typ:IsAllDayEvent>false</typ:IsAllDayEvent>
<typ:LegacyFreeBusyStatus>Busy</typ:LegacyFreeBusyStatus>
<typ:Location>daar</typ:Location>
<typ:IsResponseRequested>true</typ:IsResponseRequested>
<typ:MyResponseType>Organizer</typ:MyResponseType>
<typ:Organizer>
<typ:Mailbox>
<typ:Name>Jan</typ:Name>
<typ:EmailAddress>jan#somewhere.onmicrosoft.com</typ:EmailAddress>
<typ:RoutingType>SMTP</typ:RoutingType>
</typ:Mailbox>
</typ:Organizer>
<typ:RequiredAttendees>
<typ:Attendee>
<typ:Mailbox>
<typ:Name>Ben</typ:Name>
<typ:EmailAddress>ben#somewhere.onmicrosoft.com</typ:EmailAddress>
<typ:RoutingType>SMTP</typ:RoutingType>
</typ:Mailbox>
<typ:ResponseType>Unknown</typ:ResponseType>
</typ:Attendee>
</typ:RequiredAttendees>
<typ:Recurrence>
<typ:WeeklyRecurrence>
<typ:Interval>1</typ:Interval>
<typ:DaysOfWeek>Thursday</typ:DaysOfWeek>
</typ:WeeklyRecurrence>
<typ:NoEndRecurrence>
<typ:StartDate>2015-07-23+01:00</typ:StartDate>
</typ:NoEndRecurrence>
</typ:Recurrence>
<typ:MeetingTimeZone TimeZoneName="W. Europe Standard Time"/>
<typ:ConferenceType>0</typ:ConferenceType>
<typ:AllowNewTimeProposal>true</typ:AllowNewTimeProposal>
<typ:IsOnlineMeeting>false</typ:IsOnlineMeeting>
</typ:CalendarItem>
</mes:Items>
</mes:CreateItem>
</soapenv:Body>
</soapenv:Envelope>
Response:
<Envelope>
<Header>
<ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="213" MinorBuildNumber="21" Version="V2_47"/>
</Header>
<Body>
<CreateItemResponse>
<ResponseMessages>
<CreateItemResponseMessage ResponseClass="Error">
<MessageText>Set action is invalid for property.</MessageText>
<ResponseCode>ErrorInvalidPropertySet</ResponseCode>
<DescriptiveLinkKey>0</DescriptiveLinkKey>
<MessageXml>
<FieldURI FieldURI="calendar:Organizer"/>
</MessageXml>
<Items/>
</CreateItemResponseMessage>
</ResponseMessages>
</CreateItemResponse>
</Body>
</Envelope>
I'm currently testing with the organizer in his own calander, against Office 365, but as you can see from the request I want this to work from Exchange2007_SP1 up.
(Answering my own question)
Mmm, that question was a bit of a false alarm, but I'm leaving it here because the information is hard to find.
It turns out that the properties I attempted to modify were indeed all read-only: IsCancelled, IsOnlineMeeting, MeetingRequestWasSent and Organizer.
Quoting Kim Brand from an answer in the 'Exchange EWS set CalendarItem Organizer' post at the MS Exchange Development Forum:
Organizer is a read-only property, which means that you can't "set" that property. That's why you are seeing the error message "Set action is invalid for property".
Organizer is the party responsible for coordinating meeting attendence, and its value gets automatically set to the user that creates the CalendarItem (unless Delegate Access is used).
When I leave the above properties out of my CreateItem call, it works. A GetItem on the created/updated appointment shows that Organizer is indeed set:
<t:Organizer>
<t:Mailbox>
<t:Name>Jan</t:Name>
<t:EmailAddress>/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=A9403513C6AA40E68E05776BFEA9C117-JAN</t:EmailAddress>
<t:RoutingType>EX</t:RoutingType>
<t:MailboxType>OneOff</t:MailboxType>
</t:Mailbox>
</t:Organizer>
[Edited to add]:
It is possible to set readonly properties through MAPI, see my other post
How to 'set' read-only calendar appointment properties (related to meetings)?

ValidationError when sparse updating a Payment trying to specify new LinkedTxn lines

I am trying to perform a sparse update on a QuickBooks Online Payment object using the .NET SDK. For some reason as soon as I try to specify a <Line> element in the update request, I get a ValidationError requiring a CustomerRef.
Request:
<?xml version="1.0"?>
<Payment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sparse="true" xmlns="http://schema.intuit.com/finance/v3">
<Id>1060</Id>
<SyncToken>3</SyncToken>
<TxnDate>2014-11-25</TxnDate>
<PrivateNote />
<Line>
<Amount>390.0000</Amount>
<LinkedTxn>
<TxnId>1308</TxnId>
<TxnType>Invoice</TxnType>
</LinkedTxn>
</Line>
<TotalAmt>390.0000</TotalAmt>
</Payment>
Response:
{"Fault": {
"Error": [{
"Message":"Required param missing, need to supply the required value for the API",
"Detail":"Required parameter CustomerRef is missing in the request",
"code":"2020",
"element":"Payment"}],
"type":"ValidationFault"},
"time":"2015-01-20T07:20:15.191-08:00"}
I thought a sparse update meant that anything you did not specify stayed the same as the original entity. I can't see anything that says one way or the other in the documentation. Do I need to fetch the CustomerRef from the current entity to feed it back to the API and keep it happy, or am I just doing something wrong?
Although this is Sparse update but I believe the customerref is required, as a 'validation check for Customer' is needed when you send the Update request. This check is needed to verify that CustomerRef for Updated payment is same as the Invoice's CustomerRef. So, you should send it in your request.

Getting the Unique Transaction ID seen by the customer from Express Checkout

I'm using PayPal Express Checkout on a sandbox account, and i'm trying to link up the Unique Transaction ID on the "customer" paypal site with the completed transaction via Express Checkout.
My DoExpressCheckoutPayment returned:
TOKEN=EC%2d2KG36160AM8868619&
SUCCESSPAGEREDIRECTREQUESTED=false&
TIMESTAMP=2015%2d01%2d29T09%3a45%3a09Z&
CORRELATIONID=44060412ed341&
ACK=Success&
VERSION=93&BUILD=15009693&
INSURANCEOPTIONSELECTED=false&
SHIPPINGOPTIONISDEFAULT=false&
PAYMENTINFO_0_TRANSACTIONID=011446947E558235S&
PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout&
PAYMENTINFO_0_PAYMENTTYPE=instant&
PAYMENTINFO_0_ORDERTIME=2015%2d01%2d29T09%3a45%3a08Z&
PAYMENTINFO_0_AMT=7%2e98&
PAYMENTINFO_0_FEEAMT=0%2e47&
PAYMENTINFO_0_TAXAMT=0%2e00&
PAYMENTINFO_0_CURRENCYCODE=GBP&
PAYMENTINFO_0_PAYMENTSTATUS=Completed&
PAYMENTINFO_0_PENDINGREASON=None&
PAYMENTINFO_0_REASONCODE=None&
PAYMENTINFO_0_PROTECTIONELIGIBILITY=Ineligible&
PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=None&
PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=W9SM36U76AXSS&
PAYMENTINFO_0_ERRORCODE=0&
PAYMENTINFO_0_ACK=Success
Then my GetExpressCheckoutDetails returned:
TOKEN=EC%2d2KG36160AM8868619&
BILLINGAGREEMENTACCEPTEDSTATUS=0&
CHECKOUTSTATUS=PaymentActionCompleted&
TIMESTAMP=2015%2d01%2d29T09%3a45%3a33Z&
CORRELATIONID=80e00a0067bea&
ACK=Success&
VERSION=93&
BUILD=15009693&
EMAIL=test1%40sud%2eco2euk&
PAYERID=H54VEN293PLFL&
PAYERSTATUS=verified&
FIRSTNAME=Test&
LASTNAME=User&
COUNTRYCODE=GB&
CURRENCYCODE=GBP&
AMT=7%2e98&
SHIPPINGAMT=0%2e00&
HANDLINGAMT=0%2e00&
TAXAMT=0%2e00&
INSURANCEAMT=0%2e00&
SHIPDISCAMT=0%2e00&
PAYMENTREQUEST_0_CURRENCYCODE=GBP&
PAYMENTREQUEST_0_AMT=7%2e98&
PAYMENTREQUEST_0_SHIPPINGAMT=0%2e00&
PAYMENTREQUEST_0_HANDLINGAMT=0%2e00&
PAYMENTREQUEST_0_TAXAMT=0%2e00&
PAYMENTREQUEST_0_INSURANCEAMT=0%2e00&
PAYMENTREQUEST_0_SHIPDISCAMT=0%2e00&
PAYMENTREQUEST_0_TRANSACTIONID=011446947E558235S&
PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED=false&
PAYMENTREQUESTINFO_0_TRANSACTIONID=011446947E558235S&
PAYMENTREQUESTINFO_0_ERRORCODE=0
But the customer site says:
PayPal Express Checkout Payment Sent (Unique Transaction ID 7PK53077PJ222701T)
Oh..the (painful) memories :) That aforementioned "oddity" also exists elsewhere - e.g. eBay transactions
IINM, you'll need to send your own "custom ID" - the Invoice Id mentioned above (which is displayed to the end user) so both ends have some visual reference to a transaction.
In the REST API (unsure in Classic, haven't tried), if you send an Order, the Order Number (finally) is shared on both ends (same for both). Though it wouldn't hurt to still send your own "custom Id"/"Invoice Id".
Buyer/Customer Paypal UI:
Seller/Merchant Paypal UI:
Hth...

PayPal Payflow: How to verify in one request, and then authorize in another without saving CC info?

I'm building a book store and I am building the checkout using PayPal Payflow . This is the checkout flow:
Shipping info --> Billing info |verify CC using Paypal| --> Order summary --> Submit |authorize CC using Paypal|
Shipping info: fill out shipping address, nothing special here
Billing info: fill out your billing address + credit card info. Don't save the credit card info since it's against standards, instead just send the CC number, expiration date, and CVV directly to PayPal to verify. PayPal approves.
Order summary: The order sees the summary of his order before he submits the order. He presses submit and another request to PayPal is sent to authorize the funds.
However, the CC info vanishes after #2, so how would I persist that data to #3 so that I can send it to PayPal again?
Can I just use the ORIGID to point to the PNREF ? The documentation says I have to do a full request with the whole params list (including CC info, CVV, exp date, etc).
TRXTYPE=A&TENDER=C&PWD=x1y2z3&PARTNER=PayPal&VENDOR=SuperMerchant&USER=S
uperMerchant&ACCT=5555555555554444&EXPDATE=0308&AMT=123.00&COMMENT1=Seco
nd purchase&COMMENT2=Low risk customer&INVNUM=123456789&STREET=5199
MAPLE&ZIP=94588
Or am I just misunderstanding what authorization means? Isn't authorization actually reserving funds in the user's CC? So that shouldn't be done until the user presses submit order right?
I figured it out.
The documentation here: https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_payflowpro_guide.pdf
on page 40 mentions it briefly, but doesn't go into much detail about this checkout flow even though it seems pretty common.
My assumption was right, in that I could just do an address verification request first with all the CC info, and use the PNREF returned. I save the PNREF id in my session and reuse it to submit a request that looks like this:
def authorize_transaction(pnref)
make_request(authorization_data(pnref))
end
def authorization_data(pnref)
{
"TRXTYPE" => "A",
"TENDER" => "C",
"USER" => PAYPAL_API["user"],
"PWD" => PAYPAL_API["pwd"],
"VENDOR" => PAYPAL_API["user"],
"PARTNER" => "Paypal",
"AMT" => purchase.total_price,
"ORIGID" => pnref,
"VERBOSITY" => "HIGH"
}
end
And receive the desired response:
{"RESULT"=>"0", "PNREF"=>"A10A6A9C08E1", "RESPMSG"=>"Approved", "AUTHCODE"=>"752PNI", "AVSADDR"=>"Y", "AVSZIP"=>"Y", "HOSTCODE"=>"A", "PROCAVS"=>"Y", "VISACARDLEVEL"=>"12", "TRANSTIME"=>"2014-01-31 11:53:56", "FIRSTNAME"=>"net", "LASTNAME"=>"theory", "AMT"=>"15.64", "ACCT"=>"1111", "EXPDATE"=>"0115", "CARDTYPE"=>"0", "IAVS"=>"N"}

paypal checkout display shipping costs but does not include them in transaction

I do not know if the issue is in code or the paypal account settings. Paypal displays correctly the shipping cost, it displays the correct total (item price + shipping),
but in fact, the transactions includes only the item price, not the shipping costs.
I have been unable to find out what is wrong. if paypal can display it correctly, why cant it include it properly in the transaction ?
here is the request sent to paypal:
$padata = '&CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTACTION=Sale'.
'&ALLOWNOTE=1'.
'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTREQUEST_0_AMT='.urlencode($TotalPrice).
'&PAYMENTREQUEST_0_ITEMAMT='.urlencode($ItemTotalPrice).
'&L_PAYMENTREQUEST_0_QTY0='. urlencode($ItemQty).
'&L_PAYMENTREQUEST_0_AMT0='.urlencode($ItemPrice).
'&PAYMENTREQUEST_0_SHIPPINGAMT='.urlencode($deliveryCost).
'&L_PAYMENTREQUEST_0_NAME0='.urlencode($ItemName).
'&L_PAYMENTREQUEST_0_NUMBER0='.urlencode($ItemNumber).
'&AMT='.urlencode($ItemTotalPrice).
'&RETURNURL='.urlencode($PayPalReturnURL ).
'&CANCELURL='.urlencode($PayPalCancelURL);
The param for shipping that I used is :
PAYMENTREQUEST_0_SHIPPINGAMT
is it correct ? is a complementary one needed ?
Are you supplying all of your PAYMENTREQUEST_0_* and L_PAYMENTREQUEST_0_* variables in your DoExpressCheckoutPayment call as well as your SetExpressCheckout call?
SetExpressCheckout will control what the buyer sees when they go to check out on PayPal. DoExpressCheckoutPayment will control what the buyer is actually charged for. Therefore, if you want your shipping charge to be included in the transaction, you need to make sure that it's included in both calls.
for the records, correct params for DoExpressCheckoutPayment :
$padata = '&TOKEN='.urlencode($token).
'&PAYERID='.urlencode($playerid).
'&PAYMENTACTION='.urlencode("SALE").
'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTREQUEST_0_SHIPPINGAMT='.urlencode($deliveryCost).
'&PAYMENTREQUEST_0_AMT='.urlencode($TotalPrice).
'&PAYMENTREQUEST_0_ITEMAMT='.urlencode($ItemTotalPrice).
'&CURRENCYCODE='.urlencode($PayPalCurrencyCode);