Reputation: 616
Experts I have integrated paypal express checkout with ci_merchant and i was using sandbox accounts for testing. It was working fine but suddenly now its is giving response like "You do not have permissions to make this API call". I have goggled and found I need to set api permission and enable express checkout I did it but still the same response. Can anyone help me?
I have tried above link sollution.
here is request array
Array ( [METHOD] => SetExpressCheckout [VERSION] => 85.0
[USER] => takeout_api1.rest.com
[PWD] => 1369227981
[SIGNATURE] => AnOQDpMvzNQqHN5u7vb9BKLaKYLoALq6R0g3ohOwD4RQgO0DQDI5l7V4
[PAYMENTREQUEST_0_PAYMENTACTION] => Authorization
[PAYMENTREQUEST_0_AMT] => 121.00
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_DESC] =>
[SOLUTIONTYPE] => Sole
[LANDINGPAGE] => Billing
[NOSHIPPING] => 1
[ALLOWNOTE] => 0
[RETURNURL] => https://www.mealordering.net/payment/pay/2/265
[CANCELURL] => https://www.mealordering.net/payment/pay/2/265
[PAYMENTREQUEST_0_SHIPTONAME] =>
[PAYMENTREQUEST_0_SHIPTOSTREET] =>
[PAYMENTREQUEST_0_SHIPTOSTREET2] =>
[PAYMENTREQUEST_0_SHIPTOCITY] =>
[PAYMENTREQUEST_0_SHIPTOSTATE] =>
[PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] =>
[PAYMENTREQUEST_0_SHIPTOZIP] =>
[PAYMENTREQUEST_0_SHIPTOPHONENUM] =>
[EMAIL] => )
HERE CONTROLLER NAME IS PAYMENT and paypal and pay methods I am using for making php api or ci-merchant library call
public function paypal($rest_id,$orderid)
{
$this->merchant->load('paypal_express');
$settings = $this->merchant->default_settings();
$settings = array(
'username' => $get_payapl->LoginId,
'password' => $get_payapl->SecretKey,
'signature' => $get_payapl->Signature,
'test_mode' => true,
);
$this->merchant->initialize($settings);
$return_url=site_url('payment/pay/'.$rest_id.'/'.$orderid);
$cancel_url=site_url('payment/pay/'.$rest_id.'/'.$orderid);
$params = array(
'amount' => $payable_amt,
'currency' => $cuurency_code->CurrencyCode,
'return_url' => $return_url,
'cancel_url' => $cancel_url
);
$response = $this->merchant->purchase($params);
}
public function pay($rest_id,$orderid)
{
$this->merchant->load('paypal_express');
settings = $this->merchant->default_settings();
$settings = array(
'username' => $get_payapl->LoginId,
'password' => $get_payapl->SecretKey,
'signature' => $get_payapl->Signature,
'test_mode' => true,
);
$return_url=site_url('payment/pay/'.$rest_id.'/'.$orderid);
$cancel_url=site_url('payment/pay/'.$rest_id.'/'.$orderid);
$params = array(
'amount' => $payable_amt,
'currency' => $cuurency_code->CurrencyCode,
'return_url' => $return_url,
'cancel_url' => $cancel_url
);
$response = $this->merchant->purchase_return($params);//final response this is
if ($response->success())
{
//success message and code
}
else
{
//fail messages and code
}
}
Upvotes: 0
Views: 284
Reputation: 26056
That error typically doesn't happen with Express Checkout unless the account from which you pulled the API credentials is a personal account instead of a business account. Is there a chance you changed the credentials to some other account, and that account is not a business account?
Upvotes: 0