Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The BillingCountry value is invalid. #189

Open
SM-Prasad opened this issue Oct 21, 2022 · 1 comment
Open

The BillingCountry value is invalid. #189

SM-Prasad opened this issue Oct 21, 2022 · 1 comment
Labels

Comments

@SM-Prasad
Copy link

SM-Prasad commented Oct 21, 2022

I have installed Omnipay via composer and used below added code

require_once('vendor/autoload.php');

use Omnipay\Omnipay;
use Omnipay\Common\CreditCard;

$gateway = OmniPay::create('SagePay\Direct')->initialize([
    'vendor' => 'profarmadirect',
    'testMode' => true,
]);

$card = new CreditCard([
    'firstName' => 'Card',
    'lastName' => 'User',
    'number' => '4929000000006',
    'expiryMonth' => '12',
    'expiryYear' => '2030',
    'CVV' => '123',
]);

$requestMessage = $gateway->purchase([
    'amount' => '99.99',
    'currency' => 'GBP',
    'card' => $card,
    'transactionId' => '123',
    'description' => 'Pizzas for everyone at PHPNE',
    'clientip' => $_SERVER['REMOTE_ADDR'],
     'billingCountry' => 'GB',
    // If 3D Secure is enabled, then provide a return URL for
    // when the user comes back from 3D Secure authentication.
    "apply3DSecure" => 1 ,//"Disable", // 
    'returnUrl' => $returnUrl,
]);

$responseMessage = $requestMessage->send();
echo "<pre>"; print_r($responseMessage);

And getting error "The BillingCountry value is invalid." in response.
I have tried in proxy as well and IP is of US but still getting the same error.

@judgej
Copy link
Member

judgej commented Oct 21, 2022

The billingCountry should be a part of the CreditCard object. The full billing address, and shipping address is on the card. Documented here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants