What do you need to do when you receive the mail with the account credentials?

Secure Form

When your clients wish to buy something from you, they search your website looking for what they need. When they find it, they add it to the cart. When the cart is full, the shopping should be completed, so the client should pay – and you are there to make it possible. You need to implement the “call to action” button (it might be “buy now” button), which transfers the client to our site – the payment gateway, in order to make payment. When the payment is fulfilled, the transaction is made and both you, and your client know the transaction status, the client is redirected to your website again.

The code

In order to make this magic happen, you need to write a code which directs your customer to PayLane's payment gateway.

Here you can find the simplest HTML code example, you can use:

<form action="https://secure.paylane.com/order/cart.html" method="post">
    <input type="hidden" name="amount" value="19.99" />
    <input type="hidden" name="currency" value="EUR" />
    <input type="hidden" name="merchant_id" value="john_test" />
    <input type="hidden" name="description" value="TR001" />
    <input type="hidden" name="transaction_description" value="Product 1 transaction" />
    <input type="hidden" name="transaction_type" value="S" />
    <input type="hidden" name="back_url" value="http://johns-shop.com/purchased" />
    <input type="hidden" name="language" value="en" />
    <input type="hidden" name="hash" value="6926ed14d1ae4d8eb2350d3c15e6a420e3bb7052" />

    <button type="submit">Pay with PayLane</button>
</form>

In order to put everything into practice follow the below-mentioned hints:

  1. You start with 1 constant - which is salt that is known only to us and you, it belongs to your merchant account.

Remember: merchant id and salt are sent to you by email when we open your account. If, by aby case, you lose this email, you can easily find these credentials in your merchant panel – you can do it by clicking account, Secure Form customization and Options.

  1. You gather parameters from e.g the shopping cart: $amount, $currency, $description and pass it to above script - eg you pass it as a $_POST

  2. Now you should change variables declaration like so: $amount=$_POST['amount'];, $description=$_POST['desc']; ... etc

  3. You should calculate the hash value using this example:

hash = SHA1(salt + "|" + description + "|" + amount + "|" + currency + "|" + transaction_type)

Remember to put the hash`s result in the code, not the equation.

  1. Now your work is basically done, because hash is calculated when someone hits your script with appropriate $_POST parameters.

What happens next?

After the payment process – when the transaction is made successfully, the buyer comes back to your website which was set as the back_URL parameter. The buyer is redirected to your website and the provider (PayLane) sends you some important data: eg transaction status, transaction ID that help you identify the purchase.Then you should write a script which enables sending the transaction status to your customers so they are informed about the transaction status as well.

Always be sure!

As life is very unexpected, so are the electric devices. It may always happen that something goes wrong, e.g. electricity shortage, the internet connection or server breaks down or any other unexpected thing happens. This is why we strongly recommend you to use our transaction notifications.
Owing to them you will always be notified about the transaction status, so you will be sure whether the money was really sent to you. In order to make this possible, the only thing you need to do is to write a script which is able to receive the POST data and receive the specific content. Once you send us the URL with this script, we will set it up on your account(s). This would mean that you will receive the transaction notifications. Finally, the notifications are on and you don't worry about transaction statuses. As easy as that!

If you'd like to read more, check our devzone!

http://devzone.paylane.com/secure-form-guide

http://devzone.paylane.com/transaction-notifications

Know everything? Great, then begin testing PayLane!
Sign up