Skip to content

Instantly share code, notes, and snippets.

@jasminsuljic
Last active August 19, 2020 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasminsuljic/ce8b2b31bee2688c807d00114c9dc0a6 to your computer and use it in GitHub Desktop.
Save jasminsuljic/ce8b2b31bee2688c807d00114c9dc0a6 to your computer and use it in GitHub Desktop.

Merchant_key: MerDep012

Authenticity_token: c406cfc63b7ef89c63d5bbd9f99ce024709a076d

Request:

{"transaction_type":"purchase","amount":2130,"currency":"BAM","number_of_installments":"","order_number":"nedi1m-placanje","order_info":"Order info","language":"hr","ch_full_name":"John Doe","ch_address":"Elm street 22","ch_city":"Orgrimmar","ch_zip":"q123abc99","ch_country":"US","ch_phone":"123456","ch_email":"john.doe@email.com","comment":"","supported_payment_methods":[]}

Timestamp: 1597831100631

Digest:

c76b0711b0f4c5a8f07880dcb4b29242bf5f185d4f2abd2708e1a52b1dd6fe6354996d1d89495d900d0bfdb7a0a5ddb0aec5886c33097e9921794eb742e42992

Proracunat kao: digest = merchant_key + timestamp + authenticity_token + uri + req

uri = /v2/terminal-entry/create-or-update

tj digest =

sha512('MerDep0121597831329378c406cfc63b7ef89c63d5bbd9f99ce024709a076d/v2/terminal-entry/create-or-update{"transaction_type":"purchase","amount":2130,"currency":"BAM","number_of_installments":"","order_number":"nedi1m-placanje","order_info":"Order info","language":"hr","ch_full_name":"John Doe","ch_address":"Elm street 22","ch_city":"Orgrimmar","ch_zip":"q123abc99","ch_country":"US","ch_phone":"123456","ch_email":"john.doe@email.com","comment":"","supported_payment_methods":[]}')

je = 5048fa6b5c244708ea32c6bc1dbede37109e3b3b91da59c321d6299c0158cde2849fbc0a462f6e23406e70b1bba13f4efb5b4a3697620fdbf2d2a1ce68737e3a

Url: https://ipgtest.monri.com/v2/terminal-entry/create-or-update

Na kraju dobijamo curl

Curl:

curl --location --request POST 'https://ipgtest.monri.com/v2/terminal-entry/create-or-update' \
--header 'Authorization: WP3-v2.1 c406cfc63b7ef89c63d5bbd9f99ce024709a076d 1597831329378 5048fa6b5c244708ea32c6bc1dbede37109e3b3b91da59c321d6299c0158cde2849fbc0a462f6e23406e70b1bba13f4efb5b4a3697620fdbf2d2a1ce68737e3a' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Cookie: HttpOnly; __cfduid=d24149e2b228bfaf83d9df35753a06ba81597830913' \
--data-raw '{"transaction_type":"purchase","amount":2130,"currency":"BAM","number_of_installments":"","order_number":"nedi1m-placanje","order_info":"Order info","language":"hr","ch_full_name":"John Doe","ch_address":"Elm street 22","ch_city":"Orgrimmar","ch_zip":"q123abc99","ch_country":"US","ch_phone":"123456","ch_email":"john.doe@email.com","comment":"","supported_payment_methods":[]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment