@@ -131,21 +131,19 @@ class ViewController: UIViewController, PSTCKPaymentCardTextFieldDelegate {
131131
132132 let transactionParams = PSTCKTransactionParams . init ( ) ;
133133 // charging 75naira, 80kobo
134- transactionParams. amount = 244 ;
134+ transactionParams. amount = 7580 ;
135135
136136 do {
137- try transactionParams. setMetadataValue ( " iOS SDK " , forKey: " custom_fields " ) ;
138- try transactionParams. setCustomFieldValue ( " iOS SDK " , displayedAs: " Another " ) ;
139- try transactionParams. setCustomFieldValue ( " Emi ni " , displayedAs: " One else " ) ;
137+ try transactionParams. setCustomFieldValue ( " iOS SDK " , displayedAs: " Paid Via " ) ;
138+ try transactionParams. setCustomFieldValue ( " Paystack hats " , displayedAs: " To Buy " ) ;
140139 try transactionParams. setMetadataValue ( " iOS SDK " , forKey: " paid_via " ) ;
141140 } catch {
142141 print ( error) ;
143142 }
144143
145- transactionParams. email = " ibrahim@paystack.com " ;
144+ // set an email
145+ transactionParams. email = " " ;
146146
147- print ( transactionParams. description) ;
148-
149147 // transactionParams.subaccount = "ACCT_80d907euhish8d";
150148 // transactionParams.bearer = "subaccount";
151149 // transactionParams.transaction_charge = 280;
@@ -162,10 +160,10 @@ class ViewController: UIViewController, PSTCKPaymentCardTextFieldDelegate {
162160 }
163161 self . chargeCardButton. isEnabled = true ;
164162 } , didRequestValidation: { ( reference) -> Void in
165- self . tokenLabel. text = reference + " requested validation"
163+ self . tokenLabel. text = " requested validation: " + reference
166164 self . tokenLabel. isHidden = false
167165 } , didTransactionSuccess: { ( reference) -> Void in
168- self . tokenLabel. text = reference
166+ self . tokenLabel. text = " succeeded: " + reference
169167 self . tokenLabel. isHidden = false
170168 self . chargeCardButton. isEnabled = true ;
171169 } )
@@ -194,7 +192,7 @@ class ViewController: UIViewController, PSTCKPaymentCardTextFieldDelegate {
194192 if successfulResponse && error == nil && data != nil {
195193 // All was well
196194 let newStr = NSString ( data: data!, encoding: String . Encoding. utf8. rawValue)
197- print ( newStr)
195+ print ( newStr ?? " <Unable to read response> " )
198196 } else {
199197 if let e= error {
200198 print ( e. localizedDescription)
0 commit comments