MoneyHash iOS SDK 3.x Migration Guide
Breaking Changes
Removed Apple Pay Methods
The following Apple Pay methods have been removed in version 3.x:
proceedWithApplePay(...)
- Removed
proceedWithApplePay(...)
- Removed// These methods are no longer available:
func proceedWithApplePay(intentID: String, depositAmount: Float, applePayData: ApplePayData) async throws -> IntentDetails
func proceedWithApplePay(intentID: String, depositAmount: Float, merchantIdentifier: String, currencyCode: String, countryCode: String) async throws -> IntentDetails
func proceedWithApplePay(intentID: String, depositAmount: Float, merchantIdentifier: String, currencyCode: String, countryCode: String, supportedNetworks: [String]?, merchantCapabilities: [String]?) async throws -> IntentDetails
generateApplePayReceipt(...)
- Removed
generateApplePayReceipt(...)
- Removed// This simplified version is no longer available:
func generateApplePayReceipt(depositAmount: Float, merchantIdentifier: String, currencyCode: String, countryCode: String) async throws -> NativePayReceipt
New Apple Pay Methods
Apple Pay operations are now streamlined through the generateApplePayReceipt
method with two flexible options:
Option 1: Using ApplePayData object received from moneyhash
func generateApplePayReceipt(
depositAmount: Float,
applePayData: ApplePayData
) async throws -> NativePayReceipt
Use case: When you have a preconfigured ApplePayData
object with all necessary payment information.
Option 2: Using Explicit Parameters
func generateApplePayReceipt(
depositAmount: Float,
merchantIdentifier: String,
currencyCode: String,
countryCode: String,
supportedNetworks: [String]?,
merchantCapabilities: [String]?
) async throws -> NativePayReceipt
Use case: When you need to specify custom Apple Pay parameters directly.
New Intent State:
The IntentStateDetails
enum now includes a new state called processing for better payment flow tracking:
case processing
Purpose: This state indicates that the payment intent is currently being processed, allowing better tracking during payment flows.
None-breaking changes
Card Number Validation Control
You can now control whether MoneyHash should validate the card number format before submission via the CardFormConfiguration
:
let config = CardFormConfiguration(
isCardHolderNameRequired: false,
enableCardNumberValidation: true // enable card validation
)
Configuration options:
true
(default): Enables card number validation.false
: Disables validation, allowing you to handle it independently
Benefits: Provides flexibility for integrators who prefer to defer validation or implement custom validation logic.
Migration Steps
- Remove deprecated Apple Pay methods from your codebase
- Update Apple Pay integration to use the new
generateApplePayReceipt
methods - Handle the new
.processing
state in your intent state management - Configure card validation according to your requirements using
enableCardNumberValidation
Updated about 1 month ago