Search code examples
iosworldpay

Worldpay iOS: how to verify transaction?


I'm looking at integrating WorldPay into an iOS app, but there appears to be a step in the process I'm missing when reviewing the iOS documentation.

The iOS SDK provides methods to create a transaction from the app:

https://github.com/worldpay/worldpay-lib-ios

The result of this is an order which contains an order token.

The Braintree API makes you call your own server to call Braintree servers to verify that the transaction is valid and accepted, and this is how they prevent users from forging requests to the server which claim to have completed transactions which actually haven't been paid for.

https://developers.braintreepayments.com/start/overview

How do you verify a transaction made via Worldpay is genuine when using the iOS SDK?


Solution

  • This is possible using WorldPay webhooks:

    https://developer.worldpay.com/jsonapi/docs/webhooks-orders

    A webhook will have to be implemented server side, and a record of successful transactions maintained. This does complicate the iOS side logic as the process then becomes asynchronous since we have no control over when WorldPay calls the webhook.