Skip to main content

Paystack payment method/function in objective-c

 PSTCKCardParams *cardParams = [_paymentTextField cardParams];
    
    //    //When we create custom textfields
    //    PSTCKCardParams *cardParams = [[PSTCKCardParams alloc] init];
    //    // then set parameters thus from card
    //    cardParams.number= self.TFout.text;
    
    PSTCKTransactionParams *transactionParams = [[PSTCKTransactionParams alloc] init];
    transactionParams.amount =[[_planAry valueForKey:@"plan_price"] intValue];

    transactionParams.email=[[NSUserDefaults standardUserDefaults] valueForKey:@"userEmailID"];
    
    //transactionParams.subaccount
    UIViewController *vc = self.view.window.rootViewController;
    //[self presentViewController: activityController animated: YES completion:nil];
    [[PSTCKAPIClient sharedClient] chargeCard:cardParams
                               forTransaction:transactionParams
                             onViewController: vc
                              didEndWithError:^(NSError *error, NSString *reference){
                                  NSLog(@"ERROR===%@",error);
                                  
                              }
                         didRequestValidation: ^(NSString *reference){
                             // an OTP was requested, transaction has not yet succeeded
                             NSLog(@"OTP IFUYGYUG");
                            // [self AlertMethod:@"Alert" :@"Server error occured"];
                         }
                        didTransactionSuccess: ^(NSString *reference){
                            // transaction may have succeeded, please verify on backend
                            NSLog(@"SUCESS======");
                   

                        }];


Comments

Popular posts from this blog

post method using alamofire in swift 3

  func addSubscriptionApi(_completeUrl: String ) {         //HUD         Alamofire.request(_completeUrl, method:.post, parameters: nil , encoding: JSONEncoding. default , headers: nil ).responseJSON { response in             switch (response.result) {             case .success( _ ):                 if let data = response.result.value as ? NSDictionary                 {                     print(response.result.value as Any)                     print(data)                      print("SUCCESS")                  }                 break  ...

Set Placeholder in UiTextView in swift 3

//In viewdidLoad add this                DiscriptionTV . text = "Discription"         DiscriptionTV . textColor = UIColor . lightGray         DiscriptionTV . delegate = self          DiscriptionTV . layer . borderColor = UIColor . lightGray . cgColor ; then   //Mark:- textView Delegates          func textViewDidBeginEditing( _ textView: UITextView ) {         if DiscriptionTV . textColor == UIColor . lightGray {             DiscriptionTV . text = nil             DiscriptionTV . textColor = UIColor . white             DiscriptionLab . isHidden = false         }     }          func textViewDidEndEditing( _ textView: UITextView ) { ...