Manual key in a Card Payment
let card = CreditCard(personName: "Testy McTesterson",
cardNumber: "4242424242424242",
cardExp: "0424",
addressZip: "12345")
Handling the response
The response object includes useful information about the payment. You can access the status of the transaction and any errors.
if let transaction = completedTransaction, transaction.status == .success {
print("Transaction successful!")
} else if let error = error {
print("Transaction failed: \(error.localizedDescription)")
}
{
"status": "success",
"transactionId": "abc123",
"amount": 30
}
When testing, ensure your network connection is stable. An unstable connection might cause unexpected errors during transactions.
Updated 7 months ago