Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

integration of the Monetico payment system using ColdFusion

Community Beginner ,
Jul 16, 2024 Jul 16, 2024
This involves the integration of the Monetico payment system using ColdFusion.
An existing integration must be updated with additional security elements.
It is about the address which is given in a field.
 
{
“billing":{
“firstName": ‘Jérémy’,
“lastName": ‘Grimm’,
“addressLine1": ‘3 rue de l'église’,
“city": ‘Ostheim’,
“postalCode“:”68150”,
“country": ”FR”
},
“shipping":{
“firstName": ‘Jérémy’,
“lastName": ‘Grimm’,
“addressLine1": ‘3 rue de l'église’,
“city": ‘Ostheim’,
“postalCode“:”68150”,
“country": ‘FR’,
“email": ‘jerem68@hotmail.com’,
“phone“:”+33-612345678”,
“shipIndicator": ‘billing_address’,
“deliveryTimeframe": ‘two_day’,
“firstUseDate“:”2017-01-25”,
“matchBillingAddress":true
},
“client":{
“email": ‘jerem68@hotmail.com’,
“phone“:”+33-612345678”,
“birthCity": ‘Colmar’,
“birthPostalCode“:”68000”,
“birthCountry": ‘FR’,
“birthdate“:”1987-03-27”
}
}
 
I created a ColdFusion structure and used serializedJSON() to get the JSON string.
<cfset moneticoAPIStruct[“contexte_commande”] = toBase64(tostring(serializeJSON(strctContext)))/>
 
In PHP, according to the example, the field contect_Commande is encoded as follows.
$formFields[“contexte_commande”] = base64_encode(utf8_encode(json_encode($this->getContexteCommande())));
 

In an example it looks like this:

ewogICAiYmlsbGluZyI6ewogICAgICAiZmlyc3ROYW1lIjoiSsOpcsOpbXkiLAogICAgICAibGFzdE5hbWUiOiJHc
mltbSIsCiAgICAgICJhZGRyZXNzTGluZTEiOiIzIHJ1ZSBkZSBsJ8OpZ2xpc2UiLAogICAgICAiY2l0eSI6Ik9zdGhl
aW0iLAogICAgICAicG9zdGFsQ29kZSI6IjY4MTUwIiwKICAgICAgImNvdW50cnkiOiJGUiIKICAg fSwKICAgInNo
aXBwaW5nIjp7CiAgICAgICJmaXJzdE5hbWUiOiJKw6lyw6lteSIsCiAgICAgICJsYXN0TmFtZSI6IkdyaW1tIiwKIC
AgICAgImFkZHJlc3NMaW5lMSI6IjMgcnVlIGRlIGwnw6lnbGlzZSIsCiAgICAgICJjaXR5IjoiT3N0aGVpbSIsCiAgI


CAgICJwb3N0YWxDb2RlIjoiNjgxNTAiLAogICAgICAiY291bnRyeSI6IkZSIiwKICAgICAgImVtYWlsIjoiamVyZW02OEBob3RtYWlsLmNvbSIsCiAgICAgICJwaG9uZSI6IiszMy02MTIzNDU2NzgiLAogICAgICAic2hpcEluZGljYXRvciI6ImJpbGxpbmdfYWRkcmVzcyIsCiAgICAgICJkZWxpdmVyeVRpbWVmcmFtZSI6InR3b19kYXkiLAogICAgICAiZmlyc3RVc2VEYXRlIjoiMjAxNy0w MS0yNSIsCiAgICAgICJtYXRjaEJpbGxpbmdBZGRyZXN zIjp0cnVlCiAgIH0sCiAgICJjbGllbnQiOnsKICAgICAgImVtYWlsIjoiamVyZW02OEBob3RtYWlsLmNvbSIsCiAgICAgICJtb2JpbGVQaG9uZSI6IiszMy02MTIzNDU2NzgiLAogICAgIC AiYmlydGhDaXR5IjoiQ29sbWFyIiwKICAgICAgImJpcnRoUG9zdGFsQ29kZSI6IjY4MDAwIiwKICAgICAgImJpcnRoQ291bnRyeSI6IkZSIiwKICAgICAgImJpcnRoZGF0ZSI6IjE5ODctMDMtMjciCiAgIH0KfQ==

With my ColdFusion solution above but without == at the end.
How can the example from PHP be implemented correctly in ColdFusion?

 

geheimerSchlüssel = 9AD6960F6628543CDC75820B09BA57D56395F896”;

stringToSeal = 7622839*eyJiaWxsaW5nIjp7InBvc3RhbENvZGUiOiI1MDEzIiwiY2l0eSI6Ik5pZWRlcmfDtnNnZW4iLCJjb3VudHJ5IjoiRlIiLCJsYXN0TmFtZSI6IlJpcHBzdGVpbiIsImFkZHJlc3NMaW5lMSI6Ik5ldW1hdHRzdHJhc3NlIDMiLCJmaXJzdE5hbWUiOiJTdGV2ZSJ9LCJzaGlwcGluZyI6eyJwb3N0YWxDb2RlIjoiNTAxMyIsImNpdHkiOiJOaWVkZXJnw7ZzZ2VuIiwiY291bnRyeSI6IkZSIiwibGFzdE5hbWUiOiJSaXBwc3RlaW4iLCJtYXRjaEJpbGxpbmdBZGRyZXNzIjp0cnVlLCJhZGRyZXNzTGluZTEiOiJOZXVtYXR0c3RyYXNzZSAzIiwiZmlyc3ROYW1lIjoiU3RldmUifSwiY2xpZW50Ijp7Imxhc3ROYW1lIjoiUmlwcHN0ZWluIiwiYWRkcmVzc0xpbmUxIjoiTmV1bWF0dHN0cmFzc2UgMyIsImZpcnN0TmFtZSI6IlN0ZXZlIn19*16/07/2024: 14:07:04*EN*steve@rippstein.name*16. 80EUR*542DCB57*tricothe*3.0

in PHP:

$MAC = hash_hmac(“sha1”, $stringToSeal, hex2bin($secretKey));

my version in ColdFusion

<cfset MAC = hmac(stringToSeal ,charsetEncode(binaryDecode(secretKey, “hex”), “utf-8”), “HMACSHA1”) />

How should the above PHP line be implemented correctly in ColdFusion?

Many thanks for your help.

Greetings
Steve

 

 

 
TOPICS
Advanced techniques , Builder
137
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 17, 2024 Jul 17, 2024
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources