{"_id":"573376013ba4902400171cb4","parentDoc":null,"user":"573372a75bf1bb0e00e40708","__v":48,"version":{"_id":"573243608b55962900f063c1","__v":9,"project":"573243608b55962900f063c0","createdAt":"2016-04-19T15:51:35.494Z","releaseDate":"2016-04-19T15:51:35.494Z","categories":["573243608b55962900f063c3","573243608b55962900f063c2","573255b9ee92510e00087821","573255c0384fc70e0050ea42","573255ce9ef0fa0e0083f0d4","57334604b90dba1900b3d90c","5733474f45fc0c0e00c154da","57348e6e6a42521700a246fb","57348e79a210200e005f99e2","5734efd57e13fd17002f1129","5746204e04f2410e00a5a2e4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"573243608b55962900f063c0","category":{"_id":"573243608b55962900f063c3","__v":0,"project":"573243608b55962900f063c0","version":"573243608b55962900f063c1","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-19T15:51:35.514Z","from_sync":false,"order":2,"slug":"documentation","title":"SafetyPay Payments - Express"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-11T18:12:17.249Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"Communication Test (Optional)\"\n}\n[/block]\nThis method is used to test the communication between SafetyPay and merchant's server with NVP.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Production Environment:\\nhttps://mws2.safetypay.com/express/ws/v.3.0/Post/CommunicationTest\\n\\nSandbox Environment:\\nhttps://sandbox-mws2.safetypay.com/express/ws/v.3.0/Post/CommunicationTest\",\n  \"title\": \"Endpoints\"\n}\n[/block]\n**REQUEST**\n\n**Request Fields** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"0-0\": \"Api Key\",\n    \"0-1\": \"String (32)\",\n    \"1-1\": \"Datetime\",\n    \"2-1\": \"String (64)\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Merchant’s Api Key generated in the MMS System.\",\n    \"1-2\": \"Merchant’s Date and Time used to compose the signature.\",\n    \"2-2\": \"HASH SHA256 of:\\nRequestDateTime + \\nSignature Key\",\n    \"0-3\": \"Example: 23f1d7e1b2d44b7fb43e4bcddee45689\",\n    \"1-3\": \"ISO 8601: \\nyyyy-MM-ddThh:mm:ss\\n\\nExample: \\n2007-01-31T14:24:59\",\n    \"2-3\": \"See Section \\\"How to Generate Signature Hash\\\"\",\n    \"h-3\": \"Value\",\n    \"1-0\": \"RequestDateTime\",\n    \"2-0\": \"Signature\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n**RESPONSE**\n\n**ResponseFields** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"ResponseDateTime\",\n    \"h-3\": \"Value\",\n    \"0-1\": \"Datetime\",\n    \"1-1\": \"String (64)\",\n    \"2-1\": \"ErrorManagerType\",\n    \"1-0\": \"Signature\",\n    \"2-0\": \"ErrorManager\",\n    \"0-2\": \"SafetyPay’s Date and Time (GTM). \\nUsed to compose the signature (Signature).\",\n    \"1-2\": \"HASH SHA256 de:\\nResponseDateTime + \\nSignatureKey\",\n    \"2-2\": \"Error associated to the operation.\",\n    \"0-3\": \"ISO 8601: \\nyyyy-MM-ddThh:mm:ss\\n\\nExample: \\n2007-01-31T14:24:59\",\n    \"1-3\": \"See Section \\\"How to Generate Signature Hash\\\"\",\n    \"2-3\": \"See the definition of ErrorManagerType\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\nIf the Communication Test was successful, SafetyPay will respond back with a Error Manager = 0.\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"CreateExpressToken\"\n}\n[/block]\nThis function will create a Token URL which is used to redirect the Shopper to the SafetyPay Express page to complete payment.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Endpoints\",\n  \"body\": \"Production Environment:\\nhttps://mws2.safetypay.com/express/ws/v.3.0/Post/CreateExpressToken   \\n\\nSandbox Environment:\\nhttps://sandbox-mws2.safetypay.com/express/ws/v.3.0/Post/CreateExpressToken\"\n}\n[/block]\n**REQUEST**\n\n**Request Fields**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"ApiKey\",\n    \"0-1\": \"String (32)\",\n    \"0-2\": \"Merchant Api Key generated by using the MMS.\",\n    \"1-0\": \"RequestDateTime\",\n    \"1-1\": \"Datetime\",\n    \"1-2\": \"Merchant Date and Time used to compose signature.\\n***OPTIONAL***\",\n    \"2-0\": \"CurrencyCode\",\n    \"2-1\": \"String (3)\",\n    \"2-2\": \"Currency of the transaction.\",\n    \"3-0\": \"Amount\",\n    \"4-0\": \"MerchantSalesID\",\n    \"5-0\": \"Language\",\n    \"6-0\": \"TrackingCode\",\n    \"7-0\": \"ExpirationTime\",\n    \"8-0\": \"FilterBy\",\n    \"9-0\": \"TransactionOkURL\",\n    \"10-0\": \"TransactionErrorURL\",\n    \"11-0\": \"TransactionExpirationTime\",\n    \"12-0\": \"CustomMerchantName\",\n    \"13-0\": \"ShopperEmail\",\n    \"14-0\": \"LocalizedCurrencyID\",\n    \"15-0\": \"ProductID\",\n    \"16-0\": \"ShopperInformation\",\n    \"18-0\": \"Signature\",\n    \"18-1\": \"String (64)\",\n    \"16-1\": \"Object: ShopperInformationType\",\n    \"15-1\": \"Integer\",\n    \"14-1\": \"String (3)\",\n    \"11-1\": \"Integer\",\n    \"12-1\": \"String (50)\",\n    \"13-1\": \"String (255)\",\n    \"10-1\": \"String (255)\",\n    \"9-1\": \"String (255)\",\n    \"8-1\": \"String (150)\",\n    \"7-1\": \"Integer\",\n    \"6-1\": \"String (20)\",\n    \"5-1\": \"Object: LanguageCodeType\",\n    \"4-1\": \"String (50)\",\n    \"3-1\": \"Decimal\",\n    \"3-2\": \"The amount of the transaction.\",\n    \"4-2\": \"Reference number of the sale.\\nThis value is used to notify Merchants about a payment.\\n***OPTIONAL***\",\n    \"5-2\": \"Specifies the language for the Express Application.\",\n    \"6-2\": \"For marketing analysis\\nFuture use.\\n***OPTIONAL***\",\n    \"7-2\": \"Time in minutes to expire the token.\\nValue given in minutes.\\nDefault 120.\",\n    \"8-2\": \"Allows filtering banks, country and currency.\\n***OPTIONAL***\",\n    \"9-2\": \"URL where shopper will be redirected from the online banking if payment was successful.\",\n    \"10-2\": \"URL where shopper will be redirected from the online banking if payment was wrong.\",\n    \"11-2\": \"**Future use**\\nLife time of the transaction in minutes. \\n***OPTIONAL***\",\n    \"12-2\": \"Contains the personalized name that the merchant display in the sales for the Gateway.\\n***OPTIONAL***\",\n    \"13-2\": \"Contains the shopper email.\\n***OPTIONAL***\",\n    \"14-2\": \"Currency Code to prioritize after created the transaction. ***OPTIONAL***\",\n    \"15-2\": \"Identifier of Product. ***OPTIONAL***\\n\\n1: SafetyPay Express\\n2: SafetyPay Cash\\n8: SafetyPay Dual Button\",\n    \"16-2\": \"Shopper Info\",\n    \"18-2\": \"HASH SHA256 of:\\nRequestDateTime +\\nCurrencyID + \\nAmount +\\nMerchantSalesID+\\nLanguage + \\nTrackingCode + \\nExpirationTime+ \\nTransacionOkURL+ \\nTransactionErrorURL +\\nSignatureKey\",\n    \"h-3\": \"Value\",\n    \"0-3\": \"Example:\\n23f1d7e1b2d44b7fb43e4bcddee45689\",\n    \"1-3\": \"ISO 8601: \\nyyyy-MM-ddThh:mm:ss\\n\\nExample: \\n2007-01-31T14:24:59\",\n    \"2-3\": \"ISO-4217\\n\\nExample:\\nUSD, EUR, MXN, etc.\",\n    \"3-3\": \"Example: 100.00\",\n    \"4-3\": \"Example: \\nORD-10001,\\nRXW-P03-V01,\\n001-012312220, etc.\",\n    \"5-3\": \"ISO 639-1\\n\\nExample: \\nEN, ES, PT, DE, etc\",\n    \"6-3\": \"Example: TX-0001\",\n    \"7-3\": \"Example:\\n30 \\n15\",\n    \"8-3\": \"Example:\\nCOUNTRY(PER)BANK(1001,1005)CURRENCY(PEN,USD)\",\n    \"9-3\": \"Example: http://www.safetypay.com/api/success.html\",\n    \"10-3\": \"Example:\\nhttp://www.safetypay.com/api/error.html\",\n    \"11-3\": \"Example:\\n30 minutes\\n15 minutes\",\n    \"12-3\": \"Example: Avianca Taca\",\n    \"13-3\": \"Example: example:::at:::safetypay.com\",\n    \"14-3\": \"ISO-4217\\n\\nExample:\\nUSD, EUR, MXN, etc.\",\n    \"15-3\": \"Example:\\n1\\n2\\n8\",\n    \"16-3\": \"Example:\\n{“first_name”: “Jhon”}\\n{“last_name”: “Braunz”}\\n{“email”: “jbraunz@server.com”}\\n{“document_type”: “DNI”}\\n{“document_number”: “454821454”}\\n{“phone”: “9966-2-462”}\\n{“address1”: “1920 Meridian Avenue”}\\n{“address2”: “Second Floor”}\\n{“country_id”: “PER”}\\n{“city”: “Lima”}\\n{“postal_code”: “Lima 33”}\\n{“country_code”: “51”}\\n{“mobile”: “9978-#####”}\\n{“notify_expiration”: “60”}\",\n    \"18-3\": \"See Section \\\"How to Generate Signature Hash\\\"\",\n    \"17-0\": \"Response Format\",\n    \"17-1\": \"\",\n    \"17-3\": \"“CSV” or “XML”\\nDEFAULT “CSV”\",\n    \"17-2\": \"Format for the response\"\n  },\n  \"cols\": 4,\n  \"rows\": 19\n}\n[/block]\n**LanguageCodeType**\n\nIt is an enumeration type, contains language codes allowed by SafetyPay based on ISO 639-1.\nEx: EN, ES, PT, DE.\n\n**LanguageCodeType Fields** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"LanguageCodeType\",\n    \"0-1\": \"Enumeration Element\",\n    \"0-2\": \"LanguageCode\",\n    \"h-3\": \"Value\",\n    \"0-3\": \"Example: \\nEN, ES, PT, DE, etc\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n**ShopperInformationType**\n\n**ShopperInformationType Fields**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"ShopperField\",\n    \"0-1\": \"ShopperField\",\n    \"0-2\": \"Element that contains custom information related at Shopper like key-value pair data into attributes.\\n\\nThe Keys are case-sensitive and support us the next default keys:\\n•\\tfirst_name (255)\\n•\\tlast_name (255)\\n•\\temail (255)\\n•\\tdocument_type (50)\\n•\\tdocument_number (50)\\n•\\tphone (50)\\n•\\taddress1 (255)\\n•\\taddress2 (255)\\n•\\tcountry_id (3)\\n•\\tcity (50)\\n•\\tpostal_code (50) \\n•\\tcountry_code: international dialing code.\\n•\\tmobile: mobile number.\\n•\\tnotify_expiration: in minutes, time before the expiration of a transaction for client notification via SMS.\\n\\nThe last 3 Keys allow us to notify the shopper minutes before the transaction expires.\\n\\nCan add more records type key-value pair additional to the default list that we handle.\",\n    \"h-3\": \"Value\",\n    \"0-3\": \"Example:\\n{“first_name”: “Jhon”}\\n{“last_name”: “Braunz”}\\n{“email”: “jbraunz@server.com”}\\n{“document_type”: “DNI”}\\n{“document_number”: “454821454”}\\n{“phone”: “9966-2-462”}\\n{“address1”: “1920 Meridian Avenue”}\\n{“address2”: “Second Floor”}\\n{“country_id”: “USA”}\\n{“city”: “Miami Beach”}\\n{“postal_code”: “Florida 33139”}\\n{“country_code”: “052”}\\n{“mobile”: “6589-65356”}\\n{“notify_expiration”: “60”}\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n**Request - Example**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * File: SafetyPayTest.php\\n * Author: SafetyPay Inc.\\n * Description: Generate Tokens to start the purchase process with Safetypay.\\n * @version 1.0\\n * @package default\\n * @license Open Software License (OSL 3.0)\\n * Copyright 2012 SafetyPay Inc. All rights reserved.\\n*******************************************************************************/\\nini_set('display_errors', 0);\\n\\nrequire_once 'class/SafetyPayProxyExpress.php';\\nrequire_once 'class/SafetyPayParametersExpress.php';\\n\\n$proxy = new Proxy();\\n$proxy = new Parameters();\\n\\n// Get Token URL\\n$Result = $proxy->CreateExpressToken();\\nif ($Result['ErrorManager']['ErrorNumber']['@content'] == '0')\\n{\\n    if ( $ResponseFormat == 'XML' )\\n    {\\n        $tokenURL = $Result['ShopperRedirectURL']['@content'];\\n    }\\n    elseif ( $ResponseFormat == 'CSV' )\\n    {\\n        $aItems = $Result[0];\\n        $aLine = explode( ',', $aItems );\\n        \\n        $tokenURL = $aLine[2];\\n    }\\n    \\n    $tokenURL = '<a href=\\\"' . $tokenURL . '\\\" target=\\\"_new\\\">'\\n                        . $tokenURL . '</a>';\\n}\\n\\nif ($Result['ErrorManager']['ErrorNumber']['@content'] == '0')\\n    $errorNo = '<span style=\\\"color:black;\\\">'\\n                . current(@@$Result['ErrorManager']['ErrorNumber']) . ', '\\n                . current(@@$Result['ErrorManager']['Description']) . '. Severity: '\\n                . current(@@$Result['ErrorManager']['Severity']) . '</span>';\\nelse\\n    if (is_array($Result['ErrorManager']['ErrorNumber']))\\n        $errorNo = '<span style=\\\"color:red;\\\">'\\n                . current(@@$Result['ErrorManager']['ErrorNumber']) . ', '\\n                . current(@@$Result['ErrorManager']['Description']) . '</span>';\\n    else\\n        $errorNo = '<span style=\\\"color:red;\\\">'\\n                . @@$Result['ErrorManager']['ErrorNumber'] . ', '\\n                . @@$Result['ErrorManager']['Description'] . '. Severity: '\\n                . @@$Result['ErrorManager']['Severity'] . '</span>';\\n\\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n**RESPONSE**\n\n**Response Fields**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Paramater\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"Error Number\",\n    \"1-0\": \"ResponseDateTime\",\n    \"3-0\": \"Signature\",\n    \"0-1\": \"ErrorManagerType\",\n    \"1-1\": \"String (255)\",\n    \"3-1\": \"String (64)\",\n    \"0-2\": \"Error associated to the call; ErrorNumber = 0, means call was successful.\",\n    \"1-2\": \"SafetyPay Date Time (GMT).\\nUsed to compose signature.\",\n    \"3-2\": \"HASH SHA256 of:\\nResponseDateTime+\\nClientRedirectURL+ \\nSignatureKey.\",\n    \"h-3\": \"Value\",\n    \"0-3\": \"See API Error and Warning Codes Section\",\n    \"1-3\": \"ISO 8601\\nyyyy-MM-ddThh:mm:ss\\nEx: 2007-01-31T14:24:59\",\n    \"3-3\": \"See Section \\\"How to Generate Signature Hash\\\"\",\n    \"2-0\": \"ClientRedirectURL\",\n    \"2-1\": \"String (255)\",\n    \"2-2\": \"URL where shopper can be redirected to complete a payment.\",\n    \"2-3\": \"http://secure.SafetyPay.com/express.aspx?\\nTokenID=11231-123-12-12\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\nThis function will create a Token URL in order to request money sent by the merchant, it can be sent by email, by an automatic system, or any other method.\n\n**Response - Example**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"0,2016-05-12T12:15:14,https://gateway.safetypay.com/Express3/Checkout/index?TokenID=aab63b6d-6c74-45d4-928c-71cdbabb4c89,39CD9007FD5230EC71F47A229F8FA5D310C4B0AB9C932FD60E9EE824CB00C750\",\n      \"language\": \"text\",\n      \"name\": \"CSV\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"SafetyPay Express Page\"\n}\n[/block]\nUsing the URL Token received in the response, the merchant will redirect the shopper to the SafetyPay Express application to proceed with the payment.  The Shopper will select his/her online bank and preferred currency to complete payment\n[block:image]\n{\n  \"images\": [\n    {\n      \"caption\": \"\",\n      \"image\": [\n        \"https://files.readme.io/zygzaq0PT9ik7gYpmIeJ_Express%20page.png\",\n        \"Express page.png\",\n        \"841\",\n        \"872\",\n        \"#1e5ba3\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"nvp-api-1","type":"basic","title":"Integrating with NVP"}

Integrating with NVP


[block:api-header] { "type": "post", "title": "Communication Test (Optional)" } [/block] This method is used to test the communication between SafetyPay and merchant's server with NVP. [block:callout] { "type": "info", "body": "Production Environment:\nhttps://mws2.safetypay.com/express/ws/v.3.0/Post/CommunicationTest\n\nSandbox Environment:\nhttps://sandbox-mws2.safetypay.com/express/ws/v.3.0/Post/CommunicationTest", "title": "Endpoints" } [/block] **REQUEST** **Request Fields** [block:parameters] { "data": { "h-0": "Parameter", "0-0": "Api Key", "0-1": "String (32)", "1-1": "Datetime", "2-1": "String (64)", "h-1": "Type", "h-2": "Description", "0-2": "Merchant’s Api Key generated in the MMS System.", "1-2": "Merchant’s Date and Time used to compose the signature.", "2-2": "HASH SHA256 of:\nRequestDateTime + \nSignature Key", "0-3": "Example: 23f1d7e1b2d44b7fb43e4bcddee45689", "1-3": "ISO 8601: \nyyyy-MM-ddThh:mm:ss\n\nExample: \n2007-01-31T14:24:59", "2-3": "See Section \"How to Generate Signature Hash\"", "h-3": "Value", "1-0": "RequestDateTime", "2-0": "Signature" }, "cols": 4, "rows": 3 } [/block] **RESPONSE** **ResponseFields** [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "ResponseDateTime", "h-3": "Value", "0-1": "Datetime", "1-1": "String (64)", "2-1": "ErrorManagerType", "1-0": "Signature", "2-0": "ErrorManager", "0-2": "SafetyPay’s Date and Time (GTM). \nUsed to compose the signature (Signature).", "1-2": "HASH SHA256 de:\nResponseDateTime + \nSignatureKey", "2-2": "Error associated to the operation.", "0-3": "ISO 8601: \nyyyy-MM-ddThh:mm:ss\n\nExample: \n2007-01-31T14:24:59", "1-3": "See Section \"How to Generate Signature Hash\"", "2-3": "See the definition of ErrorManagerType" }, "cols": 4, "rows": 3 } [/block] If the Communication Test was successful, SafetyPay will respond back with a Error Manager = 0. [block:api-header] { "type": "post", "title": "CreateExpressToken" } [/block] This function will create a Token URL which is used to redirect the Shopper to the SafetyPay Express page to complete payment. [block:callout] { "type": "info", "title": "Endpoints", "body": "Production Environment:\nhttps://mws2.safetypay.com/express/ws/v.3.0/Post/CreateExpressToken \n\nSandbox Environment:\nhttps://sandbox-mws2.safetypay.com/express/ws/v.3.0/Post/CreateExpressToken" } [/block] **REQUEST** **Request Fields** [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "ApiKey", "0-1": "String (32)", "0-2": "Merchant Api Key generated by using the MMS.", "1-0": "RequestDateTime", "1-1": "Datetime", "1-2": "Merchant Date and Time used to compose signature.\n***OPTIONAL***", "2-0": "CurrencyCode", "2-1": "String (3)", "2-2": "Currency of the transaction.", "3-0": "Amount", "4-0": "MerchantSalesID", "5-0": "Language", "6-0": "TrackingCode", "7-0": "ExpirationTime", "8-0": "FilterBy", "9-0": "TransactionOkURL", "10-0": "TransactionErrorURL", "11-0": "TransactionExpirationTime", "12-0": "CustomMerchantName", "13-0": "ShopperEmail", "14-0": "LocalizedCurrencyID", "15-0": "ProductID", "16-0": "ShopperInformation", "18-0": "Signature", "18-1": "String (64)", "16-1": "Object: ShopperInformationType", "15-1": "Integer", "14-1": "String (3)", "11-1": "Integer", "12-1": "String (50)", "13-1": "String (255)", "10-1": "String (255)", "9-1": "String (255)", "8-1": "String (150)", "7-1": "Integer", "6-1": "String (20)", "5-1": "Object: LanguageCodeType", "4-1": "String (50)", "3-1": "Decimal", "3-2": "The amount of the transaction.", "4-2": "Reference number of the sale.\nThis value is used to notify Merchants about a payment.\n***OPTIONAL***", "5-2": "Specifies the language for the Express Application.", "6-2": "For marketing analysis\nFuture use.\n***OPTIONAL***", "7-2": "Time in minutes to expire the token.\nValue given in minutes.\nDefault 120.", "8-2": "Allows filtering banks, country and currency.\n***OPTIONAL***", "9-2": "URL where shopper will be redirected from the online banking if payment was successful.", "10-2": "URL where shopper will be redirected from the online banking if payment was wrong.", "11-2": "**Future use**\nLife time of the transaction in minutes. \n***OPTIONAL***", "12-2": "Contains the personalized name that the merchant display in the sales for the Gateway.\n***OPTIONAL***", "13-2": "Contains the shopper email.\n***OPTIONAL***", "14-2": "Currency Code to prioritize after created the transaction. ***OPTIONAL***", "15-2": "Identifier of Product. ***OPTIONAL***\n\n1: SafetyPay Express\n2: SafetyPay Cash\n8: SafetyPay Dual Button", "16-2": "Shopper Info", "18-2": "HASH SHA256 of:\nRequestDateTime +\nCurrencyID + \nAmount +\nMerchantSalesID+\nLanguage + \nTrackingCode + \nExpirationTime+ \nTransacionOkURL+ \nTransactionErrorURL +\nSignatureKey", "h-3": "Value", "0-3": "Example:\n23f1d7e1b2d44b7fb43e4bcddee45689", "1-3": "ISO 8601: \nyyyy-MM-ddThh:mm:ss\n\nExample: \n2007-01-31T14:24:59", "2-3": "ISO-4217\n\nExample:\nUSD, EUR, MXN, etc.", "3-3": "Example: 100.00", "4-3": "Example: \nORD-10001,\nRXW-P03-V01,\n001-012312220, etc.", "5-3": "ISO 639-1\n\nExample: \nEN, ES, PT, DE, etc", "6-3": "Example: TX-0001", "7-3": "Example:\n30 \n15", "8-3": "Example:\nCOUNTRY(PER)BANK(1001,1005)CURRENCY(PEN,USD)", "9-3": "Example: http://www.safetypay.com/api/success.html", "10-3": "Example:\nhttp://www.safetypay.com/api/error.html", "11-3": "Example:\n30 minutes\n15 minutes", "12-3": "Example: Avianca Taca", "13-3": "Example: example@safetypay.com", "14-3": "ISO-4217\n\nExample:\nUSD, EUR, MXN, etc.", "15-3": "Example:\n1\n2\n8", "16-3": "Example:\n{“first_name”: “Jhon”}\n{“last_name”: “Braunz”}\n{“email”: “jbraunz@server.com”}\n{“document_type”: “DNI”}\n{“document_number”: “454821454”}\n{“phone”: “9966-2-462”}\n{“address1”: “1920 Meridian Avenue”}\n{“address2”: “Second Floor”}\n{“country_id”: “PER”}\n{“city”: “Lima”}\n{“postal_code”: “Lima 33”}\n{“country_code”: “51”}\n{“mobile”: “9978-#####”}\n{“notify_expiration”: “60”}", "18-3": "See Section \"How to Generate Signature Hash\"", "17-0": "Response Format", "17-1": "", "17-3": "“CSV” or “XML”\nDEFAULT “CSV”", "17-2": "Format for the response" }, "cols": 4, "rows": 19 } [/block] **LanguageCodeType** It is an enumeration type, contains language codes allowed by SafetyPay based on ISO 639-1. Ex: EN, ES, PT, DE. **LanguageCodeType Fields** [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "LanguageCodeType", "0-1": "Enumeration Element", "0-2": "LanguageCode", "h-3": "Value", "0-3": "Example: \nEN, ES, PT, DE, etc" }, "cols": 4, "rows": 1 } [/block] **ShopperInformationType** **ShopperInformationType Fields** [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "ShopperField", "0-1": "ShopperField", "0-2": "Element that contains custom information related at Shopper like key-value pair data into attributes.\n\nThe Keys are case-sensitive and support us the next default keys:\n•\tfirst_name (255)\n•\tlast_name (255)\n•\temail (255)\n•\tdocument_type (50)\n•\tdocument_number (50)\n•\tphone (50)\n•\taddress1 (255)\n•\taddress2 (255)\n•\tcountry_id (3)\n•\tcity (50)\n•\tpostal_code (50) \n•\tcountry_code: international dialing code.\n•\tmobile: mobile number.\n•\tnotify_expiration: in minutes, time before the expiration of a transaction for client notification via SMS.\n\nThe last 3 Keys allow us to notify the shopper minutes before the transaction expires.\n\nCan add more records type key-value pair additional to the default list that we handle.", "h-3": "Value", "0-3": "Example:\n{“first_name”: “Jhon”}\n{“last_name”: “Braunz”}\n{“email”: “jbraunz@server.com”}\n{“document_type”: “DNI”}\n{“document_number”: “454821454”}\n{“phone”: “9966-2-462”}\n{“address1”: “1920 Meridian Avenue”}\n{“address2”: “Second Floor”}\n{“country_id”: “USA”}\n{“city”: “Miami Beach”}\n{“postal_code”: “Florida 33139”}\n{“country_code”: “052”}\n{“mobile”: “6589-65356”}\n{“notify_expiration”: “60”}" }, "cols": 4, "rows": 1 } [/block] **Request - Example** [block:code] { "codes": [ { "code": "<?php\n/**\n * File: SafetyPayTest.php\n * Author: SafetyPay Inc.\n * Description: Generate Tokens to start the purchase process with Safetypay.\n * @version 1.0\n * @package default\n * @license Open Software License (OSL 3.0)\n * Copyright 2012 SafetyPay Inc. All rights reserved.\n*******************************************************************************/\nini_set('display_errors', 0);\n\nrequire_once 'class/SafetyPayProxyExpress.php';\nrequire_once 'class/SafetyPayParametersExpress.php';\n\n$proxy = new Proxy();\n$proxy = new Parameters();\n\n// Get Token URL\n$Result = $proxy->CreateExpressToken();\nif ($Result['ErrorManager']['ErrorNumber']['@content'] == '0')\n{\n if ( $ResponseFormat == 'XML' )\n {\n $tokenURL = $Result['ShopperRedirectURL']['@content'];\n }\n elseif ( $ResponseFormat == 'CSV' )\n {\n $aItems = $Result[0];\n $aLine = explode( ',', $aItems );\n \n $tokenURL = $aLine[2];\n }\n \n $tokenURL = '<a href=\"' . $tokenURL . '\" target=\"_new\">'\n . $tokenURL . '</a>';\n}\n\nif ($Result['ErrorManager']['ErrorNumber']['@content'] == '0')\n $errorNo = '<span style=\"color:black;\">'\n . current(@@$Result['ErrorManager']['ErrorNumber']) . ', '\n . current(@@$Result['ErrorManager']['Description']) . '. Severity: '\n . current(@@$Result['ErrorManager']['Severity']) . '</span>';\nelse\n if (is_array($Result['ErrorManager']['ErrorNumber']))\n $errorNo = '<span style=\"color:red;\">'\n . current(@@$Result['ErrorManager']['ErrorNumber']) . ', '\n . current(@@$Result['ErrorManager']['Description']) . '</span>';\n else\n $errorNo = '<span style=\"color:red;\">'\n . @@$Result['ErrorManager']['ErrorNumber'] . ', '\n . @@$Result['ErrorManager']['Description'] . '. Severity: '\n . @@$Result['ErrorManager']['Severity'] . '</span>';\n\n?>", "language": "php" } ] } [/block] **RESPONSE** **Response Fields** [block:parameters] { "data": { "h-0": "Paramater", "h-1": "Type", "h-2": "Description", "0-0": "Error Number", "1-0": "ResponseDateTime", "3-0": "Signature", "0-1": "ErrorManagerType", "1-1": "String (255)", "3-1": "String (64)", "0-2": "Error associated to the call; ErrorNumber = 0, means call was successful.", "1-2": "SafetyPay Date Time (GMT).\nUsed to compose signature.", "3-2": "HASH SHA256 of:\nResponseDateTime+\nClientRedirectURL+ \nSignatureKey.", "h-3": "Value", "0-3": "See API Error and Warning Codes Section", "1-3": "ISO 8601\nyyyy-MM-ddThh:mm:ss\nEx: 2007-01-31T14:24:59", "3-3": "See Section \"How to Generate Signature Hash\"", "2-0": "ClientRedirectURL", "2-1": "String (255)", "2-2": "URL where shopper can be redirected to complete a payment.", "2-3": "http://secure.SafetyPay.com/express.aspx?\nTokenID=11231-123-12-12" }, "cols": 4, "rows": 4 } [/block] This function will create a Token URL in order to request money sent by the merchant, it can be sent by email, by an automatic system, or any other method. **Response - Example** [block:code] { "codes": [ { "code": "0,2016-05-12T12:15:14,https://gateway.safetypay.com/Express3/Checkout/index?TokenID=aab63b6d-6c74-45d4-928c-71cdbabb4c89,39CD9007FD5230EC71F47A229F8FA5D310C4B0AB9C932FD60E9EE824CB00C750", "language": "text", "name": "CSV" } ] } [/block] [block:api-header] { "type": "post", "title": "SafetyPay Express Page" } [/block] Using the URL Token received in the response, the merchant will redirect the shopper to the SafetyPay Express application to proceed with the payment. The Shopper will select his/her online bank and preferred currency to complete payment [block:image] { "images": [ { "caption": "", "image": [ "https://files.readme.io/zygzaq0PT9ik7gYpmIeJ_Express%20page.png", "Express page.png", "841", "872", "#1e5ba3", "" ] } ] } [/block]