You can integrate external payments per Apple’s guidelines via browser redirects. Either reuse your existing web checkout flows with minimal adjustments or set up a new external payment page.
Merchant-hosted Payment Form In this flow, the app opens and redirects the customer to an external web page on your website that hosts the Payment Form checkout.Payment Form is a JavaScript-based checkout form you embed, which handles sensitive card data securely via tokenization and supports various payment methods. Customers pay on this web form and then return to the app after completion.
Steps to implement Payment Form redirect:
-
Create a secure checkout page on your website
Develop a webpage for the payment form landing page to integrate Payment Form. Ensure the page is served over HTTPS and that you own or control the domain. Apple requires the external payment page to belong to the developer of the app. -
Integrate Payment Form on the web page
Prepare your backend, then initialize Payment Form on your frontend using this signature. -
Implement app redirect to the Payment Form
In your iOS app, add an interface element, for example, a Subscribe or Buy button, that triggers the external payment. When tapped, the app should open the above web page in the external browser. For example: -
Display a confirmation modal
optional step
Although Apple has removed the mandatory warning dialog in the U.S., it is more straightforward to inform customers that they are about to leave the app for payment.
The customer can confirm, and then you callopenURLto the browser. This optional step helps set expectations and aligns with the spirit of Apple’s guidelines on clarity. -
Handle post-payment return to the app
After the customer completes payment on the web form, you must get them back into the app and update the app state. The most straightforward approach is to rely on the customer to manually switch back to your app after paying.
Once the app is resumed, it can check the purchase status from your backend, for example, query your server or listen for a webhook confirmation. Solidgate processes the payment, and you can use the payment form event to mark the order as paid in your system. When the app regains focus, verify the order status via an API call and then unlock content or show a success message.
Payment Page is a turnkey, hosted checkout solution provided by Solidgate. You generate a payment URL via API and redirect customers to the Solidgate’s domain to securely complete the payment. After payment, redirect them back to your app, significantly minimizing frontend integration work.
Steps to implement Payment Page redirect:
-
Create a Payment Page session via API
Using create page API request for the specific transaction or order. -
Open the Payment Page URL in the browser
When the customer initiates a purchase in your app, invoke an external browser redirect. Use the URL obtained from API, for example: -
Monitor payment status
While the customer is on the Payment Page, your app is in the background. It is a required practice to use webhook to get notified of the transaction outcome on your server. Solidgate sends a webhook callback when the payment is successful or if it fails. Use this to update the order status in your database. -
Handle return to the app
After payment completion, Solidgate redirects customers to your specified return URL, or to an optional go-back URL if they exit without paying.