0

We are using Paypal for charging users. Right now, we have API call to BillUser to charge the user without authorization. We would like to change this to authorize first and charge at later point of time. Also, we would not like to redirect the user to Paypal page and we have Billing Agreement id for each of the accepted user. I was looking into Paypal APIs and found DoAuthorization() method which would help our need. But, this takes a transaction id as the input. How do i get this transaction id?

I can update the API to latest one using Nuget install-package PaypalMerchantSdk and use DoReferenceTransaction() method to authorize/capture payment. But, the problem with this is that it mandates API signature. We have API certificate for sandbox and live environment. We do not want to use API signature. Is there a C# example of using API certificate and calling this method without signature?

Sriram
  • 9
  • 2
  • So, are you using ReferenceTransaction or ExpressCheckout? – Victor Castillo Torres Nov 15 '15 at 03:08
  • https://developer.paypal.com/docs/classic/express-checkout/ht_ec-singleAuthPayment-curl-etc/ – Victor Castillo Torres Nov 15 '15 at 03:13
  • I have a ReferenceTransaction Id and want to use it just to authorize now and capture at later point. The problem is that we are using a old paypal assembly and it does not have any methods related to Reference Transaction. Also, the SetExpressCheckout specified in Paypal examples takes in reference transaction id - but, the one we have does not take in this parameter. – Sriram Nov 18 '15 at 18:02
  • I can update the API to latest one using Nuget install-package PaypalMerchantSdk and use DoReferenceTransaction() method to authorize/capture payment. But, the problem with this is that it mandates API signature. We have API certificate for sandbox and live environment. We do not want to use API signature. Is there a C# example of using API certificate and calling this method without signature? – Sriram Nov 18 '15 at 18:03
  • I can't find any example on how to use certificate just signature, if I find something I'll let you know – Victor Castillo Torres Nov 18 '15 at 18:55

2 Answers2

0

The GetExpressCheckoutDetails API operation obtains information about an Express Checkout transaction. You must use method GetExpressCheckoutDetails and parameter PAYMENTREQUEST_n_TRANSACTIONID:

Transaction ID for up to 10 parallel payment requests. You can specify up to 10 payments, where n is a digit between 0 and 9, inclusive.

Character length and limitations: 17 characters except for transactions of the type Order have a character length of 19. This field is available since version 64.0.

Pavel Kenarov
  • 944
  • 1
  • 9
  • 21
  • Thank you so much for your reply! But, I don't think that is a possibility. I wanted to do this authorization using reference billing agreement id. Also, I do not want any user interaction with Paypal website on this. In fact, this authorization is asynchronously after user places the order. ExpressCheckout requires user to authenticate the transaction, which means we may have to redirect them to Paypal website (which is not desired). Also, we are using a old Paypal Dll (the reference there is Paypal_base.dll V0.0). This does not have the parameter PAYMENTREQUEST_n_TRANSACTIONID. – Sriram Nov 15 '15 at 04:51
  • Basically, I need to create a new transaction and pass the transaction id to doAuthorization() method. But, I do not know how to create this transaction. If I try a BillUser() with 0 amount to create a transaction, it gets denied due to internal error. – Sriram Nov 15 '15 at 05:05
  • You must set method SetExpressCheckout first! See this example: http://stackoverflow.com/questions/32565213/paypal-express-checkout-api-is-there-a-way-to-process-both-recurring-payment-i – Pavel Kenarov Nov 15 '15 at 18:04
0

I am trying to accomplish something similar as far as I can tell you must use DoDirectPayment and set the paymentaction to Authorization This will send you back an Transaction-id Once you have that ID you can send it to DoAuthorization

How ever the problem I am having is that the Transaction id is still coming back invalid hope this help if you find the solution please share it thanks

user1074242
  • 15
  • 1
  • 4