From 0ad449fa0dbad1239e8e7761abc3b81bf11284ae Mon Sep 17 00:00:00 2001 From: Sharath Date: Mon, 4 Feb 2019 19:18:43 +0530 Subject: [PATCH 1/2] PR for issue sample-code-php/issues/142 --- PaymentTransactions/charge-customer-profile.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PaymentTransactions/charge-customer-profile.php b/PaymentTransactions/charge-customer-profile.php index 7482001..f26367d 100644 --- a/PaymentTransactions/charge-customer-profile.php +++ b/PaymentTransactions/charge-customer-profile.php @@ -6,7 +6,7 @@ define("AUTHORIZENET_LOG_FILE", "phplog"); -function chargeCustomerProfile($profileid, $paymentprofileid, $amount) +function chargeCustomerProfile($profileid, $paymentprofileid,$shippingProfileId, $amount) { /* Create a merchantAuthenticationType object with authentication details retrieved from the constants file */ @@ -21,6 +21,8 @@ function chargeCustomerProfile($profileid, $paymentprofileid, $amount) $profileToCharge->setCustomerProfileId($profileid); $paymentProfile = new AnetAPI\PaymentProfileType(); $paymentProfile->setPaymentProfileId($paymentprofileid); + // either ShipTO or ShippingProfileID can be used but not Both. + $profileToCharge->setShippingProfileId($shippingProfileId); $profileToCharge->setPaymentProfile($paymentProfile); $transactionRequestType = new AnetAPI\TransactionRequestType(); @@ -85,5 +87,5 @@ function chargeCustomerProfile($profileid, $paymentprofileid, $amount) } if(!defined('DONT_RUN_SAMPLES')) - chargeCustomerProfile("36731856","32689274",12.23); + chargeCustomerProfile("1917854275","1831010763","1875117981",12.23); ?> From ad8927d90fa1ba64788e34f75e1f30c39581d03b Mon Sep 17 00:00:00 2001 From: Sharath Date: Mon, 11 Feb 2019 12:04:41 +0530 Subject: [PATCH 2/2] Travis Changes --- test-runner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test-runner.php b/test-runner.php index 61c981c..44843eb 100644 --- a/test-runner.php +++ b/test-runner.php @@ -182,6 +182,7 @@ public static function runChargeCustomerProfile() $chargeResponse = chargeCustomerProfile( $response->getCustomerProfileId(), $paymentProfileResponse->getCustomerPaymentProfileId(), + $response->getCustomerShippingAddressIdList()[0], self::getAmount() ); deleteCustomerProfile($response->getCustomerProfileId());