Stored Card Integration

To pay using a stored card, perform the following steps.

  1. Set the stored card parameter similar to the following code snippet:
let modelStoredCard = paymentRelatedDetail.storedCardArray[indexPath.row] as? PayUModelStoredCard

paymentParamForPassing.cardToken = modelStoredCard?.cardToken
paymentParamForPassing.cardBin = modelStoredCard?.cardBin
paymentParamForPassing.cvv = "123" //CVV
    PayUModelStoredCard *modelStoredCard = [self.paymentRelatedDetail.storedCardArray objectAtIndex:indexPath.row];

    self.paymentParamForPassing.cardToken = modelStoredCard.cardToken;
    self.paymentParamForPassing.cardBin = modelStoredCard.cardBin;
    self.paymentParamForPassing.CVV = @"123";//CVV
  1. Get the request by using thecreateRequestWithPaymentParam method similar to the following code snippet:
createRequest.createRequest(withPaymentParam: paymentParamForPassing, forPaymentType: PAYMENT_PG_STOREDCARD, withCompletionBlock: { request, postParam, error in
    if error == nil {
        //It is good to go state. You can use request parameter in webview to open Payment Page
    } else {
        //Something went wrong with Parameter, error contains the error Message string
    }
})
   self.createRequest = [PayUCreateRequest new];
    [self.createRequest createRequestWithPaymentParam:self.paymentParamForPassing forPaymentType:PAYMENT_PG_STOREDCARD withCompletionBlock:^(NSMutableURLRequest *request, NSString *postParam, NSString *error) {
    if (error == nil) {
    //It is good to go state. You can use request parameter in webview to open Payment Page
    }
    else{
    //Something went wrong with Parameter, error contains the error Message string
    }
}];