Full Page PayPal Redirection

Integrate PayPal Payments with Lemonway

How does it work?

The page redirection integration method follows a standard page-to-page (no pop-up window) payment flow with a redirect to PayPal and a redirect back to your site after payment.

Example:

Required endpoint:

POST /webservice/v2/moneyins/paypal/init

  • Request: Parameters and body (mandatory) See: Mandatory Request Objects Table
  • Response: id, payPalOrderId, and redirectionUrl

Mandatory Request Objects

👍

Note

The parameters outlined in the table are mandatory. If they are not forfiled you will recieve an error in the reponse.

Body

Object

redirections

returnURL

returnURL

cancelURL

transaction

accountId

totalAmount

delivery (receiver)

Receiver: full name

Address mandatory only if an item(s) is a physical type.

address includes:

country
city
street
postCode

items

merchantAccountId

description

quantity

unitAmount

type (digital or physical)

🚧

Important

Your redirectional URLs (success, cancel and error) must be publicly accessible so your end user and our webkit server could send requests to them.

Example Payload in JSON:

{
    "redirections": {
        "returnUrl": https://myplatform.fr/wz2/OK_(expression)#/oksucces,
        "errorUrl": https://myplatform.fr/546426/2/statuserror,
        "cancelUrl": https://myplatform.fr/546426/2/statuscancel,
    },
    "transaction": {
        "reference": "{{reference}}",
        "accountId": "MKP",
        "totalAmount": 22740,
        "commissionAmount": 0,
        "comment": "My superb transaction",
        "autoComission": false
    },
    "amountBreakdown": {
        "totalItems": 19880,
        "totalItemTaxes": 4060,
        "handling": 0,
        "insurance": 500,
        "shipping": 300,
        "shippingDiscount": 0,
        "discount": 2000
    },
    "items": [
        {
            "merchantAccountId": "Inova_Store",
            "description": "Four encastrable Electrolux EOE7P11X0",
            "quantity": 1,
            "unitAmount": 12880,
            "type": "physical",
            "taxAmount": 3220
        },
        {
            "merchantAccountId": "Numbay_Electronics",
            "description": "X50 Battery",
            "quantity": 2,
            "unitAmount": 3500,
            "type": "physical",
            "taxAmount": 420
        }
    ],
    "delivery": {
        "address": {
            "country": "FR",
            "city": "PARIS",
            "street": "8 rue sentier",
            "postCode": "75002",
            "state": "Ile-De-France"
        },
        "receiver": {
            "fullName": "Eric Donton"
        }
    },
    "riskData": {
        "test1": "lw",
        "test2": “lw23”,
        "test3": “value,
        "value": "value"
    }
{
  "id": 0,
  "redirectionUrl": "yourwebsite.com/success",
  "payPalOrderId": "PP1234",
  "error": {
    "code": 0,
    "message": "string",
    "psp": {
      "message": "string"
    }
  }
}

Example Payload in SOAP:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <MoneyInPayPalInit xmlns="Service_mb_xml">
            <redirections>
                <returnUrl>http://www.marketplace.com/ok</returnUrl>
                <errorUrl>http://www.marketplace.com/ko</errorUrl>
                <cancelUrl>http://www.marketplace.com/cancel/cancelUrl>
            </redirections>
            <transaction>
                <reference>{{reference}}</reference>
                <walletId>mkp</walletId>
                <totalAmount>10.00</totalAmount>
                <commissionAmount>1.00</commissionAmount>
                <comment>test paypal Lemonway</comment>
            </transaction>
            <amountBreakdown>
                <totalItems>10.00</totalItems>
                <totalItemTaxes>0</totalItemTaxes>
                <shipping>0</shipping>
                <handling>0</handling>
                <insurance>0</insurance>
                <shippingDiscount>0</shippingDiscount>
                <discount>0</discount>
            </amountBreakdown>
            <delivery>
                <address>
                    <country>FR</country>
                    <city>paris</city>
                    <street>sentier</street>
                    <postCode>75001</postCode>
                    <state>Ile-De-France</state>
                </address>
                <receiver>
                    <fullName>mike tomn</fullName>
                </receiver>
            </delivery>
            <items>
                <item>
                    <merchantWalletId>mkp</merchantWalletId>
                    <description>shooping</description>
                    <quantity>1</quantity>
                    <unitAmount>10.00</unitAmount>
                    <type>Digital</type>
                    <taxAmount>0</taxAmount>
                </item>
            </items>
            <walletIp>1.1.1.2</walletIp>
            <walletUa>chrome</walletUa>
            <language>en</language>
            <wlLogin>{{wlLogin}}</wlLogin>
            <wlPass>{{wlPass}}</wlPass>
        </MoneyInPayPalInit>
    </soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <MoneyInPayPalInitResponse xmlns="Service_mb_xml">
            <MoneyInPayPalInitResult>
                <MoneyInId>71348</MoneyInId>
                <RedirectionUrl>https://www.lodxld.paypal.com/checkoutnow?token=6SV01997U7118594W</RedirectionUrl>
                <PayPalOrderId>6SV01997U7118594W</PayPalOrderId>
            </MoneyInPayPalInitResult>
        </MoneyInPayPalInitResponse>
    </soap:Body>
</soap:Envelope>

Buyer Journey

To initiate PayPal payments, use thePOST /v2/moneyins/paypal/init call to receive a redirection URL to redirect your end-user to PayPal.com. They will then be able to finalize their payment.

Step by Step

This method is commonly used on web platforms.

  1. The end-user adds items or services to the shopping cart.
  1. They view the items in the cart and then click Pay. You offer the PayPal option and the end user clicks the PayPal button.
  1. The buyer is redirected to PayPal.com and then logs into their account to approve the payment.
  1. The buyer clicks continue and makes the purchase.
  1. If payment is successful the buyer is redirected to your specified success page.