PayFort Payment Integration In IOS.

PayFort

In most of the time, we have to integrate the application with the payment gateway like a payfort  payment gateway. for this, we have to follow some steps to integrate a correct integration payment SDK in IOS.

1: go to that URL and download SDK.

https://docs.payfort.com/

2: for success full launch the payfort gateway we need some sample predefined data.

3: we need a signature value that is required at the time to load payfort window.  to generate a signature

 

[self sha1Encode:post]

 

4: you will get signature value now you have to make a http request to get SDK token for launching payfort controller.

 

above code will produce SDK token now you have to take view controller and their  class name write “PayFortController” .

 

Now it will launch and you can take dummy card number from their site.

5: you can get a response from that method.

– (void)sdkResult:(id)response{

  NSLog(@”data— %@”,response);

 }

 

 

 

 

 

. . .

Comments (12)

Add Your Comment

  • Rince Thomas
    hi, i am getting signature mismatch. How to resolve this issue ?.
    • kunal prasad
      check your shaencode parameter and http request for getting sdk_token. both parameter contain the correct value.
      example — NSMutableString *post = [NSMutableString string];
      [post appendFormat:@”tnraetanaeaccess_code=%@”, @”3Akqd81fWPfnE5LHz”];
      [post appendFormat:@”device_id=%@”, [PayFort getUDID ]];
      [post appendFormat:@”language=%@”, @”en”];
      [post appendFormat:@”merchant_identifier=%@”, @”azPOC”];
      [post appendFormat:@”service_command=%@”, @”SDK_TOKENtnraetanae”];

      NSDictionary *tmp = [[NSDictionary alloc] initWithObjectsAndKeys:
      @”SDK_TOKEN”, @”service_command”,
      @”azPOC”, @”merchant_identifier”,
      @”3Akqd81fWPfnE5LHz”, @”access_code”,
      [self sha1Encode:post],@”signature”,
      @”en”, @”language”,
      [PayFort getUDID ], @”device_id”,
      nil];

      • Prashanth
        [UITextField setFloatingLabelActiveTextColor:]: unrecognized selector sent to instance 0x1501b4a00
        2018-10-30 12:58:52.316243+0530 Dietitian[8407:2161810] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UITextField setFloatingLabelActiveTextColor:]: unrecognized selector sent to instance 0x1501b4a00’
        Im Getting the above error,what is the problem and how to solve that issue,i have tried a lot but can’t solve it
    • kunal prasad
      check your shaencode parameter and http request for getting sdk_token. both parameter contain the correct value.
      example — NSMutableString *post = [NSMutableString string];
      [post appendFormat:@”tnraetanaeaccess_code=%@”, @”3Akqd81fWPfnE5LHz”];
      [post appendFormat:@”device_id=%@”, [PayFort getUDID ]];
      [post appendFormat:@”language=%@”, @”en”];
      [post appendFormat:@”merchant_identifier=%@”, @”azPOC”];
      [post appendFormat:@”service_command=%@”, @”SDK_TOKENtnraetanae”];

      NSDictionary *tmp = [[NSDictionary alloc] initWithObjectsAndKeys:
      @”SDK_TOKEN”, @”service_command”,
      @”azPOC”, @”merchant_identifier”,
      @”3Akqd81fWPfnE5LHz”, @”access_code”,
      [self sha1Encode:post],@”signature”,
      @”en”, @”language”,
      [PayFort getUDID ], @”device_id”,
      nil];

  • Krishna Datt Shukla
    hi, i am getting signature mismatch. I checked both values in shaencode parameter and request parameters all are same.
    • kunal prasad
      if your current viewcontroller where you are loading payfort then it will be associated with uinavigationcontroller
      UINavigationController -> currentview
    • Kunal Prasad
      if your current viewcontroller where you are loading payfort then it will be associated with uinavigationcontroller
      UINavigationController -> currentview
  • Amisha
    How to get merchant Identifier (PSPID) ?
    • Kunal Prasad
      for that you need to ask from payfort team ( That will provide you ).
  • Jitendra Bhadja
    Hello sir,

    We are integrating pay fort SDK for iOS from document provided by you https://docs.payfort.com/docs/mobile-sdk/build/index.html#sdk-token-urls

    We are getting stuck at very first step where we need to get SDK token for payment

    We are getting Signature mismatch error every time I call https://sbpaymentservices.payfort.com/FortAPI/paymentApi API

    Let me give you parameters that I am passing in API :

    API : https://sbpaymentservices.payfort.com/FortAPI/paymentApi API

    Parameter :
    “access_code” = XNEw23o2DodbqTOLR6V3;
    “device_id” = “360B7CA4-ABF7-4A00-8EE8-99E3411F6994”;
    language = en;
    “merchant_identifier” = qxbVGjJK;
    “service_command” = “SDK_TOKEN”;
    signature = 0cdb4c9b705826de3fd3b548515f5916197ff3f38965a38e5527ce9654387623;

    I am getting Signature mismatch error when I call above API

    And for signature generation I have used same steps provided by you in documents

    Can you please help me to get rid out of this or can assist us for better solution ?

    Thanks

    • Kunal Prasad
      Hi,
      you need token from server side its just confirms that wether you are valid customer or not.
      time to time payfort change their rule and regulation so better to follow update document.
      you will get also dummy credential from their documentation.

      for successful signature

      you need to pass correct value (this one is demo value)
      [request setValue:@”XYZ9239-yu892Q78″ forKey:@”merchant_reference”];
      [request setValue:sdk_token forKey:@”sdk_token”];

      and . this one (this is demo data)

      NSDictionary *tmp = [[NSDictionary alloc] initWithObjectsAndKeys:
      @”SDK_TOKEN”, @”service_command”,
      @”azPOCM”, @”merchant_identifier”,
      @”3Akqd81fWPfnE5L”, @”access_code”,
      [self sha1Encode:post],@”signature”,
      @”en”, @”language”,
      [PayFort getUDID ], @”device_id”,
      nil];

      if this one is correct than it will become success.fd

  • Kunal Prasad
    Hi,
    you need token from server side its just confirms that wether you are valid customer or not.
    time to time payfort change their rule and regulation so better to follow update document.
    you will get also dummy credential from their documentation.

    for successful signature

    you need to pass correct value (this one is demo value)
    [request setValue:@”XYZ9239-yu892Q78″ forKey:@”merchant_reference”];
    [request setValue:sdk_token forKey:@”sdk_token”];

    and . this one (this is demo data)

    NSDictionary *tmp = [[NSDictionary alloc] initWithObjectsAndKeys:
    @”SDK_TOKEN”, @”service_command”,
    @”azPOCM”, @”merchant_identifier”,
    @”3Akqd81fWPfnE5L”, @”access_code”,
    [self sha1Encode:post],@”signature”,
    @”en”, @”language”,
    [PayFort getUDID ], @”device_id”,
    nil];

    if this one is correct than it will become success.

  • css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close