Reputation: 1113
This has been asked a couple of times but I still haven't figured out how to make it work on the .NET SDK https://github.com/paypal/PayPal-NET-SDK:
After calling
payment.Create(apiContext)
I sucessfully get back response with a populated createdTime,PayID,links,etc.
Now when I log into paypal sandbox with the buyer/seller test accounts. I'm not able to see the transaction
This popular question points to calling DoExpressCheckoutPayment
to resolve this issue. After doing some research in how I could call DoExpressCheckoutPayment
this with .NET SDK, the only way I found was using a previous version of the SDK (https://github.com/paypal/merchant-sdk-dotnet) which is marked as deprecated
I'm kind of lost trying to figure out something that shouldn't be so difficult I followed the example here and I belive that it should work without any additional thing
Upvotes: 0
Views: 407
Reputation: 12341
The SDK you are referring to is for the (relatively) new REST API.
Assuming You are referring to a paypal
payment (not credit_card
) so you have to execute
it - which I would map to DoExpressCheckoutPayment
in the Classic API
The SDK has a sample for it: In the sample you referenced, you'll see the PaymentWithPayPal.aspx.cs
whereinexecute
call in line 155
A sample for credit_card
with intent='sale'
(which means auth and capture in one step, or "immediate capture") is in PaymentWithCreditCard.aspx.cs
Hth...
Update:
The paymentExecution was missing
Actually it's all there in lines 146 - 155:
var paymentExecution = new PaymentExecution() { payer_id = payerId };
var payment = new Payment() { id = paymentId };
// ^ Ignore workflow code segment
#region Track Workflow
this.flow.AddNewRequest("Execute PayPal payment", payment);
#endregion
// Execute the payment.
var executedPayment = payment.Execute(apiContext, paymentExecution);
Hth..
Upvotes: 1
Reputation: 1113
You are right. The paymentExecution
was missing
It such a shame that the SDK samples are incomplete. I'll try to reach the author as I wouldn't like anybody else to get stuck as I did.
I made it work after Checking the paypal REST API doc I'd recommend going through this doc instead of the .NET SDK examples
Upvotes: 0