<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CyberSource Simple Order API Capture PayPal transaction in cybersource APIs</title>
    <link>https://community.developer.cybersource.com/t5/cybersource-APIs/CyberSource-Simple-Order-API-Capture-PayPal-transaction/m-p/83872#M319</link>
    <description>&lt;P&gt;I'm attempting to capture a PayPal transaction that has been authorized using the PayPal button. I'm trying to use CyberSource Simple Order API to do this. I have the only 3 pieces of information that seem to come back from the PayPal button are:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;payerID,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;paymentID&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;paymentToken. I've tried a few ways of handing this off to the Simple Order API, but always get a 102 code with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DECLINE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;message in the response. Cybersource's logging system indicates this is because&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;The following request field(s) is either invalid or missing: request_token.&lt;/P&gt;&lt;P&gt;Do I need to conduct the whole transaction - authorize and capture - via cybersource? Or what is the way I can take the paypal-generated button and authorize a transaction, then capture it via CyberSource?&lt;/P&gt;&lt;P&gt;Here's my code snippet for the CyberSource SOAPI request:&lt;/P&gt;&lt;PRE&gt;RequestMessage request = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; RequestMessage
{
    merchantID = WebConfigurationManager.AppSettings[&lt;SPAN class=""&gt;"cybs.merchantID"&lt;/SPAN&gt;]
    , payPalDoCaptureService = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PayPalDoCaptureService {
            run = &lt;SPAN class=""&gt;"true"&lt;/SPAN&gt;
            , invoiceNumber = orders
            , paypalAuthorizationId = authId
            , paypalAuthorizationRequestToken = requestToken
            , completeType = &lt;SPAN class=""&gt;"Complete"&lt;/SPAN&gt; }
    , clientApplication = &lt;SPAN class=""&gt;"MyClient Application"&lt;/SPAN&gt;
    , clientApplicationVersion = &lt;SPAN class=""&gt;"2.0"&lt;/SPAN&gt;
    , clientApplicationUser = userName
    , clientEnvironment = WebConfigurationManager.AppSettings[&lt;SPAN class=""&gt;"Tier"&lt;/SPAN&gt;]
    , merchantReferenceCode = orders
    , customerID = OrderConstants.CustomerNumber
    , merchantDefinedData = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; MerchantDefinedData { field1 = &lt;SPAN class=""&gt;"Customer #: "&lt;/SPAN&gt; + OrderConstants.CustomerNumber, field2 = orders }
    , purchaseTotals = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PurchaseTotals { currency = &lt;SPAN class=""&gt;"usd"&lt;/SPAN&gt;, grandTotalAmount = total, taxAmount = taxtotal }
    , item = items.ToArray()
};

