Examples in Ruby on Rails calling DirectKit JSON2
- Register a Payer Wallet (RegisterWallet)
- Register a Receiver Wallet (RegisterWallet)
- Update email for Receiver Wallet (UpdateWalletDetails)
- Register a credit card for Payer Wallet (RegisterCard)
- Pay 100.00€ to Payer Wallet with the registered card (MoneyInWithCardId)
- Send 10.00€ from Payer Wallet to Receiver Wallet (SendPayment)
- Register an IBAN for Receiver Wallet (RegisterIBAN)
- Take 10.00€ from Receiver Wallet to the registered IBAN (MoneyOut)
- Controller: scenario_controller.rb
DIRECKIT_URL = "https://sandbox-api.lemonway.fr/mb/{#yourCompany}/dev/directkitjson2/Service.asmx"
LOGIN = "society"
PASSWORD = "123456"
LANGUAGE = "en"
IS_SANDBOX = true
- View: index.html.erb
{
:wallet => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
:clientMail => "[email protected]",
:clientFirstName => "Payer",
:clientLastName => "Payer"
}
{
"d" => {
"__type" => "WonderLib.RegisterWalletResult",
"WALLET" => {
"ID" => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
"LWID" => "39271"
},
"E" => nil
}
}
- ID: Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc
- LWID: 39271
{
:wallet => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
"BAL" => "0.00",
"NAME" => "Payer PAYER",
"EMAIL" => "[email protected]",
"DOCS" => [],
"IBANS" => [],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39271",
"CARDS" => [],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc
- BAL: 0.00
- NAME: Payer PAYER
- EMAIL: [email protected]
- DOCS: []
- IBANS: []
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39271
- CARDS: []
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary:
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
:clientMail => "[email protected]",
:clientFirstName => "Receiver",
:clientLastName => "Receiver"
}
{
"d" => {
"__type" => "WonderLib.RegisterWalletResult",
"WALLET" => {
"ID" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"LWID" => "39272"
},
"E" => nil
}
}
- ID: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- LWID: 39272
{
:email => "[email protected]"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"BAL" => "0.00",
"NAME" => "Receiver RECEIVER",
"EMAIL" => "[email protected]",
"DOCS" => [],
"IBANS" => [],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39272",
"CARDS" => [],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- BAL: 0.00
- NAME: Receiver RECEIVER
- EMAIL: [email protected]
- DOCS: []
- IBANS: []
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39272
- CARDS: []
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary:
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
:newEmail => "new-Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com"
}
{
"d" => {
"__type" => "WonderLib.UpdateWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"LWID" => "39272"
},
"E" => nil
}
}
- ID: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- LWID: 39272
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"BAL" => "0.00",
"NAME" => "Receiver RECEIVER",
"EMAIL" => "new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com",
"DOCS" => [],
"IBANS" => [],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39272",
"CARDS" => [],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- BAL: 0.00
- NAME: Receiver RECEIVER
- EMAIL: new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com
- DOCS: []
- IBANS: []
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39272
- CARDS: []
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary:
{
:wallet => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
:cardType => "1",
:cardNumber => "5017670000006700",
:cardCode => "123",
:cardDate => "12/2019"
}
{
"d" => {
"__type" => "WonderLib.RegisterCardResult",
"CARD" => {
"ID" => "13174",
"EXTRA" => {
"IS3DS" => "0",
"CTRY" => "",
"AUTH" => "651163",
"NUM" => "501767XXXXXX6700",
"EXP" => "12/2019"
}
},
"E" => nil
}
}
- ID: 13174
- EXTRA:
- IS3DS: 0
- CTRY:
- AUTH: 651163
- NUM: 501767XXXXXX6700
- EXP: 12/2019
{
:wallet => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
:cardId => "13174",
:amountTot => "100.00",
:amountCom => "10.00",
:comment => "(Ruby tuto) MoneyInWithCardId 100.00 to Payer"
}
{
"d" => {
"__type" => "WonderLib.MoneyInResult",
"TRANS" => {
"HPAY" => {
"ID" => "50629",
"MLABEL" => "501767XXXXXX6700",
"DATE" => "15/09/2017 16:14:54",
"TIME" => nil,
"SEN" => "",
"REC" => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
"DEB" => "0.00",
"CRED" => "90.00",
"COM" => "10.00",
"MSG" => "(Ruby tuto) MoneyInWithCardId 100.00 to Payer",
"STATUS" => "3",
"EXTRA" => {
"IS3DS" => "0",
"CTRY" => "",
"AUTH" => "056266",
"NUM" => nil,
"EXP" => nil,
"TYP" => nil
},
"INT_STATUS" => nil,
"IS_FEE" => nil,
"FEE_REF" => nil,
"TYPE" => nil,
"INT_MSG" => nil,
"ORIGIN_ID" => nil,
"PRIVATE_DATA" => nil,
"SCHEDULED_DATE" => nil,
"MTOKEN" => nil,
"METHOD" => nil,
"MID" => nil,
"FROM_MONEYIN" => nil,
"CARD_ID" => nil,
"REFUND" => nil,
"VCC" => nil
}
},
"E" => nil
}
}
- HPAY:
- ID: 50629
- MLABEL: 501767XXXXXX6700
- DATE: 15/09/2017 16:14:54
- TIME:
- SEN:
- REC: Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc
- DEB: 0.00
- CRED: 90.00
- COM: 10.00
- MSG: (Ruby tuto) MoneyInWithCardId 100.00 to Payer
- STATUS: 3
- EXTRA:
- IS3DS: 0
- CTRY:
- AUTH: 056266
- NUM:
- EXP:
- TYP:
- INT_STATUS:
- IS_FEE:
- FEE_REF:
- TYPE:
- INT_MSG:
- ORIGIN_ID:
- PRIVATE_DATA:
- SCHEDULED_DATE:
- MTOKEN:
- METHOD:
- MID:
- FROM_MONEYIN:
- CARD_ID:
- REFUND:
- VCC:
{
:wallet => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
"BAL" => "90.00",
"NAME" => "Payer PAYER",
"EMAIL" => "[email protected]",
"DOCS" => [],
"IBANS" => [],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39271",
"CARDS" => [
{
"ID" => "13173",
"EXTRA" => {
"IS3DS" => "0",
"CTRY" => "",
"AUTH" => "625272",
"NUM" => "501767XXXXXX6700",
"EXP" => "12/2019",
"TYP" => "VISA"
}
},
{
"ID" => "13174",
"EXTRA" => {
"IS3DS" => "0",
"CTRY" => "",
"AUTH" => "651163",
"NUM" => "501767XXXXXX6700",
"EXP" => "12/2019",
"TYP" => "VISA"
}
}
],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc
- BAL: 90.00
- NAME: Payer PAYER
- EMAIL: [email protected]
- DOCS: []
- IBANS: []
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39271
- CARDS:
- ID: 13173
- EXTRA:
- IS3DS: 0
- CTRY:
- AUTH: 625272
- NUM: 501767XXXXXX6700
- EXP: 12/2019
- TYP: VISA
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary:
{
:debitWallet => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
:creditWallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
:amount => "10.00",
:message => "(Ruby tuto) SendPayment 10.00 from Payer to Receiver"
}
{
"d" => {
"__type" => "WonderLib.SendPaymentResult",
"TRANS_SENDPAYMENT" => {
"HPAY" => {
"ID" => "33871",
"DATE" => "15/09/2017 16:14:55",
"SEN" => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
"REC" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"DEB" => "10.00",
"CRED" => "10.00",
"COM" => "0.00",
"STATUS" => "3"
}
},
"E" => nil
}
}
- HPAY:
- ID: 33871
- DATE: 15/09/2017 16:14:55
- SEN: Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc
- REC: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- DEB: 10.00
- CRED: 10.00
- COM: 0.00
- STATUS: 3
{
:wallet => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc",
"BAL" => "80.00",
"NAME" => "Payer PAYER",
"EMAIL" => "[email protected]",
"DOCS" => [],
"IBANS" => [],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39271",
"CARDS" => [
{
"ID" => "13173",
"EXTRA" => {
"IS3DS" => "0",
"CTRY" => "",
"AUTH" => "625272",
"NUM" => "501767XXXXXX6700",
"EXP" => "12/2019",
"TYP" => "VISA"
}
},
{
"ID" => "13174",
"EXTRA" => {
"IS3DS" => "0",
"CTRY" => "",
"AUTH" => "651163",
"NUM" => "501767XXXXXX6700",
"EXP" => "12/2019",
"TYP" => "VISA"
}
}
],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Payer-6d64cb06-f2e3-481c-a881-db3f11df72dc
- BAL: 80.00
- NAME: Payer PAYER
- EMAIL: [email protected]
- DOCS: []
- IBANS: []
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39271
- CARDS:
- ID: 13173
- EXTRA:
- IS3DS: 0
- CTRY:
- AUTH: 625272
- NUM: 501767XXXXXX6700
- EXP: 12/2019
- TYP: VISA
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary:
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"BAL" => "10.00",
"NAME" => "Receiver RECEIVER",
"EMAIL" => "new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com",
"DOCS" => [],
"IBANS" => [],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39272",
"CARDS" => [],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- BAL: 10.00
- NAME: Receiver RECEIVER
- EMAIL: new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com
- DOCS: []
- IBANS: []
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39272
- CARDS: []
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary:
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
:holder => "Receiver Receiver",
:bic => "ABCDEFGHIJK",
:iban => "FR1420041010050500013M02606",
:dom1 => "UNEBANQUE MONTREUIL",
:dom2 => "56 rue de Lays",
:comment => "(Ruby tuto) Register IBAN"
}
{
"d" => {
"__type" => "WonderLib.RegisterIBANResult",
"IBAN_REGISTER" => {
"S" => "5",
"ID" => "9592"
},
"E" => nil
}
}
- S: 5
- ID: 9592
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"BAL" => "10.00",
"NAME" => "Receiver RECEIVER",
"EMAIL" => "new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com",
"DOCS" => [],
"IBANS" => [
{
"ID" => "9592",
"S" => "5",
"DATA" => "FR1420041010050500013M02606",
"SWIFT" => "ABCDEFGHIJK",
"HOLDER" => "RECEIVER RECEIVER"
}
],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39272",
"CARDS" => [],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- BAL: 10.00
- NAME: Receiver RECEIVER
- EMAIL: new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com
- DOCS: []
- IBANS:
- ID: 9592
- S: 5
- DATA: FR1420041010050500013M02606
- SWIFT: ABCDEFGHIJK
- HOLDER: RECEIVER RECEIVER
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39272
- CARDS: []
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary:
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
:amountTot => "10.00",
:message => "(Ruby tuto) Money Out 10.00",
:ibanId => "9592",
:autoCommission => "1"
}
{
"d" => {
"__type" => "WonderLib.MoneyOutResultObject",
"TRANS" => {
"HPAY" => {
"ID" => "50630",
"MLABEL" => "FR1420041010050500013M02606",
"MID" => "9592",
"DATE" => "15/09/2017 16:15:03",
"SEN" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"REC" => "",
"DEB" => "10.00",
"CRED" => "0.00",
"COM" => "0.00",
"MSG" => "(Ruby tuto) Money Out 10.00",
"STATUS" => "3"
}
},
"E" => nil
}
}
- HPAY:
- ID: 50630
- MLABEL: FR1420041010050500013M02606
- MID: 9592
- DATE: 15/09/2017 16:15:03
- SEN: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- REC:
- DEB: 10.00
- CRED: 0.00
- COM: 0.00
- MSG: (Ruby tuto) Money Out 10.00
- STATUS: 3
{
:wallet => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53"
}
{
"d" => {
"__type" => "WonderLib.GetWalletDetailsResult",
"WALLET" => {
"ID" => "Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53",
"BAL" => "0.00",
"NAME" => "Receiver RECEIVER",
"EMAIL" => "new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com",
"DOCS" => [],
"IBANS" => [
{
"ID" => "9592",
"S" => "5",
"DATA" => "FR1420041010050500013M02606",
"SWIFT" => "ABCDEFGHIJK",
"HOLDER" => "RECEIVER RECEIVER"
}
],
"STATUS" => "5",
"BLOCKED" => "0",
"SDDMANDATES" => [],
"LWID" => "39272",
"CARDS" => [],
"FirstName" => nil,
"LastName" => nil,
"CompanyName" => nil,
"CompanyDescription" => nil,
"CompanyWebsite" => nil,
"isDebtor" => nil,
"payerOrBeneficiary" => nil
},
"E" => nil
}
}
- ID: Ruby-Receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53
- BAL: 0.00
- NAME: Receiver RECEIVER
- EMAIL: new-ruby-receiver-a21f6a27-d2b7-472d-a086-fe9a41feca53@lemonway.com
- DOCS: []
- IBANS:
- ID: 9592
- S: 5
- DATA: FR1420041010050500013M02606
- SWIFT: ABCDEFGHIJK
- HOLDER: RECEIVER RECEIVER
- STATUS: 5
- BLOCKED: 0
- SDDMANDATES: []
- LWID: 39272
- CARDS: []
- FirstName:
- LastName:
- CompanyName:
- CompanyDescription:
- CompanyWebsite:
- isDebtor:
- payerOrBeneficiary: