Skip to main content

Overview

Apple Pay and Google Pay let your customers pay on a secure Novac page, so your system never handles their card details. You choose the experience by adding the optional paymentMethod field to your payment request. If you leave out paymentMethod, Novac uses card, the standard flow you get when you accept a hosted checkout payment. The field accepts three values:
  • card: The standard card flow.
  • apple_pay: A Novac page with Apple Pay only.
  • hosted_card: A Novac page with card, plus Apple Pay or Google Pay where available.
To offer Google Pay, set paymentMethod to hosted_card. This option shows Apple Pay and Google Pay where they’re available.

Prerequisites

See details

Before you accept Apple Pay or Google Pay, make sure you have:

  • Use one of these currencies: USD, GBP, EUR, CAD or AUD. Always send currency.
  • Apple Pay and Google Pay don’t support NGN payments.
  • Only one-time sale payments are supported. Authorize-and-capture and recurring payments aren’t supported.
  • These payment methods don’t return card details or reusable card tokens.
  • Contact support before you refund a hosted payment. See Refund a Transaction.

How it works

Your server starts the payment and sends the customer to Novac’s payment page. The customer pays and completes any extra checks, such as 3D Secure. When the payment is completed, Novac sends your server a webhook. That webhook is how you reliably receive every payment status, because the customer may close the page and never return. If the customer does return, Novac sends them to your return URL.
This happens after both successful and failed payments. The URL carries no status, and anyone can edit a URL, so use the reference only to find the order. Then verify the payment with Novac before you deliver anything.
The redirectUrl you send in your request is where Novac sends customers after they pay. It can be a page on your website or app. If you don’t send one, Novac uses the callback URL set on your dashboard and adds the reference to it. If neither is set, the customer sees a Novac receipt instead.

Choose an endpoint

You can set up these payment methods in three ways: a direct card charge with card encryption, a direct card charge without card encryption, or a custom checkout.

Start a direct payment

Send a POST request to /api/v1/direct-card-charge. Leave out the card details, because the customer enters them on the Novac page.
Apple Pay request
To offer card payment and the supported wallets (Apple Pay or Google Pay) on the same page, use "paymentMethod": "hosted_card".
Response
This response shows that the payment has started. authMode is 3ds, authAction is redirect, and authEndpoint is v1/transaction/ORDER-7F3K9Q2M8X4T/verify. To use authEndpoint, add the Novac base URL https://api.novacpayment.com/api/ before it.

Start a custom checkout payment

1

Step 1 - Create the transaction

Create the transaction with a POST request to /api/v1/initiate. Include the customer’s email and your return URL in this request.
2

Step 2 - Complete the payment

Send a POST request to /api/v1/card-payment with the same transaction reference and your paymentMethod.
Request
Response
Direct card charge and custom checkout return similar responses, but authEndpoint for custom checkout is v1/checkout/{transactionReference}/verify. While the transaction is still pending, you can call this endpoint again to switch between apple_pay and hosted_card. After the customer submits a payment, you can’t switch while Novac processes it.
Don’t send APPLEPAY or HOSTEDCARD in allowedPaymentOptions when you initiate the checkout payment, because Novac rejects the request. Choose the method later with paymentMethod. The payment options returned by /api/v1/initiate don’t show whether these methods are turned on for you.

Redirect the customer to the payment page

Open data.redirectUrl in the customer’s browser.
Redirect the customer
  • Use the URL exactly as Novac returns it. Don’t build it yourself or depend on its format, because it may change.
  • Open it in the full browser window if you can. If you use an iframe, add allow="payment", then test each wallet and 3D Secure, because some browsers may still block them.
  • Keep the whole page visible, including its legal notice. The notice tells customers who the seller is and which terms apply, so don’t cover, crop or hide it.
Customers enter an email address on the hosted_card page, because Novac doesn’t fill in the email you sent. With apple_pay, the Apple Pay sheet asks for an email address. The name on the customer’s card statement may be different from your business name.

Wallet availability

Wallets only appear on supported devices and browsers, when they’re available for your account. If Apple Pay isn’t available on the apple_pay page, the customer sees a message asking them to choose another payment method. Always offer another way to pay. If you draw your own Apple Pay button, follow Apple’s button guidelines.

Retry safely

  • Request timed out: Novac may still have created your payment. Check it with the verify endpoint and the same reference before you try again.
  • Duplicate reference on a direct payment: this can happen even if the customer hasn’t paid. Use the redirectUrl you saved, or check the payment status. Direct endpoints don’t return the URL again, so save it when you first receive it.
  • Customer reloads the page: they can use the same redirectUrl. While Novac processes a payment, the page doesn’t let the customer pay again.
  • Payment not accepted: if the page says it couldn’t process the payment and offers another try, the customer can try again on the same page.
  • Payment failed: use a new reference to start another payment.

What’s next?