I've been messing around with Paypal's Payflow Pro and REST APIs they offer. I'm currently working on a .NET MVC Visual Studio solution that has its own shopping cart. Because of all the PCI compliance issues it seems that the safest route (only route?) is to post all secure data directly to paypal using AJAX. For me, this means posting all the cc #s, security codes, exp dates, etc. directly with jQuery AJAX. Nothing secure is going to hit my servers as it's going directly from the client to Paypal. This also means I'm going to be unable to use Paypal's SDK as most of this stuff is going to be dealt with on the client. At least I think this is the case.
Here's what I'm planning on doing, please comment/correct me if I'm wrong.
- User decides to 'checkout' and complete the sale (after entering shipping, billing, CC#, etc. onto one or more forms.
- User submits form, and I need to request a secure token from Paypal before submitting the payment request. For this I'll use an AJAX method to my server. Server method creates behind-the-scenes request (and un-sniffable with Fiddler, etc.) for the auth token (sends sends ClientID & Secret in Authorization header, to oauth2/token). Secure token returns in the response. AJAX request passes this time-sensitive token back to client.
- The request directly to Paypal is dynamically created (adding authorization header with Bearer token and other required json properties - intent, payer, funding_instruments, etc.)
- Response from this direct request contains the state of approval. Client displays status of payment, and other AJAX methods record the details of the approval on server for audit trails.
So, from what I've described above there's little, if any, use of Paypal's SDK. I can't use it on the client, and the request for the initial secure token is pretty straight forward (This helped me, though I'm doing it somewhat differently: Token Request Details ). The dynamic json of the request body might be ugly to build, but other than that I don't think this'll be too big of a deal (except for being time consuming to get it right!).
Does anyone see any problem with what I'm attempting here?