{"_id":"5e321ffeaeb9980025ea2de5","project":"543005c87d487022005b3fa8","version":{"_id":"543005c87d487022005b3fab","__v":8,"project":"543005c87d487022005b3fa8","createdAt":"2014-10-04T14:35:52.362Z","releaseDate":"2014-10-04T14:35:52.362Z","categories":["543005c87d487022005b3fac","54345156edce04080040964e","543ee0c055bb1008000955b6","54c82a78ab706219009e0656","57390d0e1f4b740e00b06cb2","5741d5ab28f5fb0e0063ed36","5d1e4140522cd702b31b544b","5e321f8b5517b00012831b6a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5e321f8b5517b00012831b6a","project":"543005c87d487022005b3fa8","version":"543005c87d487022005b3fab","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2020-01-30T00:12:59.668Z","from_sync":false,"order":9999,"slug":"credit-card-processor-module","title":"Credit Card Processor Module"},"user":"543005a67d487022005b3fa7","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2020-01-30T00:14:54.390Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"This section details how to add a credit card payment processor to the Gazoop System.\n[block:api-header]\n{\n  \"title\": \"How do we enable an integration with Gazoop?\"\n}\n[/block]\nWe have provided a template PHP Class file that we use for all our card processors. This class file will need to be adjusted for your specific payment processor, ensuring you do all the requests you need using technologies such as cURL. We do not support using any frameworks, nor including any additional files except for the single file we provide. \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Where is the PHP Class File?\",\n  \"body\": \"You can find the file here: https://docs.gazoop.com/docs/php-class-template\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"What methods of card processing does Gazoop support?\"\n}\n[/block]\nGazoop supports any number of payment processors and can support them via two methods.\n\n1. Tokenization\n2. Stored Card Details\n\nWe highly recommend sticking with Tokenization where possible. \n[block:api-header]\n{\n  \"title\": \"How do I customise the variables we need to send payment requests?\"\n}\n[/block]\nIn the class construct we will send an array of configuration variables as is required. This can include login details, API keys, authentication details, etc. For example, if you want the customer to provide a Login Name and API Key just comment in the __construct API\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public function __construct($configuration){\\n \\t\\t$this->configuration['Login_Name'] = $configuration['Login_Name']; \\n \\t\\t$this->configuration['API_Key'] = $configuration['API_Key'];\\n}\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nIf you require Gazoop to complete an oAuth2 authentication to obtain client tokens, please ensure you provide us the documentation and relevant API keys to do this as easily as possible. Please also ensure you specify $configuration['Client_Token'] and use it as reference in the remaining functions.\n[block:api-header]\n{\n  \"title\": \"How do I implement it using stored card details?\"\n}\n[/block]\nEnsure that the method getToken is removed or commented out. If this method does not exist when Gazoop goes to store or process a charge, we will continue to provide and store all card details in the chargeCard method call.\n\nNote: We only provide the CVV2 code on the first transaction, you should make sure the requirement to give a CVV2 is disabled for future payments as we are not permitted to store this information.\n[block:api-header]\n{\n  \"title\": \"How do I implement it using tokenization?\"\n}\n[/block]\nEnsure the method getToken exists and is populated to return a token that can be used for future charges. If getToken exists, we will only store the last 4 digits of the card, the card type, and the expiration date, along with the returned token. We will not store any other information including the full card number.\n\nWe will always check for getToken and call this before processing any chargeCard call.\n[block:api-header]\n{\n  \"title\": \"How do I test this is working?\"\n}\n[/block]\nYou can use the class locally to test all is as it seems by using code like below as an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\ninclude(\\\"CardProvider.class.php\\\");\\n$cardprocessor = new CreditCardModule(array(\\\"APIKey\\\"=>\\\"Test\\\"));\\n$cardprocessor->applyCardDetails(\\\"4242424242424242\\\",\\\"Mastercard\\\",\\\"0122\\\",\\\"123\\\");\\n$cardprocessor->applyPersonalDetails(\\\"Jack\\\",\\\"Jones\\\",\\\"123 Street\\\",\\\"\\\",\\\"New York\\\",\\\"NY\\\",\\\"US\\\",\\\"12345\\\",\\\"demo:::at:::demo.com\\\");\\n// $cardProcessor->getToken();\\n$cardprocessor->chargeCard(\\\"1.00\\\",\\\"USD\\\");\\n\\n?>\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nOnce you have completed above, please send your completed PHP Class file to Gazoop who will conduct any final tests you require.\n[block:api-header]\n{\n  \"title\": \"What are the available variables and its format?\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Variable Name\",\n    \"h-1\": \"Format\",\n    \"h-2\": \"Description\",\n    \"h-3\": \"Example\",\n    \"0-0\": \"$card_number\",\n    \"0-1\": \"int\",\n    \"0-2\": \"This is the full card number given by the customer with no spaces or special characters.\",\n    \"0-3\": \"4242424242424242\",\n    \"1-0\": \"$card_type\",\n    \"1-1\": \"string\",\n    \"1-2\": \"This is the type of card being provided as detected by our system. The casing and format in the examples are valid results we send.\",\n    \"1-3\": \"Mastercard\\nVisa\\nDiscover\\nAmex\\nBankcard\\nJCB\\nMaestro\\nVisaElectron\\nDiners\\nSolo\\nLaser\",\n    \"2-0\": \"$expiry\",\n    \"2-1\": \"string(4)\",\n    \"2-2\": \"This is a 4 digit representation of the expiration date. Months are prefix with 0 where below 10. The example is May 2025 expiration.\",\n    \"2-3\": \"0525\",\n    \"3-0\": \"$cvv\",\n    \"3-1\": \"string(4)\",\n    \"3-2\": \"This is a 3/4 digit security code provided by the customer when storing their card. We will only provide this on the first interaction, this information is never stored. Future card payments this variable will be blank.\",\n    \"3-3\": \"123\",\n    \"4-0\": \"$valid_from\",\n    \"4-1\": \"string(4)\",\n    \"4-2\": \"This is a 4 digit representation of the valid from date. Months are prefix with 0 where below 10. The example is May 2015 expiration.\",\n    \"4-3\": \"0515\",\n    \"5-0\": \"$issue\",\n    \"5-1\": \"int\",\n    \"5-2\": \"This is the issue number of the card.\",\n    \"5-3\": \"1\",\n    \"6-0\": \"$first_name\",\n    \"6-1\": \"string(100)\",\n    \"6-2\": \"This is the card holders first name.\",\n    \"6-3\": \"Jack\",\n    \"7-0\": \"$last_name\",\n    \"7-1\": \"string(100)\",\n    \"7-2\": \"This is the card holders last name.\",\n    \"7-3\": \"Jones\",\n    \"8-0\": \"$address1\",\n    \"8-1\": \"string(200)\",\n    \"8-2\": \"This is the first line of the billing address.\",\n    \"8-3\": \"123 High Street\",\n    \"9-0\": \"$address2\",\n    \"9-1\": \"string(200)\",\n    \"9-2\": \"This is the second line of the billing address.\",\n    \"9-3\": \"The House Building\",\n    \"10-0\": \"$city\",\n    \"10-1\": \"string(100)\",\n    \"10-2\": \"This is the city of the billing address.\",\n    \"10-3\": \"New York\",\n    \"11-0\": \"$state\",\n    \"11-1\": \"string(100)\",\n    \"11-2\": \"This is the state/county of the billing address.\",\n    \"11-3\": \"NY\",\n    \"12-0\": \"$country\",\n    \"12-1\": \"string(2)\",\n    \"12-2\": \"This is the 2 letter country code for the country in Alpha-2 format.\",\n    \"12-3\": \"US\",\n    \"13-0\": \"$postcode\",\n    \"13-1\": \"string(50)\",\n    \"13-2\": \"This is the ZIP or Postal code for the billing address.\",\n    \"13-3\": \"12345\",\n    \"14-0\": \"$email\",\n    \"14-1\": \"string(200)\",\n    \"14-2\": \"This is the email address for the card holder.\",\n    \"14-3\": \"[email protected]\"\n  },\n  \"cols\": 4,\n  \"rows\": 15\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"What information should I return with the ChargeCard method?\"\n}\n[/block]\nWe require three variables to be set when we submit a request to the chargeCard method.\n\n**$this->transactionNotes**\nThis should include any relevant notes about the transaction, such as error messages, or details about reference numbers or payment processing times if required. This can also be left blank.\n\n**$this->reference**\nThis should include the transaction reference number that the customer can reference to pull up this specific payment. This is included in the receipts and invoices we store.\n\n**$this->status**\nThis is the result of the payment request and it should be either \"Authorized\" or \"NotAuthorized\". We do not currently accept any other result, details of any errors can be given in the transactionNotes above.","excerpt":"Adding a new Credit Card Processor","slug":"creditcard-processor-gettingstarted","type":"basic","title":"Getting Started"}

Getting Started

Adding a new Credit Card Processor

This section details how to add a credit card payment processor to the Gazoop System. [block:api-header] { "title": "How do we enable an integration with Gazoop?" } [/block] We have provided a template PHP Class file that we use for all our card processors. This class file will need to be adjusted for your specific payment processor, ensuring you do all the requests you need using technologies such as cURL. We do not support using any frameworks, nor including any additional files except for the single file we provide. [block:callout] { "type": "info", "title": "Where is the PHP Class File?", "body": "You can find the file here: https://docs.gazoop.com/docs/php-class-template" } [/block] [block:api-header] { "title": "What methods of card processing does Gazoop support?" } [/block] Gazoop supports any number of payment processors and can support them via two methods. 1. Tokenization 2. Stored Card Details We highly recommend sticking with Tokenization where possible. [block:api-header] { "title": "How do I customise the variables we need to send payment requests?" } [/block] In the class construct we will send an array of configuration variables as is required. This can include login details, API keys, authentication details, etc. For example, if you want the customer to provide a Login Name and API Key just comment in the __construct API [block:code] { "codes": [ { "code": "public function __construct($configuration){\n \t\t$this->configuration['Login_Name'] = $configuration['Login_Name']; \n \t\t$this->configuration['API_Key'] = $configuration['API_Key'];\n}", "language": "php" } ] } [/block] If you require Gazoop to complete an oAuth2 authentication to obtain client tokens, please ensure you provide us the documentation and relevant API keys to do this as easily as possible. Please also ensure you specify $configuration['Client_Token'] and use it as reference in the remaining functions. [block:api-header] { "title": "How do I implement it using stored card details?" } [/block] Ensure that the method getToken is removed or commented out. If this method does not exist when Gazoop goes to store or process a charge, we will continue to provide and store all card details in the chargeCard method call. Note: We only provide the CVV2 code on the first transaction, you should make sure the requirement to give a CVV2 is disabled for future payments as we are not permitted to store this information. [block:api-header] { "title": "How do I implement it using tokenization?" } [/block] Ensure the method getToken exists and is populated to return a token that can be used for future charges. If getToken exists, we will only store the last 4 digits of the card, the card type, and the expiration date, along with the returned token. We will not store any other information including the full card number. We will always check for getToken and call this before processing any chargeCard call. [block:api-header] { "title": "How do I test this is working?" } [/block] You can use the class locally to test all is as it seems by using code like below as an example: [block:code] { "codes": [ { "code": "<?php\n\ninclude(\"CardProvider.class.php\");\n$cardprocessor = new CreditCardModule(array(\"APIKey\"=>\"Test\"));\n$cardprocessor->applyCardDetails(\"4242424242424242\",\"Mastercard\",\"0122\",\"123\");\n$cardprocessor->applyPersonalDetails(\"Jack\",\"Jones\",\"123 Street\",\"\",\"New York\",\"NY\",\"US\",\"12345\",\"[email protected]\");\n// $cardProcessor->getToken();\n$cardprocessor->chargeCard(\"1.00\",\"USD\");\n\n?>", "language": "text" } ] } [/block] Once you have completed above, please send your completed PHP Class file to Gazoop who will conduct any final tests you require. [block:api-header] { "title": "What are the available variables and its format?" } [/block] [block:parameters] { "data": { "h-0": "Variable Name", "h-1": "Format", "h-2": "Description", "h-3": "Example", "0-0": "$card_number", "0-1": "int", "0-2": "This is the full card number given by the customer with no spaces or special characters.", "0-3": "4242424242424242", "1-0": "$card_type", "1-1": "string", "1-2": "This is the type of card being provided as detected by our system. The casing and format in the examples are valid results we send.", "1-3": "Mastercard\nVisa\nDiscover\nAmex\nBankcard\nJCB\nMaestro\nVisaElectron\nDiners\nSolo\nLaser", "2-0": "$expiry", "2-1": "string(4)", "2-2": "This is a 4 digit representation of the expiration date. Months are prefix with 0 where below 10. The example is May 2025 expiration.", "2-3": "0525", "3-0": "$cvv", "3-1": "string(4)", "3-2": "This is a 3/4 digit security code provided by the customer when storing their card. We will only provide this on the first interaction, this information is never stored. Future card payments this variable will be blank.", "3-3": "123", "4-0": "$valid_from", "4-1": "string(4)", "4-2": "This is a 4 digit representation of the valid from date. Months are prefix with 0 where below 10. The example is May 2015 expiration.", "4-3": "0515", "5-0": "$issue", "5-1": "int", "5-2": "This is the issue number of the card.", "5-3": "1", "6-0": "$first_name", "6-1": "string(100)", "6-2": "This is the card holders first name.", "6-3": "Jack", "7-0": "$last_name", "7-1": "string(100)", "7-2": "This is the card holders last name.", "7-3": "Jones", "8-0": "$address1", "8-1": "string(200)", "8-2": "This is the first line of the billing address.", "8-3": "123 High Street", "9-0": "$address2", "9-1": "string(200)", "9-2": "This is the second line of the billing address.", "9-3": "The House Building", "10-0": "$city", "10-1": "string(100)", "10-2": "This is the city of the billing address.", "10-3": "New York", "11-0": "$state", "11-1": "string(100)", "11-2": "This is the state/county of the billing address.", "11-3": "NY", "12-0": "$country", "12-1": "string(2)", "12-2": "This is the 2 letter country code for the country in Alpha-2 format.", "12-3": "US", "13-0": "$postcode", "13-1": "string(50)", "13-2": "This is the ZIP or Postal code for the billing address.", "13-3": "12345", "14-0": "$email", "14-1": "string(200)", "14-2": "This is the email address for the card holder.", "14-3": "[email protected]" }, "cols": 4, "rows": 15 } [/block] [block:api-header] { "title": "What information should I return with the ChargeCard method?" } [/block] We require three variables to be set when we submit a request to the chargeCard method. **$this->transactionNotes** This should include any relevant notes about the transaction, such as error messages, or details about reference numbers or payment processing times if required. This can also be left blank. **$this->reference** This should include the transaction reference number that the customer can reference to pull up this specific payment. This is included in the receipts and invoices we store. **$this->status** This is the result of the payment request and it should be either "Authorized" or "NotAuthorized". We do not currently accept any other result, details of any errors can be given in the transactionNotes above.