ReplyMessage reply = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; ReplyMessage();
&lt;SPAN class=""&gt;try&lt;/SPAN&gt;
{
    reply = SoapClient.RunTransaction(request);
}
&lt;SPAN class=""&gt;catch&lt;/SPAN&gt; (Exception ex)
{
    reply.decision = &lt;SPAN class=""&gt;"SYSTEM ERROR"&lt;/SPAN&gt;;
    reply.additionalData = &lt;SPAN class=""&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN class=""&gt;"Error processing request. Exception message: {0}"&lt;/SPAN&gt;, ex.Message);
}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://apps.cybersource.com/library/documentation/dev_guides/PayPal_Express_SO/PayPal_Express_SO_API.pdf" target="_blank" rel="nofollow noopener noreferrer"&gt;(Example 21 Request for payPalDoCaptureService).&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; &lt;A href="https://omegle.ws" target="_blank" rel="noopener"&gt;ome&lt;/A&gt;&lt;A href="https://omegle.club" target="_blank" rel="noopener"&gt;gle&lt;/A&gt;&lt;A href="https://shagle.download" target="_blank" rel="noopener"&gt;shagle&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;You'll need to ctrl+f to find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RequestMessage request = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; RequestMessage
{
    payPalDoCaptureService_run=&lt;SPAN class=""&gt;true&lt;/SPAN&gt;
    , merchantID = WebConfigurationManager.AppSettings[&lt;SPAN class=""&gt;"cybs.merchantID"&lt;/SPAN&gt;]
    , merchantReferenceCode = HTNsubscription9647
    , purchaseTotals = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PurchaseTotals { currency = &lt;SPAN class=""&gt;"usd"&lt;/SPAN&gt;, grandTotalAmount = total, taxAmount = taxtotal }
    , payPalDoCaptureService = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PayPalDoCaptureService 
      {
         run = &lt;SPAN class=""&gt;"true"&lt;/SPAN&gt;
        , invoiceNumber = orders
        , paypalAuthorizationId = authId
        , paypalAuthorizationRequestID = authReqId
        , paypalAuthorizationRequestToken = requestToken
        , completeType = &lt;SPAN class=""&gt;"Complete"&lt;/SPAN&gt; 
      }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 12:18:31 GMT</pubDate>
    <dc:creator>FlanZarianick</dc:creator>
    <dc:date>2022-08-23T12:18:31Z</dc:date>
    <item>
      <title>CyberSource Simple Order API Capture PayPal transaction</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/CyberSource-Simple-Order-API-Capture-PayPal-transaction/m-p/83872#M319</link>
      <description>&lt;P&gt;I'm attempting to capture a PayPal transaction that has been authorized using the PayPal button. I'm trying to use CyberSource Simple Order API to do this. I have the only 3 pieces of information that seem to come back from the PayPal button are:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;payerID,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;paymentID&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;paymentToken. I've tried a few ways of handing this off to the Simple Order API, but always get a 102 code with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DECLINE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;message in the response. Cybersource's logging system indicates this is because&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;The following request field(s) is either invalid or missing: request_token.&lt;/P&gt;&lt;P&gt;Do I need to conduct the whole transaction - authorize and capture - via cybersource? Or what is the way I can take the paypal-generated button and authorize a transaction, then capture it via CyberSource?&lt;/P&gt;&lt;P&gt;Here's my code snippet for the CyberSource SOAPI request:&lt;/P&gt;&lt;PRE&gt;RequestMessage request = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; RequestMessage
{
    merchantID = WebConfigurationManager.AppSettings[&lt;SPAN class=""&gt;"cybs.merchantID"&lt;/SPAN&gt;]
    , payPalDoCaptureService = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PayPalDoCaptureService {
            run = &lt;SPAN class=""&gt;"true"&lt;/SPAN&gt;
            , invoiceNumber = orders
            , paypalAuthorizationId = authId
            , paypalAuthorizationRequestToken = requestToken
            , completeType = &lt;SPAN class=""&gt;"Complete"&lt;/SPAN&gt; }
    , clientApplication = &lt;SPAN class=""&gt;"MyClient Application"&lt;/SPAN&gt;
    , clientApplicationVersion = &lt;SPAN class=""&gt;"2.0"&lt;/SPAN&gt;
    , clientApplicationUser = userName
    , clientEnvironment = WebConfigurationManager.AppSettings[&lt;SPAN class=""&gt;"Tier"&lt;/SPAN&gt;]
    , merchantReferenceCode = orders
    , customerID = OrderConstants.CustomerNumber
    , merchantDefinedData = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; MerchantDefinedData { field1 = &lt;SPAN class=""&gt;"Customer #: "&lt;/SPAN&gt; + OrderConstants.CustomerNumber, field2 = orders }
    , purchaseTotals = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PurchaseTotals { currency = &lt;SPAN class=""&gt;"usd"&lt;/SPAN&gt;, grandTotalAmount = total, taxAmount = taxtotal }
    , item = items.ToArray()
};

ReplyMessage reply = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; ReplyMessage();
&lt;SPAN class=""&gt;try&lt;/SPAN&gt;
{
    reply = SoapClient.RunTransaction(request);
}
&lt;SPAN class=""&gt;catch&lt;/SPAN&gt; (Exception ex)
{
    reply.decision = &lt;SPAN class=""&gt;"SYSTEM ERROR"&lt;/SPAN&gt;;
    reply.additionalData = &lt;SPAN class=""&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN class=""&gt;"Error processing request. Exception message: {0}"&lt;/SPAN&gt;, ex.Message);
}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://apps.cybersource.com/library/documentation/dev_guides/PayPal_Express_SO/PayPal_Express_SO_API.pdf" target="_blank" rel="nofollow noopener noreferrer"&gt;(Example 21 Request for payPalDoCaptureService).&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; &lt;A href="https://omegle.ws" target="_blank" rel="noopener"&gt;ome&lt;/A&gt;&lt;A href="https://omegle.club" target="_blank" rel="noopener"&gt;gle&lt;/A&gt;&lt;A href="https://shagle.download" target="_blank" rel="noopener"&gt;shagle&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;You'll need to ctrl+f to find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RequestMessage request = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; RequestMessage
{
    payPalDoCaptureService_run=&lt;SPAN class=""&gt;true&lt;/SPAN&gt;
    , merchantID = WebConfigurationManager.AppSettings[&lt;SPAN class=""&gt;"cybs.merchantID"&lt;/SPAN&gt;]
    , merchantReferenceCode = HTNsubscription9647
    , purchaseTotals = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PurchaseTotals { currency = &lt;SPAN class=""&gt;"usd"&lt;/SPAN&gt;, grandTotalAmount = total, taxAmount = taxtotal }
    , payPalDoCaptureService = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PayPalDoCaptureService 
      {
         run = &lt;SPAN class=""&gt;"true"&lt;/SPAN&gt;
        , invoiceNumber = orders
        , paypalAuthorizationId = authId
        , paypalAuthorizationRequestID = authReqId
        , paypalAuthorizationRequestToken = requestToken
        , completeType = &lt;SPAN class=""&gt;"Complete"&lt;/SPAN&gt; 
      }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 12:18:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/CyberSource-Simple-Order-API-Capture-PayPal-transaction/m-p/83872#M319</guid>
      <dc:creator>FlanZarianick</dc:creator>
      <dc:date>2022-08-23T12:18:31Z</dc:date>
    </item>
  </channel>
</rss>

