SDK Integration
  • Getting Started
  • Onboarding Requirements
  • Hash Generation
  • Test Merchant list
  • Android
    • Android SDK Offering
    • PayUCheckoutPro
      • Integration
      • Build the Payment Params
        • Additional Params
      • Hash Generation
      • Set up the payment hashes
      • Initiate the Payment
      • Customized Integration
        • Set Webview Properties
        • SDK Configuration
        • Additional Offerings
      • Offers Integration
      • Convenience Fee Integration
      • Custom Note Integration
      • MCP Integration
    • Core
      • Supported Payment Types
      • TPV Integration
      • Merchant Web Services
        • Getting Enabled Payment Options
        • GetCheckoutDetails API
        • Lookup API
    • Custom Browser
      • Integration
        • CustomBrowser Config
        • CustomBrowserCallback
        • Supporting below Lollipop Versions
        • Third-Party Payments Support
      • Sample App
      • Change Logs
    • Native OTP Assist
      • Integration
      • Customization
      • Change Logs
    • UPI
      • Integration
      • TPV Integration in UPI
      • Sample App
      • Change Logs
    • Google Payâ„¢
      • Integration
      • Sample App
    • PhonePe
      • Integration
      • Sample App
      • Change Logs
    • OlaMoney
    • PayU OTP Parser
      • Integration
    • FAQ Android
  • iOS
    • PayUCheckoutPro
      • Integration
      • Advanced Integration
      • Set up the payment hashes
      • Convenience Fee Integration
      • MCP Integration
      • Custom Note Integration
    • Core
      • POD Integration
      • Seamless
      • Web Services
      • Objective C-Non-Seamless
      • Standing Instructions
      • TPV Integration
      • Sample App
    • Custom Browser
      • Sample App
    • OlaMoney
    • Native OTP Assist
      • Integration
      • Customization
    • UPI
      • Integration
      • Sample App
    • PayUParams
      • PayUSIParams
      • PayUBeneficiaryParams
  • Releasing to Apple
  • React-Native
    • PayUCheckoutPro
      • Integration
      • Set up the payment hashes
      • Advanced Integration
      • Change Logs
    • Core
    • Non-Seamless Wrapper
    • TPV (beta)
      • Integration
  • FAQ iOS
Powered by GitBook
On this page
  • Pre-requisites
  • Pass Merchant Access Key
  • Generate Hash For MCP

Was this helpful?

  1. iOS
  2. PayUCheckoutPro

MCP Integration

(Optional)

PreviousConvenience Fee IntegrationNextCustom Note Integration

Last updated 3 years ago

Was this helpful?

Follow below integration steps if integrating Multi-Currency Payments(MCP)

Pre-requisites

Kindly connect with your Key Account Manager at PayU to get the below credentials -

  1. Merchant Access Key

  2. Merchant Secret Key

Pass Merchant Access Key

paymentParam.additionalParam[PaymentParamConstant.merchantAccessKey] = <Merchant-Access-Key>       
paymentParam.additionalParam[PaymentParamConstant.merchantAccessKey] = @<Merchant-Access-Key>; 

Generate Hash For MCP

Lookup API Hash is calculated with the HmacSHA1 signature. It requires a Merchant Secret key in calculating the hash. Below example, code demonstrates the calculation of Lookup API Hash.

func generateHash(for param: DictOfString, onCompletion: @escaping PayUHashGenerationCompletion) {
        let commandName = (param[HashConstant.hashName] ?? "")
        let hashStringWithoutSalt = (param[HashConstant.hashString] ?? "")
        // get hash for "commandName" from server
        // After fetching hash set its value in below variable "hashValue"
        var hashValue = ""
        if commandName == HashConstant.mcpLookup {
        //To create HMACSHA1 Signature 
        // Signature = HMAC-SHA1(data, key);
        //Data = hashStringWithoutSalt
        //Key = Mechent Secret Key shared with the merchant at the time of on-boarding 
            hashValue = <HMACSHA1 signature from your server>
        } else {
            hashValue = <HMACSHA512 hash from your server>
        }
        onCompletion([commandName : hashValue])
    }
- (void)generateHashFor:(NSDictionary<NSString *,NSString *> * _Nonnull)param onCompletion:(void (^ _Nonnull)(NSDictionary<NSString *,NSString *> * _Nonnull))onCompletion {
    NSString *commandName = [param objectForKey:HashConstant.hashName];
    NSString *hashStringWithoutSalt = [param objectForKey:HashConstant.hashString];
    // get hash for "commandName" from server
    // After fetching hash set its value in below variable "hashValue"
    NSString *hashValue = [NSMutableString new];
    if (commandName == HashConstant.mcpLookup) {
       if commandName == HashConstant.mcpLookup {
        //To create HMACSHA1 Signature 
        // Signature = HMAC-SHA1(data, key);
        //Data = hashStringWithoutSalt
        //Key = Mechent Secret Key shared with the merchant at the time of on-boarding 
        hashValue = @<HMACSHA1 signature from your server>;
    } else {
        hashValue = @<HMACSHA512 hash from your server>;
    }
    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:hashValue, commandName, nil];
    onCompletion(dict);
}

Pass Merchant Access Key in Additional Params in Payment Params as mentioned .

For MCP payments, SDK requires Lookup API Hash which is a Dynamic Hash. SDK will call generateHash() method as explained

here
here
Demo of MCP flow