This page documents
WhopTTP 1.0.0. import WhopTTP adds all the types on this page.TapToPay
Create an instance
Production or sandbox. Refer to
TapToPayEnvironment.Returns an access token for
accountID, with the payment:charge and payment:basic:read scopes. The SDK calls it before its first request. The SDK calls it again only when Whop rejects the current token. Refer to Authentication.Charge methods
A three-letter currency code, for example
"usd". You can use upper case or lower case.The email of the buyer. Whop attaches the purchase to that buyer and sends a receipt by email. If the value is
nil or an empty string, you can use attachBuyer later.attachBuyer(email:to:)
.invalidPayment.
readiness()
prepare()
charge connects automatically, thus this call is optional. Refer to Prepare the reader.
cancel()
prepare() that this instance runs. That call then throws .cancelled. If no charge runs, cancel() does nothing. If you cancel the Task that called charge, the result is the same.
State
The current step of the charge or
prepare() that runs. The value is .idle when no operation runs.The error from the last charge that failed. The SDK clears it when the next charge starts.
true if this device can use Tap to Pay with this SDK. It is nonisolated. Thus, you can read it from all threads.TapToPay.Phase
TapToPayPayment
init: TapToPayPayment(id:status:total:canAttachBuyer:) and TapToPayAmount(amount:currency:).
TapToPayReadiness
init, TapToPayReadiness(status:supportedCountries:).
TapToPayEnvironment
TapToPayError
TapToPayError.Code is a String-backed enum. Thus, error.code.rawValue gives a name that does not change, for logs. A token provider can use the public init, TapToPayError(code:message:underlyingCode:paymentID:), to throw an error. The SDK gives you that error without a change.
