CreatePaymentForm: Create Payment Form

How it works

  • You use this function to configure a new payment form. It will return the ID of the newly created form. Eg: 

    Payment form Id example
    579c7def4bb0411da294d9b57c2c1323
  • Combine this Payment form's id with your Webkit URL, you will get the link to the payment form page. Eg

    Payment link examples

    https://webkit.lemonway.fr/mb/YourCompany/prod/payment-page/?fId=579c7def4bb0411da294d9b57c2c1323

    or

    https://sandbox-webkit.lemonway.fr/YourCompany/dev/payment-page/?fId=579c7def4bb0411da294d9b57c2c1323

  • Now you can communicate this link to your end-user 
    • by mail or any means you want
    • by embedding the form to your website or mobile webview.
  • This link is re-usable.
  • Lemonway will not send any notification to the end-user after payment. It is up to you to communicate with your users.

Request


XML

<CreatePaymentForm xmlns="Service_mb">
  <wlLogin>string</wlLogin>
  <wlPass>string</wlPass>
  <language>string</language>
  <version>string</version>
  <walletIp>string</walletIp>
  <walletUa>string</walletUa>
  <optId>string</optId>  
  <walletPayer>string</walletPayer>
  <walletReceiver>string</walletReceiver>
  <amountTot>string</amountTot>
  <amountCom>string</amountCom>
  <comment>string</comment>
  <returnUrl>string</returnUrl>
  <cancelUrl>string</cancelUrl>
  <errorUrl>string</erroUrl>
  <firstNamePayer>string</firstNamePayer>
  <lastNamePayer>string</lastNamePayer>
  <emailPayer>string</emailPayer>
  <style>string</style>
  <atosStyle>string</atosStyle>
  <notifUrl>string</notifUrl>
  <options>string</options>
</CreatePaymentForm>
 

JSON

{
    "wlLogin": "string",
    "wlPass": "string",
    "language": "string",
    "version": "string",
    "walletIp": "string",
    "walletUa": "string",
    "optId": "string",
    "walletPayer": "string",
    "walletReceiver": "string",
    "amountTot": "string",
    "amountCom": "string",
    "comment": "string",
    "returnUrl": "string",
    "cancelUrl": "string",
    "errorUrl": "string",
    "firstNamePayer": "string",
    "lastNamePayer": "string",
    "emailPayer": "string"
    "style": "string"
    "atosStyle": "string"
    "notifUrl": "string"
    "options": "string"
}

Params

Description

Mandatory

Format

Example

optId

Optional identity of the payment form. You shouldn't use special character here.

No

[0 : 60]

Order1234

walletPayer

Payer Wallet.
If this field is filled then the money reaches this wallet before arriving at the beneficiary wallet (via a transfer wallet to wallet)

Don't put the wallet sc here, it won't work. You cannot credit the wallet sc with a credit card.

No

[0 : 100]

8888

walletReceiver

Beneficiary Wallet.
If this field is not filled then the end-user must fill its value on the payment form. We recommend you always fill it instead of your end-user.

Don't put the wallet sc here, it won't work. You cannot credit the wallet sc with a credit card.

No[0 : 100]9999

amountTot

Amount or a range of the amount to be debited.

  • If this field is configured with an interval (eg, 15.30-500.26) then the final customer will have to enter an appropriate amount in the form

  • If this field is not filled then the end-user can enter any amount into the form

  • If this field is filled with a precise value (eg 15.60), then the end-user has no choice in the amount field of the form

No

[0:33]

15.00

10.00-600.00

amountCom

Amount of commission you wish to take

No

2 decimals

1.00

comment

Optional comment

No

[0 :140]

Commande numéro 245

returnUrlURL redirection after the payment procedure is successfully finished No[0:255]http://YourCompany.com/ThankYou
cancelUrlURL redirection after the payment procedure is canceledNo[0:255] http://YourCompany.com/PleaseComeBackLater
errorUrlURL redirection after the payment procedure is failedNo[0:255]http://YourCompany.com/Sorry
firstNamePayer

Payer's first name.
If this field is not filled then the end-user has to fill it in the payment form.

No[0:255]Jean
lastNamePayer

