{"id":17491765,"url":"https://github.com/coletiv/cybersource-sdk","last_synced_at":"2025-04-14T12:41:05.078Z","repository":{"id":57488030,"uuid":"114366026","full_name":"coletiv/cybersource-sdk","owner":"coletiv","description":"Elixir module to provide interface with CyberSource SOAP API ","archived":false,"fork":false,"pushed_at":"2024-05-14T07:25:21.000Z","size":51,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T11:13:29.494Z","etag":null,"topics":["cybersource","elixir","payment-processing"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coletiv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-15T12:01:52.000Z","updated_at":"2024-07-16T05:47:27.000Z","dependencies_parsed_at":"2024-11-01T04:01:46.408Z","dependency_job_id":"58f6d941-d036-43b5-9e1d-04e3b7f1a95c","html_url":"https://github.com/coletiv/cybersource-sdk","commit_stats":{"total_commits":29,"total_committers":3,"mean_commits":9.666666666666666,"dds":0.06896551724137934,"last_synced_commit":"704ccab6e67cee34bb980a4f8083e581793c61ce"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coletiv%2Fcybersource-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coletiv%2Fcybersource-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coletiv%2Fcybersource-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coletiv%2Fcybersource-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coletiv","download_url":"https://codeload.github.com/coletiv/cybersource-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248883033,"owners_count":21177140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cybersource","elixir","payment-processing"],"created_at":"2024-10-19T08:04:51.326Z","updated_at":"2025-04-14T12:41:05.043Z","avatar_url":"https://github.com/coletiv.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cybersource SDK\n\n[![Build Status](https://travis-ci.org/coletiv/cybersource-sdk.svg?branch=master)](https://travis-ci.org/coletiv/cybersource-sdk)\n[![Hex.pm Version](http://img.shields.io/hexpm/v/cybersource_sdk.svg)](https://hex.pm/packages/cybersource_sdk)\n\nThis module handle CyberSource SOAP service for payments. I've tried to use [Detergentx](https://github.com/r-icarus/detergentex) Elixir wrapper to erlang module detergent without success. Also tried [Bet365 soap](https://github.com/bet365/soap/) module, with no luck.\n\nThis module only works for **Apple Pay** and **Android Pay**. Other systems will be added in the future.\n\nIt only supports 3 types of requests: Authorization, Capture and Refund.\n\n## Usage\n\n1. Add `cybersource_sdk` to your deps:\n\n```\n[\n  ...\n  {:cybersource_sdk, \"~\u003e 1.0.0\"},\n  ...\n]\n```\n\n2. Add `cybersource_sdk` to the list of applications dependencies in your `mix.exs`.\n\n```\ndef application do\n  [applications: [..., :cybersource_sdk]]\nend\n```\n\n3. Add configuration to your `prod.secret.exs` and/or `dev.secret.exs`.\n\nCheck [Configurations](#Configurations).\n\n4. How to call it.\n\nCheck [Requests](#Requests).\n\n## Configurations\n\nYou can update 4 parameters in configurations:\n\n* **endpoint**: WSDL endpoint URL, you can check the most recent in `https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/`. Don't forget to only use the one with `.wsdl`.\n* **merchant_id**: Your `merchant_id`, the same you use for login.\n* **transaction_key**: This key can be generated in your [Business Center](https://ebctest.cybersource.com/ebctest/login/LoginProcess.do), under `Account Management` \u003e `Transaction Security Keys` \u003e `Security Keys for the SOAP Toolkit API`.\n* **currency**: Value of the currency you are going to use. Example: `USD`, `EUR`, ...\n\n```\nconfig :cybersource_sdk,\n  endpoint: \"https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.142.wsdl\",\n  merchant: %{\n    id: \"my_company\",\n    transaction_key: \"pdsamp9094m89njkndsa+32423lnksi0NBL32M90dan==\",\n    currency: \"USD\"\n  }\n```\n\nYou can add multiple merchants. You need to setup first in configurations like the following example:\n\n```\nconfig :cybersource_sdk,\n  endpoint: \"https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.142.wsdl\",\n  merchant_apple_pay: %{\n    id: \"my_company_1\",\n    transaction_key: \"pdsamp9094m89njkndsa+32423lnksi0NBL32M90dan==\",\n    currency: \"USD\"\n  },\n  merchant_android_pay: %{\n    id: \"my_company_2\",\n    transaction_key: \"pdsamp9094m89njkndsa+32423lnksi0NBL32M90dan==\",\n    currency: \"USD\"\n  }\n```\n\nAfter this, you need to send the `worker` merchant atom to the request.\n\n## Requests\n\n### Authorization\n\nCheck credit card funds, and hold the payment of the transaction until a capture or refund request is issued.\n\n**Example**\n```\nbill_to = CyberSourceSDK.bill_to(\"John\", \"Doe\", \"Freedom Street\", \"3L 10001\", \"New York\", \"USA\", \"john.doe@example.com\")\nCyberSourceSDK.authorize(50, bill_to, \"VISA\", \"3a9KSs98jDSAMsandsab8DSA+dk==\", [], :merchant_android_pay)\n```\n\n### Capture\n\nComplete the authorization request by finishing it with the capture request. All the funds of this transaction will be available in your account and charged to the user.\n\n**Example**\n```\nitems = [\n  %{\n    id: 0,\n    unit_price: 12,\n    quantity: 2\n  }\n]\n\nCyberSourceSDK.capture(\"12345\", request_id, items)\n```\n\n### Refund\n\nCancel the authorization request by letting CyberSource know that you don't want to charge the user.\n\n**Example**\n```\nitems = [\n  %{\n    id: 0,\n    unit_price: 12,\n    quantity: 2\n  }\n]\n\nCyberSourceSDK.refund(\"12345\", request_id, items)\n```\n\n## Response\n\nResponse to the request will be the following map:\n\n```\nmerchantReferenceCode: \"...\",\nrequestID: ...,\ndecision: \"...\",\nreasonCode: ...,\nrequestToken: \"...\",\nccAuthReply: [\n  reasonCode: ....,\n  amount: ...\n],\nccCapctureReply: [\n  reasonCode: ...,\n  amount: ...\n],\nccAuthReversalReply: [\n  reasonCode: ...,\n  amount: ...\n],\nfault: [\n  faultCode: ...,\n  faultString: ...\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoletiv%2Fcybersource-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoletiv%2Fcybersource-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoletiv%2Fcybersource-sdk/lists"}