1 post / 0 new
kevinyin7056
iOS Swift integration

I am trying to integrate Payeezy in Swift, and I mimicked the example code found in the PDF on this webpage (https://developer.payeezy.com/select-your-integration-method) but nothing seems to work. To debug this, I wrote a print statement before calling submitAuthorizeTransactionWithAVSCreditCardDetails and inside that method, but only the print statement before submitting the payment works. What am I missing?

Here is what I have so far:

var client: PayeezySDK

required init?(coder aDecoder: NSCoder)
{
client = PayeezySDK(apiKey: api_key, apiSecret: api_secret, merchantToken: merchant_token, url: url)
// all these variables are defined from the values from my account
//and the url is https://api-cert.payeezy.com/v1/transactions

super.init(coder: aDecoder)
}

@IBAction func submit()
{
print ("submit")

let credit_card = [
"card_type":"visa",
"cardholder_name": "Jacob Test",
"card_number": "4012000033330026",
"exp_date": "0419",
"cvv": "123"
]

let transaction_info = [
"currencyCode": "USD",
"amount": "10",
"merchantRefForProcessing": "abc1412096293369"
]

func completionHandler(_: [NSObject: AnyObject]!, _: NSError!) {
print("purchase transaction")

}

client.submitAuthorizeTransactionWithAVSCreditCardDetails(credit_card["card_type"], cardHolderName: credit_card["cardholder_name"], cardNumber: credit_card["card_number"], cardExpirymMonthAndYear: credit_card["exp_date"], cardCVV: credit_card["cvv"], currencyCode: transaction_info["currencyCode"], totalAmount: transaction_info["amount"], merchantRefForProcessing: transaction_info["merchantRefForProcessing"], completion: completionHandler)