tufanv Expert Licensed User Longtime User Apr 6, 2017 #1 Hello, I am trying to implement a payment method to android app. For 2 weeks I am trying but There is a problem at some place. They sent me an example code from java which needed to be posted via http post method can you confirm that this java codes http post paramaters :. Code: Copy params.put("MERCHANT",merchant_name); params.put("ORDER_REF",order_ref_number); params.put("ORDER_DATE",order_date); equals to b4a ? : Code: Copy connection.PostString("url","MERCHANT="&merchant_name&"&"&"ORDER_REF="&order_ref_number&"&"&"ORDER_DATE="&order_date" Thanks
Hello, I am trying to implement a payment method to android app. For 2 weeks I am trying but There is a problem at some place. They sent me an example code from java which needed to be posted via http post method can you confirm that this java codes http post paramaters :. Code: Copy params.put("MERCHANT",merchant_name); params.put("ORDER_REF",order_ref_number); params.put("ORDER_DATE",order_date); equals to b4a ? : Code: Copy connection.PostString("url","MERCHANT="&merchant_name&"&"&"ORDER_REF="&order_ref_number&"&"&"ORDER_DATE="&order_date" Thanks
H Haris Hafeez Active Member Licensed User Longtime User Apr 6, 2017 #2 It will be helpful to debug if you post the error message. Upvote 0
S sorex Expert Licensed User Longtime User Apr 6, 2017 #3 what comes after "&order_date" ? is that last double quote a ) in your actual code or is there more? Upvote 0
tufanv Expert Licensed User Longtime User Apr 6, 2017 #4 sorex said: what comes after "&order_date" ? is that last double quote a ) in your actual code or is there more? Click to expand... we can assume that it is the last item. Upvote 0
sorex said: what comes after "&order_date" ? is that last double quote a ) in your actual code or is there more? Click to expand... we can assume that it is the last item.
tufanv Expert Licensed User Longtime User Apr 6, 2017 #5 which means : Code: Copy connection.PostString("url","MERCHANT="&merchant_name&"&"&"ORDER_REF="&order_ref_number&"&"&"ORDER_DATE="&order_date") there is no error while sending the code. Server response return a hash mismatch error which is the hmac_md5 of sent values when the keys are sorted alphabeticly . The servers calculated hash and my calculated hash are not equal. So I figured that there may be a problem while sending the post string because i am sure that my hash is correct , I verified it via the server. Upvote 0
which means : Code: Copy connection.PostString("url","MERCHANT="&merchant_name&"&"&"ORDER_REF="&order_ref_number&"&"&"ORDER_DATE="&order_date") there is no error while sending the code. Server response return a hash mismatch error which is the hmac_md5 of sent values when the keys are sorted alphabeticly . The servers calculated hash and my calculated hash are not equal. So I figured that there may be a problem while sending the post string because i am sure that my hash is correct , I verified it via the server.
S sorex Expert Licensed User Longtime User Apr 6, 2017 #6 that shouldn't even compile since there is a " too much there Upvote 0
tufanv Expert Licensed User Longtime User Apr 6, 2017 #7 sorex said: that shouldn't even compile since there is a " too much there Click to expand... Why ? I am just creating a single string with using & . Maybe thats the problem. Can you suggest a better way ? Becausei have to send about 30 variable to payment server like billing address cc number cc ownder etc... Upvote 0
sorex said: that shouldn't even compile since there is a " too much there Click to expand... Why ? I am just creating a single string with using & . Maybe thats the problem. Can you suggest a better way ? Becausei have to send about 30 variable to payment server like billing address cc number cc ownder etc...
Erel B4X founder Staff member Licensed User Longtime User Apr 6, 2017 #8 Build the string and log it. Maybe there is an extra & somewhere. Upvote 0
tufanv Expert Licensed User Longtime User Apr 6, 2017 #9 Erel said: Build the string and log it. Maybe there is an extra & somewhere. Click to expand... Erel , I owe you a dinner one day. OMG I am spending 5 hours everyday to solve this issue for at least 2 weeks. I checked everything , I also checked the &s many times but when i log it , it was very easy to see. I can't believe. Thanks . I successfully implemented payU global cc payment system, with or without the 3ds verification. ! Upvote 0
Erel said: Build the string and log it. Maybe there is an extra & somewhere. Click to expand... Erel , I owe you a dinner one day. OMG I am spending 5 hours everyday to solve this issue for at least 2 weeks. I checked everything , I also checked the &s many times but when i log it , it was very easy to see. I can't believe. Thanks . I successfully implemented payU global cc payment system, with or without the 3ds verification. !
tufanv Expert Licensed User Longtime User Apr 6, 2017 #10 by the way the sent parameter was: It wasn't easy to see Last edited: Jun 29, 2017 Upvote 0
S sorex Expert Licensed User Longtime User Apr 7, 2017 #11 when things can become a mess (like here ) it's wise to use the multiline string features to keep a good overview over it Code: Copy Dim p As String Dim p1 As String="string1" Dim p2 As String="string3" Dim p3 As String="string3" p="p1="& p1 & _ "&p2="& p2 & _ "&p3="& p3 Log(p) 'p1=string1&p2=string3&p3=string3 or use the variable update method p=p & "&p2=" & p2 etc but it's more typing and not so clear to follow as the other one. not sure if it works with the smart strings method as it seems to add real linefeeds to the string after each line. Upvote 0
when things can become a mess (like here ) it's wise to use the multiline string features to keep a good overview over it Code: Copy Dim p As String Dim p1 As String="string1" Dim p2 As String="string3" Dim p3 As String="string3" p="p1="& p1 & _ "&p2="& p2 & _ "&p3="& p3 Log(p) 'p1=string1&p2=string3&p3=string3 or use the variable update method p=p & "&p2=" & p2 etc but it's more typing and not so clear to follow as the other one. not sure if it works with the smart strings method as it seems to add real linefeeds to the string after each line.