Iframe

In this option you can create your keys to execute the link payments within your own development.

The process has # steps:

Step 1: In the payment menu choose: Payin --> Checkout --> IFRAME KEYS

Step 2: In this module you will find the button "Add Key pairs + ", when you select it a new screen will be activated asking you to complete the required fields : Title of your product or service, Domain, Select Country, Select Destination Account, Currency .

Step 3: Enter the information of your merchant in each of the fields, if they are correct select "Accept", otherwise "Cancel".

Step 4: When you select "Accept", the system will confirm the creation of your keys and will show the generated private key.

  • With these keys you can embed our webcheckout with your shopping cart.

  • You can visualize the list of created keys and the status, additionally you can delete or block them.

Step 5: With the generated keys (public and private), a session token is created for the web checkout, which is rendered within the iframe.

Step 1: This is resolved with an endpoint and a custom server. It is of utmost importance that the private key is stored securely on your server and not included on the front end as shown in the example. Then,

Step 2: Create session You need to make a request to our endpoint https://api.stage.localpayment.com/bff/webcheckout/createsession passing the bodyMessage, signature, and publicKey as indicated in the example to obtain the session token.

Step 3: SET SRC (or use the createSession endpoint redirect) Finally, extract the redirectUrl property from the session token and assign it to the iframe.src.

An example is attached:

Example of the Algorithm to Sign the Body

public static string Sign(string content, string privateKey)
{
    var contentData = Encoding.ASCII.GetBytes(content);
    var privateKeyData = Convert.FromBase64String(privateKey);

    using var rsa = new RSACryptoServiceProvider();
    using var sha1 = SHA1.Create();

    rsa.ImportRSAPrivateKey(privateKeyData, out _);
    return Convert.ToBase64String(rsa.SignData(contentData, sha1));
}

Last updated