{"_id":"57326695a6a9c40e00e13746","project":"573243608b55962900f063c0","user":"571f96d3ee9c2124004b3e0d","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"},"parentDoc":null,"__v":77,"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-10T22:54:13.805Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Endpoints\",\n  \"body\": \"Production Environment: \\nhttps://mws2.safetypay.com/express/ws/v.3.0/ \\n\\nSandbox Environment: \\nhttps://sandbox-mws2.safetypay.com/express/ws/v.3.0/\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Communication Test  (OPTIONAL)\"\n}\n[/block]\nThis is used to test the communication with SafetyPay SOAP Express\n\n**REQUEST**\n\n**Request Fields** \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"ApiKey\",\n    \"0-1\": \"Merchant’s Api Key generated in the MMS System.\",\n    \"0-2\": \"String (32)\",\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\": \"See section \\\"How to Generate Signature Hash\\\"\",\n    \"1-2\": \"Datetime\",\n    \"2-2\": \"String (64)\",\n    \"2-1\": \"HASH SHA256 of:\\nRequestDateTime + \\nSignature Key\",\n    \"1-1\": \"Merchant’s Date and Time used to compose the signature.\",\n    \"1-0\": \"RequestDateTime\",\n    \"2-0\": \"Signature\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Values\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n**Request - Example** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<soapenv:Envelope xmlns:soapenv=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:urn=\\\"urn:safetypay:messages:mws:api\\\">\\n   <soapenv:Header/>\\n   <soapenv:Body>\\n      <urn:TestRequest>\\n        <urn:ApiKey>f91326d6c6943648d35ffee6668154c4</urn:ApiKey>\\n        <urn:RequestDateTime>2016-01-01T12:00:00</urn:RequestDateTime>\\n        <urn:Signature>6E516B94D783EDFDB8DA1F1EE3A8344DEFA9A7020E74EACE96D581E31F7CD65D</urn:Signature>\\n      </urn:TestRequest>\\n   </soapenv:Body>\\n</soapenv:Envelope>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n**RESPONSE**\n\n**Response Fields** \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"ResponseDateTime\",\n    \"0-1\": \"SafetyPay’s Date and Time (GTM). \\nUsed to compose the signature (Signature).\",\n    \"0-2\": \"Datetime\",\n    \"0-3\": \"ISO 8601: \\nyyyy-MM-ddThh:mm:ss\\n\\nExample: \\n2007-01-31T14:24:59\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Values\",\n    \"1-1\": \"HASH SHA256 de:\\nResponseDateTime + \\nSignatureKey\",\n    \"1-0\": \"Signature\",\n    \"1-2\": \"String (64)\",\n    \"1-3\": \"See section \\\"How to Generate Signature Hash\\\"\",\n    \"2-0\": \"ErrorManager\",\n    \"2-1\": \"ErrorManager\",\n    \"2-2\": \"ErrorManagerType\",\n    \"2-3\": \"See the definition of ErrorManagerType\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n**Response - Example** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<s:Envelope xmlns:s=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n   <s:Body xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\">\\n      <TestResponse xmlns=\\\"urn:safetypay:messages:mws:api\\\">\\n         <ResponseDateTime>2016-01-11T18:03:40</ResponseDateTime>\\n         <Signature>EAE1A81FC1793C04A8C18C8022898D59CF6B8C3DC20CB3AB0E3CD1250288359E</Signature>\\n         <ErrorManager>\\n            <ErrorNumber xmlns=\\\"urn:safetypay:schema:mws:api\\\">0</ErrorNumber>\\n         </ErrorManager>\\n      </TestResponse>\\n   </s:Body>\\n</s:Envelope>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"CreateExpressToken\"\n}\n[/block]\nThis function will create a Token URL in order to request money, it can be sent by email, by an automatic system, or any other method.\n\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    \"2-0\": \"CurrencyID\",\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    \"17-0\": \"Signature\",\n    \"17-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\",\n    \"9-1\": \"String\",\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. Use 2 decimals.\",\n    \"4-2\": \"Reference number of the sale.\\nThis value is used to notify Merchants about a payment.\",\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\": \"This URL shall not be used for processing purposes, it is only informative.\",\n    \"11-2\": \"**For 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. \\n1: SafetyPay Express\\n2: SafetyPay Cash\\n8: SafetyPay Dual Button\",\n    \"16-2\": \"Shopper Information\",\n    \"17-2\": \"HASH SHA256 of:\\nRequestDateTime +\\nCurrencyID + \\nAmount +\\nMerchantSalesID+\\nLanguage + \\nTrackingCode + \\nExpirationTime+ \\nTransacionOkURL+ \\nTransactionErrorURL +\\nSignatureKey\",\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    \"4-3\": \"Example: \\nORD-10001,\\nRXW-P03-V01,\\n001-012312220, etc.\",\n    \"3-3\": \"Example: 100.00\",\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:\\nhttp://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”: “9989#####”}\\n{“notify_expiration”: “60”}\",\n    \"17-3\": \"See section \\\"How to Generate Signature Hash\\\"\",\n    \"h-3\": \"Values\"\n  },\n  \"cols\": 4,\n  \"rows\": 18\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, 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\"\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\": \"<soapenv:Envelope xmlns:soapenv=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:urn=\\\"urn:safetypay:messages:mws:api\\\" xmlns:urn1=\\\"urn:safetypay:schema:mws:api\\\">\\n   <soapenv:Header/>\\n   <soapenv:Body>\\n      <urn:ExpressTokenRequest>\\n         <urn:ApiKey>45bc35058fc46fc80467eabe3c113a7a</urn:ApiKey>\\n         <urn:RequestDateTime>2016-04-18T16:39:41</urn:RequestDateTime>\\n         <urn:CurrencyID>USD</urn:CurrencyID>\\n         <urn:Amount>1.00</urn:Amount>\\n         <urn:MerchantSalesID>Test-0001</urn:MerchantSalesID>\\n         <!--Optional:-->\\n         <urn1:Language>ES</urn1:Language>\\n         <!--Optional:-->\\n         <urn:TrackingCode></urn:TrackingCode>\\n         <!--Optional:-->\\n         <urn:ExpirationTime>120</urn:ExpirationTime>\\n         <!--Optional:-->\\n         <urn:FilterBy></urn:FilterBy>\\n         <urn:TransactionOkURL>http://www.Ok.com</urn:TransactionOkURL>\\n         <urn:TransactionErrorURL>http://www.Error.com</urn:TransactionErrorURL>\\n         <urn:TransactionExpirationTime></urn:TransactionExpirationTime>\\n         <urn:CustomMerchantName></urn:CustomMerchantName>\\n         <!--Optional:-->\\n         <urn:ShopperEmail></urn:ShopperEmail>\\n         <urn:LocalizedCurrencyID></urn:LocalizedCurrencyID>\\n         <urn:ProductID>1</urn:ProductID>\\n         <!--Optional:-->\\n         <urn:ShopperInformation>\\n            <!--1 or more repetitions:-->\\n            <urn:ShopperFieldType Key=\\\"first_name\\\" Value=\\\"Marcus\\\"/>\\n            <urn:ShopperFieldType Key=\\\"last_name\\\" Value=\\\"Rocha\\\"/>\\n            <urn:ShopperFieldType Key=\\\"email\\\" Value=\\\"mvferreira@safetypay.com\\\"/>\\n            <urn:ShopperFieldType Key=\\\"document_type\\\" Value=\\\"CPF\\\"/>\\n            <urn:ShopperFieldType Key=\\\"document_number\\\" Value=\\\"1123456789012\\\"/>\\n            <urn:ShopperFieldType Key=\\\"phone\\\" Value=\\\"362-0087\\\"/>\\n            <urn:ShopperFieldType Key=\\\"address1\\\" Value=\\\"R:Jose Domingues,333\\\"/>\\n            <urn:ShopperFieldType Key=\\\"address2\\\" Value=\\\"Av. Sao Joao, 111\\\"/>\\n            <urn:ShopperFieldType Key=\\\"country_id\\\" Value=\\\"BRA\\\"/>\\n            <urn:ShopperFieldType Key=\\\"city\\\" Value=\\\"Sao Paulo\\\"/>\\n            <urn:ShopperFieldType Key=\\\"postal_code\\\" Value=\\\"01000-000\\\"/>\\n            <urn:ShopperFieldType Key=\\\"country_code\\\" Value=\\\"55\\\"/>\\n            <urn:ShopperFieldType Key=\\\"mobile\\\" Value=\\\"980338000\\\"/>\\n            <urn:ShopperFieldType Key=\\\"notify_expiration\\\" Value=\\\"20\\\"/>\\n          </urn:ShopperInformation>\\n         <urn:Signature>e8506e093202b204d5f252e49aff721a806de00348c5221a1712603081121297</urn:Signature>\\n      </urn:ExpressTokenRequest>\\n   </soapenv:Body>\\n</soapenv:Envelope>\",\n      \"language\": \"xml\"\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\": \"ResponseDateTime\",\n    \"1-0\": \"ShopperDirectURL\",\n    \"2-0\": \"Signature\",\n    \"3-0\": \"ErrorManager\",\n    \"0-1\": \"Datetime\",\n    \"1-1\": \"String\",\n    \"2-1\": \"String (64)\",\n    \"3-1\": \"Obejct: ErrorManagerType\",\n    \"0-2\": \"SafetyPay Date and Time (GTM) used to compose the signature.\",\n    \"1-2\": \"URL where shopper must be redirected to complete a payment.\",\n    \"2-2\": \"HASH SHA256 of:\\nResponseDateTime+\\nClientRedirectURL+ \\nSignatureKey.\",\n    \"3-2\": \"Error associated to the call.\",\n    \"h-3\": \"Value\",\n    \"0-3\": \"ISO 8601: \\nyyyy-MM-ddThh:mm:ss\\n\\nExample: \\n2007-01-31T14:24:59\",\n    \"1-3\": \"Example:\\nhttp://www.safetypay.com\",\n    \"2-3\": \"See section \\\"How to Generate Signature Hash\\\"\",\n    \"3-3\": \"See the definition of ErrorManagerType\"\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\": \"<s:Envelope xmlns:s=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n   <s:Body xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\">\\n      <ExpressTokenResponse xmlns=\\\"urn:safetypay:messages:mws:api\\\">\\n         <ResponseDateTime>2016-01-11T18:10:12</ResponseDateTime>\\n         <ShopperRedirectURL>https://gateway.safetypay.com/sandbox/Express3/Checkout/index?TokenID=c2f6159a-1975-4033-b50c-d521af87ac86</ShopperRedirectURL>\\n         <Signature>11E935010B88803393211C875F908BD46DAAE3E86912D98628EC8DC117189910</Signature>\\n         <ErrorManager>\\n            <ErrorNumber xmlns=\\\"urn:safetypay:schema:mws:api\\\">0</ErrorNumber>\\n            <Description xmlns=\\\"urn:safetypay:schema:mws:api\\\">No Error</Description>\\n         </ErrorManager>\\n      </ExpressTokenResponse>\\n   </s:Body>\\n</s:Envelope>\",\n      \"language\": \"xml\"\n    }\n  ]\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      \"image\": [\n        \"https://files.readme.io/M3CjGFgFRimlmUiS7ufl_Express%20page.png\",\n        \"Express page.png\",\n        \"841\",\n        \"872\",\n        \"#1e5ba3\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"soap-api","type":"basic","title":"Integrating with SOAP API"}

Integrating with SOAP API


[block:callout] { "type": "info", "title": "Endpoints", "body": "Production Environment: \nhttps://mws2.safetypay.com/express/ws/v.3.0/ \n\nSandbox Environment: \nhttps://sandbox-mws2.safetypay.com/express/ws/v.3.0/" } [/block] [block:api-header] { "type": "basic", "title": "Communication Test (OPTIONAL)" } [/block] This is used to test the communication with SafetyPay SOAP Express **REQUEST** **Request Fields** [block:parameters] { "data": { "0-0": "ApiKey", "0-1": "Merchant’s Api Key generated in the MMS System.", "0-2": "String (32)", "0-3": "Example:\n23f1d7e1b2d44b7fb43e4bcddee45689", "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\"", "1-2": "Datetime", "2-2": "String (64)", "2-1": "HASH SHA256 of:\nRequestDateTime + \nSignature Key", "1-1": "Merchant’s Date and Time used to compose the signature.", "1-0": "RequestDateTime", "2-0": "Signature", "h-0": "Parameter", "h-1": "Description", "h-2": "Type", "h-3": "Values" }, "cols": 4, "rows": 3 } [/block] **Request - Example** [block:code] { "codes": [ { "code": "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:safetypay:messages:mws:api\">\n <soapenv:Header/>\n <soapenv:Body>\n <urn:TestRequest>\n <urn:ApiKey>f91326d6c6943648d35ffee6668154c4</urn:ApiKey>\n <urn:RequestDateTime>2016-01-01T12:00:00</urn:RequestDateTime>\n <urn:Signature>6E516B94D783EDFDB8DA1F1EE3A8344DEFA9A7020E74EACE96D581E31F7CD65D</urn:Signature>\n </urn:TestRequest>\n </soapenv:Body>\n</soapenv:Envelope>", "language": "xml" } ] } [/block] **RESPONSE** **Response Fields** [block:parameters] { "data": { "0-0": "ResponseDateTime", "0-1": "SafetyPay’s Date and Time (GTM). \nUsed to compose the signature (Signature).", "0-2": "Datetime", "0-3": "ISO 8601: \nyyyy-MM-ddThh:mm:ss\n\nExample: \n2007-01-31T14:24:59", "h-0": "Parameter", "h-1": "Description", "h-2": "Type", "h-3": "Values", "1-1": "HASH SHA256 de:\nResponseDateTime + \nSignatureKey", "1-0": "Signature", "1-2": "String (64)", "1-3": "See section \"How to Generate Signature Hash\"", "2-0": "ErrorManager", "2-1": "ErrorManager", "2-2": "ErrorManagerType", "2-3": "See the definition of ErrorManagerType" }, "cols": 4, "rows": 3 } [/block] **Response - Example** [block:code] { "codes": [ { "code": "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n <TestResponse xmlns=\"urn:safetypay:messages:mws:api\">\n <ResponseDateTime>2016-01-11T18:03:40</ResponseDateTime>\n <Signature>EAE1A81FC1793C04A8C18C8022898D59CF6B8C3DC20CB3AB0E3CD1250288359E</Signature>\n <ErrorManager>\n <ErrorNumber xmlns=\"urn:safetypay:schema:mws:api\">0</ErrorNumber>\n </ErrorManager>\n </TestResponse>\n </s:Body>\n</s:Envelope>", "language": "xml" } ] } [/block] [block:api-header] { "type": "basic", "title": "CreateExpressToken" } [/block] This function will create a Token URL in order to request money, it can be sent by email, by an automatic system, or any other method. **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.", "2-0": "CurrencyID", "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", "17-0": "Signature", "17-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", "9-1": "String", "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. Use 2 decimals.", "4-2": "Reference number of the sale.\nThis value is used to notify Merchants about a payment.", "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": "This URL shall not be used for processing purposes, it is only informative.", "11-2": "**For 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. \n1: SafetyPay Express\n2: SafetyPay Cash\n8: SafetyPay Dual Button", "16-2": "Shopper Information", "17-2": "HASH SHA256 of:\nRequestDateTime +\nCurrencyID + \nAmount +\nMerchantSalesID+\nLanguage + \nTrackingCode + \nExpirationTime+ \nTransacionOkURL+ \nTransactionErrorURL +\nSignatureKey", "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.", "4-3": "Example: \nORD-10001,\nRXW-P03-V01,\n001-012312220, etc.", "3-3": "Example: 100.00", "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:\nhttp://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”: “9989#####”}\n{“notify_expiration”: “60”}", "17-3": "See section \"How to Generate Signature Hash\"", "h-3": "Values" }, "cols": 4, "rows": 18 } [/block] **LanguageCodeType** It is an enumeration type, contains language codes allowed by SafetyPay based on ISO 639-1. Ex: EN, ES, 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" }, "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": "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:safetypay:messages:mws:api\" xmlns:urn1=\"urn:safetypay:schema:mws:api\">\n <soapenv:Header/>\n <soapenv:Body>\n <urn:ExpressTokenRequest>\n <urn:ApiKey>45bc35058fc46fc80467eabe3c113a7a</urn:ApiKey>\n <urn:RequestDateTime>2016-04-18T16:39:41</urn:RequestDateTime>\n <urn:CurrencyID>USD</urn:CurrencyID>\n <urn:Amount>1.00</urn:Amount>\n <urn:MerchantSalesID>Test-0001</urn:MerchantSalesID>\n <!--Optional:-->\n <urn1:Language>ES</urn1:Language>\n <!--Optional:-->\n <urn:TrackingCode></urn:TrackingCode>\n <!--Optional:-->\n <urn:ExpirationTime>120</urn:ExpirationTime>\n <!--Optional:-->\n <urn:FilterBy></urn:FilterBy>\n <urn:TransactionOkURL>http://www.Ok.com</urn:TransactionOkURL>\n <urn:TransactionErrorURL>http://www.Error.com</urn:TransactionErrorURL>\n <urn:TransactionExpirationTime></urn:TransactionExpirationTime>\n <urn:CustomMerchantName></urn:CustomMerchantName>\n <!--Optional:-->\n <urn:ShopperEmail></urn:ShopperEmail>\n <urn:LocalizedCurrencyID></urn:LocalizedCurrencyID>\n <urn:ProductID>1</urn:ProductID>\n <!--Optional:-->\n <urn:ShopperInformation>\n <!--1 or more repetitions:-->\n <urn:ShopperFieldType Key=\"first_name\" Value=\"Marcus\"/>\n <urn:ShopperFieldType Key=\"last_name\" Value=\"Rocha\"/>\n <urn:ShopperFieldType Key=\"email\" Value=\"mvferreira@safetypay.com\"/>\n <urn:ShopperFieldType Key=\"document_type\" Value=\"CPF\"/>\n <urn:ShopperFieldType Key=\"document_number\" Value=\"1123456789012\"/>\n <urn:ShopperFieldType Key=\"phone\" Value=\"362-0087\"/>\n <urn:ShopperFieldType Key=\"address1\" Value=\"R:Jose Domingues,333\"/>\n <urn:ShopperFieldType Key=\"address2\" Value=\"Av. Sao Joao, 111\"/>\n <urn:ShopperFieldType Key=\"country_id\" Value=\"BRA\"/>\n <urn:ShopperFieldType Key=\"city\" Value=\"Sao Paulo\"/>\n <urn:ShopperFieldType Key=\"postal_code\" Value=\"01000-000\"/>\n <urn:ShopperFieldType Key=\"country_code\" Value=\"55\"/>\n <urn:ShopperFieldType Key=\"mobile\" Value=\"980338000\"/>\n <urn:ShopperFieldType Key=\"notify_expiration\" Value=\"20\"/>\n </urn:ShopperInformation>\n <urn:Signature>e8506e093202b204d5f252e49aff721a806de00348c5221a1712603081121297</urn:Signature>\n </urn:ExpressTokenRequest>\n </soapenv:Body>\n</soapenv:Envelope>", "language": "xml" } ] } [/block] **RESPONSE** **Response Fields** [block:parameters] { "data": { "h-0": "Paramater", "h-1": "Type", "h-2": "Description", "0-0": "ResponseDateTime", "1-0": "ShopperDirectURL", "2-0": "Signature", "3-0": "ErrorManager", "0-1": "Datetime", "1-1": "String", "2-1": "String (64)", "3-1": "Obejct: ErrorManagerType", "0-2": "SafetyPay Date and Time (GTM) used to compose the signature.", "1-2": "URL where shopper must be redirected to complete a payment.", "2-2": "HASH SHA256 of:\nResponseDateTime+\nClientRedirectURL+ \nSignatureKey.", "3-2": "Error associated to the call.", "h-3": "Value", "0-3": "ISO 8601: \nyyyy-MM-ddThh:mm:ss\n\nExample: \n2007-01-31T14:24:59", "1-3": "Example:\nhttp://www.safetypay.com", "2-3": "See section \"How to Generate Signature Hash\"", "3-3": "See the definition of ErrorManagerType" }, "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": "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n <ExpressTokenResponse xmlns=\"urn:safetypay:messages:mws:api\">\n <ResponseDateTime>2016-01-11T18:10:12</ResponseDateTime>\n <ShopperRedirectURL>https://gateway.safetypay.com/sandbox/Express3/Checkout/index?TokenID=c2f6159a-1975-4033-b50c-d521af87ac86</ShopperRedirectURL>\n <Signature>11E935010B88803393211C875F908BD46DAAE3E86912D98628EC8DC117189910</Signature>\n <ErrorManager>\n <ErrorNumber xmlns=\"urn:safetypay:schema:mws:api\">0</ErrorNumber>\n <Description xmlns=\"urn:safetypay:schema:mws:api\">No Error</Description>\n </ErrorManager>\n </ExpressTokenResponse>\n </s:Body>\n</s:Envelope>", "language": "xml" } ] } [/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": [ { "image": [ "https://files.readme.io/M3CjGFgFRimlmUiS7ufl_Express%20page.png", "Express page.png", "841", "872", "#1e5ba3", "" ] } ] } [/block]