how do i authenticate against cybersource soap toolkit api on php












0















I have the following code on my index.php



<?php
// This sample demonstrates how to run a sale request, which combines an
// authorization with a capture in one request.

// Using Composer-generated autoload file.
require __DIR__ . '/vendor/autoload.php';
// Or, uncomment the line below if you're not using Composer autoloader.
//require_once(__DIR__ . '/lib/CybsSoapClient.php');


// Before using this example, you can use your own reference code for the transaction.
$referenceCode = 'holla';

$client = new CybsSoapClient();
$request = $client->createRequest($referenceCode);

// Build a sale request (combining an auth and capture). In this example only
// the amount is provided for the purchase total.
$ccAuthService = new stdClass();
$ccAuthService->run = 'true';
$request->ccAuthService = $ccAuthService;

$ccCaptureService = new stdClass();
$ccCaptureService->run = 'true';
$request->ccCaptureService = $ccCaptureService;

$billTo = new stdClass();
$billTo->firstName = 'John';
$billTo->lastName = 'Doe';
$billTo->street1 = '1295 Charleston Road';
$billTo->city = 'Mountain View';
$billTo->state = 'CA';
$billTo->postalCode = '94043';
$billTo->country = 'US';
$billTo->email = 'null@cybersource.com';
$billTo->ipAddress = '10.7.111.111';
$request->billTo = $billTo;

$card = new stdClass();
$card->accountNumber = '4111111111111111';
$card->expirationMonth = '12';
$card->expirationYear = '2020';
$request->card = $card;

$purchaseTotals = new stdClass();
$purchaseTotals->currency = 'USD';
$purchaseTotals->grandTotalAmount = '90.01';
$request->purchaseTotals = $purchaseTotals;

$reply = $client->runTransaction($request);

// This section will show all the reply fields.
print("nRESPONSE: " . print_r($reply, true));


and the cybs.ini is like



merchant_id = "firefy"
transaction_key = "5430494897960177107046"

; Modify the URL to point to either a live or test WSDL file with the desired API version.
wsdl = "https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


when i run the code on my local machine i get the following error messaage.



Fatal error: Uncaught SoapFault exception: [wsse:FailedCheck] Security Data : UsernameToken authentication failed. in C:xampphtdocscybersourceTestindex.php:50 Stack trace: #0 C:xampphtdocscybersourceTestindex.php(50): SoapClient->__call('runTransaction', Array) #1 {main} thrown in C:xampphtdocscybersourceTestindex.php on line 50


How do i know what caused the error above and how can i solve the above error.
I am trying to add payout api to my app and this is giving a headache right now.
Please guys help me out if anyone can.