Payer's last name.
If this field is not filled then the end-user has to fill it in the payment form.

No[0:255]DUPONT
emailPayer

Payer's email.
If this field is not filled then the end-user has to fill it in the payment form.

No[0:255]jean.dupont@email.com
style

Link to a custom CSS stylesheet.
The stylesheet should be publicly accessible via HTTP

No[0:255]

Example: https://sandbox-webkit.lemonway.fr/demo/dev/payment-page/css/main.css

atosStyle

Atos v1 only: Link to a custom Atos CSS stylesheet.
The stylesheet should be publicly accessible via HTTPS

No[0:255]https://YourCompany.com/public/atos.css
notifUrlAt the end of the payment procedure, An HTTP POST message containing the payment status (PAID, ERROR, CANCEL) is sent to this address. It is possible that the same notification might be sent several times.No[0:255]http://login:pass@YourCompany.com/notif/?origine=lemonway&orderId=135
optionsReserved for a future versionNo[0:255]

Response

 

XML

<CreatePaymentFormResult xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Service_mb_xml">
  <FORM>
<id>579c7def4bb0411da294d9b57c2c1323</id>
<optId>Order1234</optId>
<walletPayer>8888<walletPayer/>
<walletReceiver>9999</walletReceiver>
<walletIp>82.26.79.125</walletIp> 
<walletUa>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.3</walletUa>
 <amountTotRange>10.00-500.00</amountTotRange>
 <amountCom/>
 <comment>Commande numéro 245</comment>
 <returnUrl>http://YourCompany.com/ThankYou</returnUrl>
 <cancelUrl>http://YourCompany.com/PleaseComeBackLater</cancelUrl>
 <errorUrl>http://YourCompany.com/Sorry<errorUrl>
 <language>fr</language>
 <version>1.9</version>
 <firstNamePayer>Jean</firstNamePayer>
 <lastNamePayer>DUPONT</lastNamePayer>
 <emailPayer>jean.dupont@email.com</emailPayer>
 <style>https://YourCompany.com/public/payment.css</style>
 <atosStyle>https://YourCompany.com/public/atos.css</atosStyle>
 <notifUrl>http://login:pass@YourCompany.com/notif/?origine=lemonway&orderId=135</notifUrl>
 <options></options>
 <active>1</active>
 </FORM>
 </CreatePaymentFormResult>

JSON

{
   "FORM": {
   "id": "579c7def4bb0411da294d9b57c2c1323",
   "optId": "ooo",
   "walletPayer": "8888",
   "walletReceiver": "9999",
   "walletIp": "163.5.208.226",
   "walletUa": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.3",
   "amountTot": "",
   "amountCom": "",
   "comment": "",
   "returnUrl": null,
   "cancelUrl": null,
   "errorUrl": null,
   "language": "fr",
   "version": "1.1",
   "firstNamePayer": "Jean",
   "lastNamePayer": "DUPONT",
   "emailPayer": "jean.dupont@gmail.com",
   "style": "https://MyCompany.com/public/payment.css",
   "atosStyle": null,
   "notifUrl": null,
   "options": null,
   "active": "1"
   }
}
 

Notification (notifUrl)

At the end of the payment procedure, An HTTP POST message containing the payment status (PAID, ERROR, CANCEL) is sent to the notifUrl.

The same notification might be sent several times to your notifUrl. An impostor can also send the same notification. When you received a notification, please make sure to confirm the payment status with GetCompletedPaymentForm

Example:

POST:(
        [optId] => ooo
        [parentId] => 579c7def4bb0411da294d9b57c2c1323
        [parentComment] => test with notif and P2P
        [id] => 7e98be392a5e45f6bc357a9ab8c623d2
        [walletPayer] => 8888
        [walletReceiver] => 9999
        [amountTot] => 60.48
        [comment] =>
        [firstNamePayer] => Jean
        [lastNamePayer] => DUPONT
        [emailPayer] => jean.dupont@gmail.com
        [status] => PAID
        [utcdate] => 2016-09-19 13:09:16Z
        [created] => 2016-09-19 15:09:12Z
        [returnUrl] => ""
        [cancelUrl] => ""
        [errorUrl] => ""
    )