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: payerID, paymentID and paymentToken. I've tried a few ways of handing this off to the Simple Order API, but always get a 102 code with the DECLINE message in the response. Cybersource's logging system indicates this is because The following request field(s) is either invalid or missing: request_token.
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?
Here's my code snippet for the CyberSource SOAPI request:
RequestMessage request = new RequestMessage { merchantID = WebConfigurationManager.AppSettings["cybs.merchantID"] , payPalDoCaptureService = new PayPalDoCaptureService { run = "true" , invoiceNumber = orders , paypalAuthorizationId = authId , paypalAuthorizationRequestToken = requestToken , completeType = "Complete" } , clientApplication = "MyClient Application" , clientApplicationVersion = "2.0" , clientApplicationUser = userName , clientEnvironment = WebConfigurationManager.AppSettings["Tier"] , merchantReferenceCode = orders , customerID = OrderConstants.CustomerNumber , merchantDefinedData = new MerchantDefinedData { field1 = "Customer #: " + OrderConstants.CustomerNumber, field2 = orders } , purchaseTotals = new PurchaseTotals { currency = "usd", grandTotalAmount = total, taxAmount = taxtotal } , item = items.ToArray() }; ReplyMessage reply = new ReplyMessage(); try { reply = SoapClient.RunTransaction(request); } catch (Exception ex) { reply.decision = "SYSTEM ERROR"; reply.additionalData = string.Format("Error processing request. Exception message: {0}", ex.Message); }
(Example 21 Request for payPalDoCaptureService). omegleshagle You'll need to ctrl+f to find it.
RequestMessage request = new RequestMessage { payPalDoCaptureService_run=true , merchantID = WebConfigurationManager.AppSettings["cybs.merchantID"] , merchantReferenceCode = HTNsubscription9647 , purchaseTotals = new PurchaseTotals { currency = "usd", grandTotalAmount = total, taxAmount = taxtotal } , payPalDoCaptureService = new PayPalDoCaptureService { run = "true" , invoiceNumber = orders , paypalAuthorizationId = authId , paypalAuthorizationRequestID = authReqId , paypalAuthorizationRequestToken = requestToken , completeType = "Complete" } }
08-23-2022 05:18 AM