1

I am a little bit confused by the Cordova plugin by PayPal in terms of what this means for implementing a safe workflow for interacting with a Magento instance.

Normally, the Express Checkout workflow looks like this:

  1. Customer visits Magento Site checkout
  2. Customer is directed to PayPal
  3. Customer is returned to Magento Site
  4. Customer clicks 'Place Order' on Magento Site
  5. Magento Site converts quote to order
  6. Magento Site accesses PayPal to capture / confirm funds, check for possible fraud, etc...

The workflow imposed by the Cordova plugin appears to be like this:

  1. Customer visits App checkout
  2. Customer is directed to PayPal
  3. Payment is authorized or captured based upon the configuration
  4. Customer is directed back to App
  5. App executes a success handler

In the above Cordova Plugin workflow, notice that the step where a quote to order conversion is missing. From my perspective, I see two options:

Insert quote -> order conversion call between 2 and 3

Caveats:

  1. The customer may not complete checkout and now an order is permanently orphaned in the system
  2. The customer may wish to change something (which now can't happen -- orders can't be modified)

Insert quote -> order conversion call after 5

Caveats:

  1. The client is being trusted to notify the server that the payment was made (which requires server-side cross-examination with PayPal / additional complexity)
  2. The client may never actually send the notification.

I do not like any of the options presented above. Can anyone help clear up my confusion or show me what I hope that I'm missing?

Luke A. Leber
  • 702
  • 6
  • 17

1 Answers1

1

I've found that I am able to provide a placeholder invoice number to the Cordova application to pass on to PayPal.

PayPal can then send this invoice number along with relevant transaction details to the Magento server via an IPN. This takes the client out of the picture and fits my needs.

So really the workflow is as follows:

  1. The client clicks on the 'PayPal Button'
  2. A request is sent to the Magento Server to create an order and placeholder invoice
  3. The Magento Server provides the placeholder invoice number to the client
  4. The order is now 'Pending Payment' in Magento
  5. The client proceeds to PayPal to make the payment
    • If the client successfully pays, an IPN is sent to the Magento Server and the client is returned to the App payment success page
    • If the client fails to pay and fails to return to the app, the order will remain as 'Payment Pending' to be cancelled by a crontask every so often
    • If the client fails to pay and successfully returns to the app, the app will contact the Magento Server and immediately cancel the order

I'm severely disappointed by the lack of documentation / support for this product.

Luke A. Leber
  • 702
  • 6
  • 17