share|improve this question



























    0















    I have the following code on my index.php



    <?php
    // This sample demonstrates how to run a sale request, which combines an
    // authorization with a capture in one request.

    // Using Composer-generated autoload file.
    require __DIR__ . '/vendor/autoload.php';
    // Or, uncomment the line below if you're not using Composer autoloader.
    //require_once(__DIR__ . '/lib/CybsSoapClient.php');


    // Before using this example, you can use your own reference code for the transaction.
    $referenceCode = 'holla';

    $client = new CybsSoapClient();
    $request = $client->createRequest($referenceCode);

    // Build a sale request (combining an auth and capture). In this example only
    // the amount is provided for the purchase total.
    $ccAuthService = new stdClass();
    $ccAuthService->run = 'true';
    $request->ccAuthService = $ccAuthService;

    $ccCaptureService = new stdClass();
    $ccCaptureService->run = 'true';
    $request->ccCaptureService = $ccCaptureService;

    $billTo = new stdClass();
    $billTo->firstName = 'John';
    $billTo->lastName = 'Doe';
    $billTo->street1 = '1295 Charleston Road';
    $billTo->city = 'Mountain View';
    $billTo->state = 'CA';
    $billTo->postalCode = '94043';
    $billTo->country = 'US';
    $billTo->email = 'null@cybersource.com';
    $billTo->ipAddress = '10.7.111.111';
    $request->billTo = $billTo;

    $card = new stdClass();
    $card->accountNumber = '4111111111111111';
    $card->expirationMonth = '12';
    $card->expirationYear = '2020';
    $request->card = $card;

    $purchaseTotals = new stdClass();
    $purchaseTotals->currency = 'USD';
    $purchaseTotals->grandTotalAmount = '90.01';
    $request->purchaseTotals = $purchaseTotals;

    $reply = $client->runTransaction($request);

    // This section will show all the reply fields.
    print("nRESPONSE: " . print_r($reply, true));


    and the cybs.ini is like



    merchant_id = "firefy"
    transaction_key = "5430494897960177107046"

    ; Modify the URL to point to either a live or test WSDL file with the desired API version.
    wsdl = "https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


    when i run the code on my local machine i get the following error messaage.



    Fatal error: Uncaught SoapFault exception: [wsse:FailedCheck] Security Data : UsernameToken authentication failed. in C:xampphtdocscybersourceTestindex.php:50 Stack trace: #0 C:xampphtdocscybersourceTestindex.php(50): SoapClient->__call('runTransaction', Array) #1 {main} thrown in C:xampphtdocscybersourceTestindex.php on line 50


    How do i know what caused the error above and how can i solve the above error.
    I am trying to add payout api to my app and this is giving a headache right now.
    Please guys help me out if anyone can.










    share|improve this question

























      0












      0








      0








      I have the following code on my index.php



      <?php
      // This sample demonstrates how to run a sale request, which combines an
      // authorization with a capture in one request.

      // Using Composer-generated autoload file.
      require __DIR__ . '/vendor/autoload.php';
      // Or, uncomment the line below if you're not using Composer autoloader.
      //require_once(__DIR__ . '/lib/CybsSoapClient.php');


      // Before using this example, you can use your own reference code for the transaction.
      $referenceCode = 'holla';

      $client = new CybsSoapClient();
      $request = $client->createRequest($referenceCode);

      // Build a sale request (combining an auth and capture). In this example only
      // the amount is provided for the purchase total.
      $ccAuthService = new stdClass();
      $ccAuthService->run = 'true';
      $request->ccAuthService = $ccAuthService;

      $ccCaptureService = new stdClass();
      $ccCaptureService->run = 'true';
      $request->ccCaptureService = $ccCaptureService;

      $billTo = new stdClass();
      $billTo->firstName = 'John';
      $billTo->lastName = 'Doe';
      $billTo->street1 = '1295 Charleston Road';
      $billTo->city = 'Mountain View';
      $billTo->state = 'CA';
      $billTo->postalCode = '94043';
      $billTo->country = 'US';
      $billTo->email = 'null@cybersource.com';
      $billTo->ipAddress = '10.7.111.111';
      $request->billTo = $billTo;

      $card = new stdClass();
      $card->accountNumber = '4111111111111111';
      $card->expirationMonth = '12';
      $card->expirationYear = '2020';
      $request->card = $card;

      $purchaseTotals = new stdClass();
      $purchaseTotals->currency = 'USD';
      $purchaseTotals->grandTotalAmount = '90.01';
      $request->purchaseTotals = $purchaseTotals;

      $reply = $client->runTransaction($request);

      // This section will show all the reply fields.
      print("nRESPONSE: " . print_r($reply, true));


      and the cybs.ini is like



      merchant_id = "firefy"
      transaction_key = "5430494897960177107046"

      ; Modify the URL to point to either a live or test WSDL file with the desired API version.
      wsdl = "https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


      when i run the code on my local machine i get the following error messaage.



      Fatal error: Uncaught SoapFault exception: [wsse:FailedCheck] Security Data : UsernameToken authentication failed. in C:xampphtdocscybersourceTestindex.php:50 Stack trace: #0 C:xampphtdocscybersourceTestindex.php(50): SoapClient->__call('runTransaction', Array) #1 {main} thrown in C:xampphtdocscybersourceTestindex.php on line 50


      How do i know what caused the error above and how can i solve the above error.
      I am trying to add payout api to my app and this is giving a headache right now.
      Please guys help me out if anyone can.










      share|improve this question














      I have the following code on my index.php



      <?php
      // This sample demonstrates how to run a sale request, which combines an
      // authorization with a capture in one request.

      // Using Composer-generated autoload file.
      require __DIR__ . '/vendor/autoload.php';
      // Or, uncomment the line below if you're not using Composer autoloader.
      //require_once(__DIR__ . '/lib/CybsSoapClient.php');


      // Before using this example, you can use your own reference code for the transaction.
      $referenceCode = 'holla';

      $client = new CybsSoapClient();
      $request = $client->createRequest($referenceCode);

      // Build a sale request (combining an auth and capture). In this example only
      // the amount is provided for the purchase total.
      $ccAuthService = new stdClass();
      $ccAuthService->run = 'true';
      $request->ccAuthService = $ccAuthService;

      $ccCaptureService = new stdClass();
      $ccCaptureService->run = 'true';
      $request->ccCaptureService = $ccCaptureService;

      $billTo = new stdClass();
      $billTo->firstName = 'John';
      $billTo->lastName = 'Doe';
      $billTo->street1 = '1295 Charleston Road';
      $billTo->city = 'Mountain View';
      $billTo->state = 'CA';
      $billTo->postalCode = '94043';
      $billTo->country = 'US';
      $billTo->email = 'null@cybersource.com';
      $billTo->ipAddress = '10.7.111.111';
      $request->billTo = $billTo;

      $card = new stdClass();
      $card->accountNumber = '4111111111111111';
      $card->expirationMonth = '12';
      $card->expirationYear = '2020';
      $request->card = $card;

      $purchaseTotals = new stdClass();
      $purchaseTotals->currency = 'USD';
      $purchaseTotals->grandTotalAmount = '90.01';
      $request->purchaseTotals = $purchaseTotals;

      $reply = $client->runTransaction($request);

      // This section will show all the reply fields.
      print("nRESPONSE: " . print_r($reply, true));


      and the cybs.ini is like



      merchant_id = "firefy"
      transaction_key = "5430494897960177107046"

      ; Modify the URL to point to either a live or test WSDL file with the desired API version.
      wsdl = "https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


      when i run the code on my local machine i get the following error messaage.



      Fatal error: Uncaught SoapFault exception: [wsse:FailedCheck] Security Data : UsernameToken authentication failed. in C:xampphtdocscybersourceTestindex.php:50 Stack trace: #0 C:xampphtdocscybersourceTestindex.php(50): SoapClient->__call('runTransaction', Array) #1 {main} thrown in C:xampphtdocscybersourceTestindex.php on line 50


      How do i know what caused the error above and how can i solve the above error.
      I am trying to add payout api to my app and this is giving a headache right now.
      Please guys help me out if anyone can.







      php soap cybersource






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 11:18









      David InnocentDavid Innocent

      34




      34
























          2 Answers
          2






          active

          oldest

          votes


















          0














          The error “authentication failed” is saying your merchant_id and transaction_key are not correct.



          Assuming that your merchant_id is correct your transaction_key is not the correct format. You can get a transaction_key by going to the business center at https://ebctest.cybersource.com then go to Account Management-> Transaction Security Keys -> Security Keys for the SOAP Toolkit API. Generate a key there.






          share|improve this answer
























          • I did find the transaction key for but i still cant get the error to go away. i got a key that is like 100 characters long. i tried that but still the same error comes up.

            – David Innocent
            Nov 26 '18 at 8:32













          • I tried that but nothing is happening the same error keeps popping up. i added the transaction key that i was given. it is like 100characters long and the merchant id .what am i missing merchant_id=firefy and transaction_key="the_transaction_key_i_was_given_by_Cybersource_here"

            – David Innocent
            Nov 26 '18 at 8:50











          • i will mark your answer correct anyway because you gave me insight to what i was looking for. Thank you

            – David Innocent
            Nov 26 '18 at 9:16



















          0














          I found out that i the url that i was pointing to was not valid or something but i fixed it by changing the endpoint of the wsdl from



          wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


          to



          wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.151.wsdl"


          That took care of everything that was wrong with the error that was popping up.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457590%2fhow-do-i-authenticate-against-cybersource-soap-toolkit-api-on-php%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The error “authentication failed” is saying your merchant_id and transaction_key are not correct.



            Assuming that your merchant_id is correct your transaction_key is not the correct format. You can get a transaction_key by going to the business center at https://ebctest.cybersource.com then go to Account Management-> Transaction Security Keys -> Security Keys for the SOAP Toolkit API. Generate a key there.






            share|improve this answer
























            • I did find the transaction key for but i still cant get the error to go away. i got a key that is like 100 characters long. i tried that but still the same error comes up.

              – David Innocent
              Nov 26 '18 at 8:32













            • I tried that but nothing is happening the same error keeps popping up. i added the transaction key that i was given. it is like 100characters long and the merchant id .what am i missing merchant_id=firefy and transaction_key="the_transaction_key_i_was_given_by_Cybersource_here"

              – David Innocent
              Nov 26 '18 at 8:50











            • i will mark your answer correct anyway because you gave me insight to what i was looking for. Thank you

              – David Innocent
              Nov 26 '18 at 9:16
















            0














            The error “authentication failed” is saying your merchant_id and transaction_key are not correct.



            Assuming that your merchant_id is correct your transaction_key is not the correct format. You can get a transaction_key by going to the business center at https://ebctest.cybersource.com then go to Account Management-> Transaction Security Keys -> Security Keys for the SOAP Toolkit API. Generate a key there.






            share|improve this answer
























            • I did find the transaction key for but i still cant get the error to go away. i got a key that is like 100 characters long. i tried that but still the same error comes up.

              – David Innocent
              Nov 26 '18 at 8:32













            • I tried that but nothing is happening the same error keeps popping up. i added the transaction key that i was given. it is like 100characters long and the merchant id .what am i missing merchant_id=firefy and transaction_key="the_transaction_key_i_was_given_by_Cybersource_here"

              – David Innocent
              Nov 26 '18 at 8:50











            • i will mark your answer correct anyway because you gave me insight to what i was looking for. Thank you

              – David Innocent
              Nov 26 '18 at 9:16














            0












            0








            0







            The error “authentication failed” is saying your merchant_id and transaction_key are not correct.



            Assuming that your merchant_id is correct your transaction_key is not the correct format. You can get a transaction_key by going to the business center at https://ebctest.cybersource.com then go to Account Management-> Transaction Security Keys -> Security Keys for the SOAP Toolkit API. Generate a key there.






            share|improve this answer













            The error “authentication failed” is saying your merchant_id and transaction_key are not correct.



            Assuming that your merchant_id is correct your transaction_key is not the correct format. You can get a transaction_key by going to the business center at https://ebctest.cybersource.com then go to Account Management-> Transaction Security Keys -> Security Keys for the SOAP Toolkit API. Generate a key there.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 24 '18 at 23:33









            Will HWill H

            261




            261













            • I did find the transaction key for but i still cant get the error to go away. i got a key that is like 100 characters long. i tried that but still the same error comes up.

              – David Innocent
              Nov 26 '18 at 8:32













            • I tried that but nothing is happening the same error keeps popping up. i added the transaction key that i was given. it is like 100characters long and the merchant id .what am i missing merchant_id=firefy and transaction_key="the_transaction_key_i_was_given_by_Cybersource_here"

              – David Innocent
              Nov 26 '18 at 8:50











            • i will mark your answer correct anyway because you gave me insight to what i was looking for. Thank you

              – David Innocent
              Nov 26 '18 at 9:16



















            • I did find the transaction key for but i still cant get the error to go away. i got a key that is like 100 characters long. i tried that but still the same error comes up.

              – David Innocent
              Nov 26 '18 at 8:32













            • I tried that but nothing is happening the same error keeps popping up. i added the transaction key that i was given. it is like 100characters long and the merchant id .what am i missing merchant_id=firefy and transaction_key="the_transaction_key_i_was_given_by_Cybersource_here"

              – David Innocent
              Nov 26 '18 at 8:50











            • i will mark your answer correct anyway because you gave me insight to what i was looking for. Thank you

              – David Innocent
              Nov 26 '18 at 9:16

















            I did find the transaction key for but i still cant get the error to go away. i got a key that is like 100 characters long. i tried that but still the same error comes up.

            – David Innocent
            Nov 26 '18 at 8:32







            I did find the transaction key for but i still cant get the error to go away. i got a key that is like 100 characters long. i tried that but still the same error comes up.

            – David Innocent
            Nov 26 '18 at 8:32















            I tried that but nothing is happening the same error keeps popping up. i added the transaction key that i was given. it is like 100characters long and the merchant id .what am i missing merchant_id=firefy and transaction_key="the_transaction_key_i_was_given_by_Cybersource_here"

            – David Innocent
            Nov 26 '18 at 8:50





            I tried that but nothing is happening the same error keeps popping up. i added the transaction key that i was given. it is like 100characters long and the merchant id .what am i missing merchant_id=firefy and transaction_key="the_transaction_key_i_was_given_by_Cybersource_here"

            – David Innocent
            Nov 26 '18 at 8:50













            i will mark your answer correct anyway because you gave me insight to what i was looking for. Thank you

            – David Innocent
            Nov 26 '18 at 9:16





            i will mark your answer correct anyway because you gave me insight to what i was looking for. Thank you

            – David Innocent
            Nov 26 '18 at 9:16













            0














            I found out that i the url that i was pointing to was not valid or something but i fixed it by changing the endpoint of the wsdl from



            wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


            to



            wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.151.wsdl"


            That took care of everything that was wrong with the error that was popping up.






            share|improve this answer




























              0














              I found out that i the url that i was pointing to was not valid or something but i fixed it by changing the endpoint of the wsdl from



              wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


              to



              wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.151.wsdl"


              That took care of everything that was wrong with the error that was popping up.






              share|improve this answer


























                0












                0








                0







                I found out that i the url that i was pointing to was not valid or something but i fixed it by changing the endpoint of the wsdl from



                wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


                to



                wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.151.wsdl"


                That took care of everything that was wrong with the error that was popping up.






                share|improve this answer













                I found out that i the url that i was pointing to was not valid or something but i fixed it by changing the endpoint of the wsdl from



                wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.109.wsdl"


                to



                wsdl="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.151.wsdl"


                That took care of everything that was wrong with the error that was popping up.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 26 '18 at 9:14









                David InnocentDavid Innocent

                34




                34






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457590%2fhow-do-i-authenticate-against-cybersource-soap-toolkit-api-on-php%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    To store a contact into the json file from server.js file using a class in NodeJS

                    Marschland

                    Redirect URL with Chrome Remote Debugging Android Devices