<commit_before><?php
  require 'vendor/autoload.php';
  use net\authorize\api\contract\v1 as AnetAPI;
  use net\authorize\api\controller as AnetController;
  define("AUTHORIZENET_LOG_FILE", "phplog");
  // Common setup for API credentials
  $merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
  $merchantAuthentication->setName("556KThWQ6vf2");
  $merchantAuthentication->setTransactionKey("<KEY>");
  $refId = 'ref' . time();
  //Use an existing profile id
  $existingcustomerprofileid = "35858366";

  // Retrieve an existing customer profile along with all the associated payment profiles and shipping addresses
  $request = new AnetAPI\GetCustomerProfileRequest();
  $request->setMerchantAuthentication($merchantAuthentication);
  $request->setCustomerProfileId( $existingcustomerprofileid );
  $controller = new AnetController\GetCustomerProfileController($request);

  $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);
  if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") )
  {
 //   echo "SUCCESS: PROFILE RETRIEVED : " . $response->getProfile() . "\n";
    $getcustomerprofileid = $response->getProfile();
  }
  else
  {
    echo "GetCustomerProfileRequest ERROR :  Invalid response\n";
  }

  // Create the payment data for a credit card
  $creditCard = new AnetAPI\CreditCardType();
  $creditCard->setCardNumber( "4012888818888" );
  $creditCard->setExpirationDate( "2038-11");
  $creditCard->setCardCode( "123");
  $paymentCreditCard = new AnetAPI\PaymentType();
  $paymentCreditCard->setCreditCard($creditCard);

  // Create the Bill To info for new payment type
  $billto = new AnetAPI\CustomerAddressType();
  $billto->setFirstName("<NAME>");
  $billto->setLastName("Doe");
  $billto->setCompany("My company");
  $billto->setAddress("123 Main St.");
  $billto->setCity("Bellevue");
  $billto->setState("WA");
  $billto->setZip("98004");
  $billto->setPhoneNumber("000-000-0000");
  $billto->setfaxNumber("999-999-9999");
  $billto->setCountry("USA");

  // Create a new Customer Payment Profile
  $paymentprofile = new AnetAPI\CustomerPaymentProfileType();
  $paymentprofile->setCustomerType('individual');
  $paymentprofile->setBillTo($billto);
  $paymentprofile->setPayment($paymentCreditCard);
  $paymentprofile->setTaxId("level2");

  $paymentprofiles[] = $paymentprofile;

  // Submit a CreateCustomerPaymentProfileRequest to create a new Customer Payment Profile
  $paymentprofilerequest = new AnetAPI\CreateCustomerPaymentProfileRequest();
  $paymentprofilerequest->setMerchantAuthentication($merchantAuthentication);
  $paymentprofilerequest->setCustomerProfileId( $getcustomerprofileid  );
  $paymentprofilerequest->setPaymentProfile( $paymentprofile );
  $paymentprofilerequest->setValidationMode("liveMode");
  $controller = new AnetController\CreateCustomerPaymentProfileController($request);
  $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);
  if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") )
  {<commit_msg>Updated code for create customer payment profile<commit_after><?php
  require 'vendor/autoload.php';
  use net\authorize\api\contract\v1 as AnetAPI;
  use net\authorize\api\controller as AnetController;
  define("AUTHORIZENET_LOG_FILE", "phplog");
  // Common setup for API credentials
  $merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
  $merchantAuthentication->setName("556KThWQ6vf2");
  $merchantAuthentication->setTransactionKey("<KEY>");
  $refId = 'ref' . time();
  //Use an existing profile id
  $existingcustomerprofileid = "35858366";

  $creditCard = new AnetAPI\CreditCardType();
  $creditCard->setCardNumber( "4012888818888" );
  $creditCard->setExpirationDate( "2038-11");
  $creditCard->setCardCode( "123");
  $paymentCreditCard = new AnetAPI\PaymentType();
  $paymentCreditCard->setCreditCard($creditCard);

  // Create the Bill To info for new payment type
  $billto = new AnetAPI\CustomerAddressType();
  $billto->setFirstName("<NAME>");
  $billto->setLastName("Doe");
  $billto->setCompany("My company");
  $billto->setAddress("123 Main St.");
  $billto->setCity("Bellevue");
  $billto->setState("WA");
  $billto->setZip("98004");
  $billto->setPhoneNumber("000-000-0000");
  $billto->setfaxNumber("999-999-9999");
  $billto->setCountry("USA");

  // Create a new Customer Payment Profile
  $paymentprofile = new AnetAPI\CustomerPaymentProfileType();
  $paymentprofile->setCustomerType('individual');
  $paymentprofile->setBillTo($billto);
  $paymentprofile->setPayment($paymentCreditCard);

  $paymentprofiles[] = $paymentprofile;

  // Submit a CreateCustomerPaymentProfileRequest to create a new Customer Payment Profile
  $paymentprofilerequest = new AnetAPI\CreateCustomerPaymentProfileRequest();
  $paymentprofilerequest->setMerchantAuthentication($merchantAuthentication);
  $paymentprofilerequest->setCustomerProfileId( $existingcustomerprofileid );
  $paymentprofilerequest->setPaymentProfile( $paymentprofile );
  $paymentprofilerequest->setValidationMode("liveMode");
  $controller = new AnetController\CreateCustomerPaymentProfileController($paymentprofilerequest);
  $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);
  if (($response != null) && ($response->getMessages()->getResultCode() == "Ok") )
  {
{'fraction_non_alphanumeric': 0.1410162002945508, 'fraction_numerical': 0.023748159057437407, 'mean_word_length': 6.292617449664429, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4734895', 'n_tokens_mistral': 1743, 'n_tokens_neox': 1578, 'n_words': 291}