Initiate a Web Payment
MoneyInWebInit
How does it work?
This functionality enables you to use our card payment web pages.
Payment with a New Card
- By calling MoneyInWebInit, you receive a MoneyInToken
Did you know?
If you want to register a card for future payments set
registerCard=1
and you will also receive a cardId
- With this MoneyInToken, you are able to redirect the end-user to the Web Payment page. You have to combine the Token and the Lemonway Webkit URL to get the Payment Page URL. You can find the URL of the WebKit in the onboarding email.
For example, https://sandbox-webkit.lemonway.fr/YOUR_COMPANY/dev/ - After submitting the payment, the end-user will be redirected to:
returnUrl
in case of success,cancelUrl
in case of cancellation, anderrorUrl
in case of error
Payment with a Registered Card (Web)
To use this type of payment you have to make at least one transaction and set registerCard=1
. On this first transaction, we will return a cardId that is associated with the client card. Ensure that you save this cardId to use for future payment, or use the method Retrieve Payment Details to get the cardId.
Payments on a registered card use the following process:
You call MoneyInWebInit ensuring that you include the cardId in the body of the request. Refer to steps 2 and 3 as stated above.
Important
To ensure that the client’s card has been registered, call the following method before you initiate payments on a registered card: Check if Card is Registered
Subscription Payments
A prerequisite to setting up a subscription is that you have previously made a payment with a card and registered the card using MoneyWebInit.
Did you know?
Initial transaction for a subscription can be for a predetermined or an undetermined length of time.
After you have registered a card refer to Charge a Registered Card to begin setting up a subscription or payment by the delivery system.
Important
When creating recurring payments that are one shot, ensure that you use the correct format One_shot as stated in the API.
Warning
When creating a recurring payment the
recurringAvgAmount
must be higher thantotalAmount
.
If a lower amount is entered forrecurringAvgAmount
you will receive a directkit error message: 368: recurringAvgAmount stating that the amount should be greater than the transaction amount.
Important
To ensure the likelihood of frictionless payments you must set up payments of equal recurring amounts.
Deferred Payments
If you want to create a deferred Web Payment, in the request please indicate within delayedDays
, a number between 1 and 6 days to have guaranteed payment.
To validate the pre-authorization and capture funds, you need to call Capture a Deferred Payment. If the capture is a success, then the original transaction status switches to Success.
Request
```xml
<!-- Request -->
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<MoneyInWebInit xmlns="Service_mb_xml">
<wallet>{{wallet}}</wallet>
<amountTot>15.00</amountTot>
<amountCom>1.00</amountCom>
<comment>Test for new DSP2 inputs</comment>
<useRegisteredCard>0</useRegisteredCard>
<returnUrl>https://en.wikipedia.org/wiki/OK</returnUrl>
<cancelUrl>https://en.wikipedia.org/wiki/Cancel</cancelUrl>
<errorUrl>https://en.wikipedia.org/wiki/Error</errorUrl>
<wlLogin>{{login}}</wlLogin>
<wlPass>{{password}}</wlPass>
<language>en</language>
<version>5.0</version>
<walletIp>1.1.1.1</walletIp>
<walletUa>Chrome</walletUa>
<email>test@lemonway.com</email>
<label>label test</label>
<cardId>0</cardId>
<delayedDays>0</delayedDays>
<challengeModeId>1</challengeModeId>
<merchantCustomerAuthenticationMethodId>3</merchantCustomerAuthenticationMethodId>
<merchantCustomerAuthenticationDateTime>2021/05/24 06:00:00</merchantCustomerAuthenticationDateTime>
<billingAddressCity></billingAddressCity>
<billingAddressAdditional1></billingAddressAdditional1>
<billingAddressAdditional2></billingAddressAdditional2>
<billingAddressAdditional3></billingAddressAdditional3>
<billingAddressZipcode></billingAddressZipcode>
<billingAddressState></billingAddressState>
<billingAddressCountry>FRA</billingAddressCountry>
<holderContactFirstName>Hello</holderContactFirstName>
<holderContactLastName>World</holderContactLastName>
<holderContactPhone>+33100000000</holderContactPhone>
<holderContactMobile>+33100000000</holderContactMobile>
<holderContactWorkPhone>+33100000000</holderContactWorkPhone>
<holderContactEmail>hello@world.com</holderContactEmail>
<deliveryAddressCity></deliveryAddressCity>
<deliveryAddressAdditional1></deliveryAddressAdditional1>
<deliveryAddressAdditional2></deliveryAddressAdditional2>
<deliveryAddressAdditional3></deliveryAddressAdditional3>
<deliveryAddressZipcode></deliveryAddressZipcode>
<deliveryAddressState></deliveryAddressState>
<deliveryAddressCountry>FRA</deliveryAddressCountry>
<addressDeliveryBillingMatchIndicator>true</addressDeliveryBillingMatchIndicator>
<deliveryContactEmail>hello@world.com</deliveryContactEmail>
<deliveryAddressCreationDate>2021/05/24 06:00:00</deliveryAddressCreationDate>
<deliveryMode>string</deliveryMode>
<estimatedDeliveryDelay>0</estimatedDeliveryDelay>
<numberOfItemsBasket>0</numberOfItemsBasket>
<addPaymentMeanDate>2021/05/24 06:00:00</addPaymentMeanDate>
<customerAccountChangeDate>2021/05/24 06:00:00</customerAccountChangeDate>
<customerAccountCreationDate>2021/05/24 06:00:00</customerAccountCreationDate>
<customerAccountId>string</customerAccountId>
<numberOfAttemptsAddCard24Hours>0</numberOfAttemptsAddCard24Hours>
<numberOfPurchase180Days>0</numberOfPurchase180Days>
<numberOfTransaction24Hours>0</numberOfTransaction24Hours>
<numberOfTransactionYear>0</numberOfTransactionYear>
<passwordChangeDate>2021/05/24 06:00:00</passwordChangeDate>
<suspiciousActivityIndicator>false</suspiciousActivityIndicator>
</MoneyInWebInit>
</soap12:Body>
</soap12:Envelope>
Response
<!-- Response -->
<?xml version="1.0" encoding="utf-8"?>
<MONEYINWEB>
<TOKEN>String</TOKEN>
<ID>String</ID>
<CARD>
<ID>string</ID>
</CARD>
<REDIRECTURL>String</REDIRECTURL>
</MONEYINWEB>
Resquest
// Request
{
"p": {
"wallet": "{{wallet}}",
"amountTot":"2.00",
"amountCom":"1.00",
"returnUrl": "https://en.wikipedia.org/wiki/OK",
"errorUrl": "https://en.wikipedia.org/wiki/Error",
"cancelUrl": "https://en.wikipedia.org/wiki/Cancel",
"wlLogin": "{{login}}",
"wlPass": "{{password}}",
"language": "fr",
"version" : "1.3",
"walletIp" : "1.1.1.1",
"walletUa" : "LWSUPPORT_test",
"moneyInNature": "123",
"challengeModeId": "No_preference",
"merchantCustomerAuthenticationMethodId": "NOAUTHENT",
"merchantCustomerAuthenticationDateTime": "",
"billingAddressCity": "",
"billingAddressAdditional1": "",
"billingAddressAdditional2": "",
"billingAddressAdditional3": "",
"billingAddressZipcode": "",
"billingAddressState": "",
"billingAddressCountry": "FRA",
"holderContactFirstName": "Hello",
"holderContactLastName": "World",
"holderContactEmail": "hello@world.com",
"holderContactPhone": "",
"holderContactMobile": "",
"holderContactWorkPhone": "",
"deliveryAddressCity": "",
"deliveryAddressAdditional1": "",
"deliveryAddressAdditional2": "",
"deliveryAddressAdditional3": "",
"deliveryAddressZipcode": "",
"deliveryAddressState": "",
"deliveryAddressCountry": "FRA",
"addressDeliveryBillingMatchIndicator": "",
"deliveryContactEmail": "",
"deliveryAddressCreationDate": "",
"deliveryMode": "",
"estimatedDeliveryDelay": "",
"numberOfItemsBasket": "",
"customerAccountId": "",
"addPaymentMeanDate": "",
"customerAccountChangeDate": "",
"customerAccountCreationDate": "",
"numberOfAttemptsAddCard24Hours": "",
"numberOfPurchase180Days": "",
"numberOfTransaction24Hours": "",
"numberOfTransactionYear": "",
"passwordChangeDate": "",
"suspiciousActivityIndicator": ""
}
}
Response
// Response
{
"MONEYINWEB": {
"TOKEN":"String",
"ID":"String",
"CARD": {
"ID":"string"
},
"REDIRECTURL":"String"
}
}
Request Input Description
Item | Description | Mandatory | Format | Example |
---|---|---|---|---|
challengeMode | If you would like to enforce 3D Secure for your client then use the challenge mode. Possible values are No_preference (default value). The cardholder's bank will decide whether or not to challenge (CHALLENGE ). | No | string | no_preference |
wkToken | Unique ID of the call created by your server that will be used and returned by Lemonway at the end of the operation, using a POST on your URL. | Yes | [1: 50] char | 5652772 |
wallet | Payment account ID to credit. Cannot be SC | Yes | [0: 256] char | 33612345678 or taxi67 |
returnUrl | Your back URL, called by WebKit to terminate the operation. | Yes | [1: max] char | https://www.yoursite.com/thankyou.php |
registerCard | Save the card and returns an ID for future payments. 0 = no (by default) 1 = yes | No | [1] char | 0: no (by default) |
moneyInNature | Indicate the nature of the activity for this Money-In. 0: activity 1 1: activity 2 | No | [1] char | 0 : non (par défaut) |
label | Indicate the name of the shop on the payment page. | No | — | — |
isPreAuth | Indicates if the request is delayed and will require validation. If empty: default is no delay, no validation (unless otherwise stated in your contract). If = 1: payment is pre-authorized—call MoneyInValidate within delayDays . | No | [0:1] char | 0 |
If set to anything else, debit is immediately effective. Only available for Atos V2 and Payzen. | ||||
errorUrl | Your return URL, called by WebKit in case of an error. | Yes | [1: max] char | https://www.yoursite.com/oops.php |
delayedDays | Indicate the number of days of a deferred payment (0–6) to have guaranteed payment. Only usable with isPreAuth=1 . Only available for Atos v2, Payzen, Monetico. | No | — | 6 |
comment | Comment regarding the transaction. | No | [0:140] char | Order number 2457765AX2 |
cardId | The card ID associated with the transaction. (Only if making a transaction with a registered card.) | No | string | AB4545 |
cancelUrl | Your return URL, called by WebKit in case of a cancellation. | Yes | [1: max] char | https://www.yoursite.com/seeYouNextTime.php |
autoCommission | If yes, [amountCom] is ignored and replaced with Lemonway's fee (you will not receive any fee).0 = No (default) 1 = Yes | No | [1] char | 0: No (by default) |
amountTot | Amount to debit from the card. | Yes | 2 decimals | 15 |
amountCom | Your fee. | No | 2 decimals | 1 |
paymentPattern | Recurring if the payment follows a recurring amount, or One_shot if there are no future recurring payments. | No | Recurring or One_shot | — |
recurringAvgAmount | Average amount of future recurring payments (only if it is higher than the amount of the first transaction). | No | string | — |
Additional Optional Inputs to Enable Frictionless Payments
The following table displays fields considered important for card/bank ranking systems. They recommend filling these if available. Priority ranges from R1 (most important) to R4.
Object | Field | Format | Descriptions | Example | Priority |
---|---|---|---|---|---|
billingAddress | billingAddress.city | string | Billing address | Paris | R2 |
billingAddress.country | string | FRA | |||
billingAddress.addressAdditional1 | string | 5 Avenue Anatole France | |||
billingAddress.addressAdditional2 | string | Etage 2 | |||
billingAddress.addressAdditional3 | string | ||||
billingAddress.zipcode | string | (postal code) | 75007 | ||
billingAddress.state | string | Paris | |||
holder | holder.firstName | string | Holder contact information | Michel | R1 |
holder.lastName | string | Dupont | R1 | ||
holder.email | string | MDupont@email.fr | R1 | ||
holder.phone | string | +33100000000 | R3 | ||
holder.mobile | string | +33100000000 | R3 | ||
holder.workPhone | string | +33100000000 | R3 | ||
deliveryAddress | deliveryAddress.city | string | Delivery address information | Paris | R1 |
deliveryAddress.country | string | France | |||
deliveryAddress.addressAdditional1 | string | 5 Avenue Anatole France | |||
deliveryAddress.addressAdditional2 | string | Etage 2 | |||
deliveryAddress.addressAdditional3 | string | ||||
deliveryAddress.zipcode | string | 75007 | |||
deliveryAddress.state | string | ||||
deliveryAdditionalInfo | deliveryAdditionalInfo.Contact.email | string | Delivery contact email | MDupont@email.fr | R2 |
numberOfItemsBasket | string | Number of items in the shopping cart | 8 | R4 | |
deliveryAdditionalInfo.DeliveryBillingMatch | boolean | Specifies whether delivery and billing addresses are the same (true/false). | true | R4 | |
deliveryAdditionalInfo.deliveryAddressCreationDate | YYYY/MM/DD | Creation date of the delivery address | 2020/05/05 | R4 | |
deliveryAdditionalInfo.estimatedDeliveryDelay | YYYY/MM/DD | Estimated delivery date | 2021/06/21 | R4 | |
deliveryAdditionalInfo.deliveryMode | string | Delivery method, e.g. Postal Office, Amazon box | Amazon Box | R4 | |
authentication | Authentication.merchantCustomerAuthentMethod | string | Authentication method used to authenticate the buyer before payment. | 3 | R4 |
Authentication.merchantCustomerAuthentDateTime | ISO8601 date time format | Date/time of the cardholder’s authentication | 2021-05-24T06:00Z | R4 | |
customerAccountInfo | customerAccountInfo.customerAccountId | string | Additional info about the account, optionally provided by the 3-D Secure Requestor. | Customer for 1 year | R4 |
customerAccountInfo.numberOfPurchase180Days | int | The number of customer transactions in the last six months (180 days). | 10 | R4 | |
customerAccountInfo.numberOfTransactionYear | int | Number of accepted/abandoned transactions in the last year on the merchant’s customer account. | 100 | R4 | |
customerAccountInfo.customerAccountCreationDate | YYYY/MM/DD | When the customer account was originally created. | 2020/05/05 | R4 | |
customerAccountInfo.numberOfAttemptsAddCard24Hours | int | Number of distinct cards used by the merchant’s account in the last 24 hours. | 1 | R4 | |
customerAccountInfo.suspiciousActivityIndicator | boolean | Whether suspicious activity was detected on this customer account (true/false). | false | R4 | |
customerAccountInfo.numberOfTransaction24Hours | string | How many transactions the customer made in the last 24 hours | 1 | R4 | |
customerAccountInfo.customerAccountChangeDate | YYYY/MM/DD | Last date the customer account was changed | 2020/07/14 | R4 | |
customerAccountInfo.passwordChangeDate | YYYY/MM/DD | Date of last password change on the customer account | 2020/07/14 | R4 | |
customerAccountInfo.addPaymentMeanDate | YYYY/MM/DD | Date a new payment method (e.g., a new card) was added to the account | 2020/05/05 | R4 |
Response Output Description
Version | Element | Description | Example |
---|---|---|---|
1 | TOKEN | Payment Token to pass to WebKit URL using GET | 1wGaBwkdOmOxWT0s4t1Z1364815 |
>=1.2 | ID | Transaction ID | 3232 |
>=1.3 | CARDID | Card ID if registerCard=1 | 34 |
The token is not reusable. You will have to generate a new token for each payment. You must initialize a new transaction for each test.
Mercanet v2:
You can customize the Mercanet payment page by creating a template pack and sending it to us. Once deployed, you can use it by adding the tpl
parameter in the WebKit URL, for example:
Please note
You should handle both GET or POST notifications from the WebKit. Ensure your
returnUrl
,cancelUrl
, anderrorUrl
are publicly accessible (not localhost or behind a firewall). No authentication should be required on these endpoints.
Identifying a transaction
When you receive notifications from the WebKit:
response_wkToken
is thewkToken
you specified inMoneyInWebInit
.response_transactionId
is the transaction ID generated by LemonWay.To get transaction details, call
GetMoneyInTransDetails
, passing either:
transactionMerchantToken = response_wkToken
, ortransactionId = response_transactionId
.