CodeIgniter Payments Getting a Success Response but not Working - codeigniter

I'm using CodeIgniter Payments to integrate with the Paypal API. I believe I am calling the right methods because I'm getting a response of "Success" but I don't see the transaction in the Sandbox. When I use the sample DoDirectPayment file from Paypal I complete the transaction and I can see it in the sandbox.
Here is my code using CodeIgniter Payments:
//load the payment library
$this->load->spark('codeigniter-payments/0.1.4/');
//configure the parameters for the payment request
$paymentParameters = array(
'cc_type' => 'foo',
'cc_number' => 'foo',
'cc_exp' => 'foo',
'first_name' => 'foo',
'last_name' => 'foo',
'street' => 'foo',
'street2' => 'foo',
'city' => 'foo',
'state' => 'foo',
'country' => 'foo',
'postal_code' => 'foo',
'amt' => 'foo',
'currency_code' => 'USD'
);
//make the call
$paymentResponse = $this->payments->oneoff_payment('paypal_paymentspro', $paymentParameters);
//print the response
print_r($paymentResponse);
Here is the response:
stdClass Object
(
[type] => gateway_response
[status] => Success
[response_code] => 100
[response_message] => The authorization was successful.
[details] => stdClass Object
(
[gateway_response] => stdClass Object
(
[TIMESTAMP] => 2012-05-22T19:18:17Z
[CORRELATIONID] => 7939eeaa6c0c0
[ACK] => Success
[VERSION] => 66.0
[BUILD] => 2929894
[AMT] => 20.89
[CURRENCYCODE] => USD
[AVSCODE] => X
[CVV2MATCH] => M
[TRANSACTIONID] => 4RS01101TL8204042
)
[timestamp] => 2012-05-22T19:18:17Z
[identifier] => 4RS01101TL8204042
)
)

You can just switch into using other Paypal libraries. It might save you time than figuring out this problem. http://codeigniter.com/wiki/PayPal_Lib

I had this problem too.
In my case, I did not set my config driver correctly and it ended up sending all my transactions to Calvin's (Author's) default paypal sandbox account.
Double check to make sure that your API tokens are set correctly with:
$gateway_name = 'paypal_paymentspro';
$params = array(
'identifier' => *Your transaction ID from above*
);
$response = $this->payments->get_transaction_details($gateway_name, $params);
print_r($results);
Also, if you don't want to set the driver and want to do everything from your PHP file, you can always pass in your API tokens like so:
$gateway_name = 'paypal_paymentspro';
$params = array(
'identifier' => *Your transaction ID from above*
);
$config['api_username'] = *Your api username*;
$config['api_password'] = *Your api password*;
$config['api_signature'] = *Your sig*;
$response = $this->payments->get_transaction_details($gateway_name, $params);
print_r($results);

Related

paymenwall gateway integration with laravel 5.1

I tried to implement paymentwall gateway with laravel 5.1 using omnipay.But there is no exact documentation or sample codes available.Is there any implementation samples available for omnipay paymentwall integration with laravel.
There is documentation including usage examples in the class header files for the omnipay-paymentwall library.
Example
// Create a gateway for the PaymentWall REST Gateway
// (routes to GatewayFactory::create)
$gateway = Omnipay::create('PaymentWall');
// Initialise the gateway
$gateway->initialize(array(
'apiType' => $gateway::API_GOODS,
'publicKey' => 'YOUR_PUBLIC_KEY',
'privateKey' => 'YOUR_PRIVATE_KEY',
));
// Create a credit card object
// This card can be used for testing.
$card = new CreditCard(array(
'firstName' => 'Example',
'lastName' => 'Customer',
'number' => '4242424242424242',
'expiryMonth' => '01',
'expiryYear' => '2020',
'cvv' => '123',
'email' => 'customer#example.com',
'billingPostcode' => '4999',
));
// Do a purchase transaction on the gateway
$transaction = $gateway->purchase(array(
'amount' => '10.00',
'accountId' => 12341234,
'currency' => 'AUD',
'clientIp' => '127.0.0.1',
'packageId' => 1234,
'description' => 'Super Deluxe Excellent Discount Package',
'fingerprint' => '*token provided by Brick.js*',
'browserDomain' => 'SiteName.com',
'card' => $card,
));
$response = $transaction->send();
if ($response->isSuccessful()) {
echo "Purchase transaction was successful!\n";
$sale_id = $response->getTransactionReference();
echo "Transaction reference = " . $sale_id . "\n";
}

Codeigniter[Angelleye library]: "Receiver PayPal accounts must be unique" error

I have used angelleye/paypal-codeigniter API for implementing the Paypal Adaptive Payment in my Codeigniter Project.
I have the similar setup like that of https://ci.angelleye.com/paypal/samples/demo/ ON MY LOCALHOST
I have developer paypal account which has 2 merchant sandbox account and one sender sandbox account.While payment I am transferring the funds from sender to 2 receivers.
On my localhost I clicked on the link of Adaptive Payment from the three libraries(Payments Pro , Adaptive Payments,PayFlow) mentioned on that page. Everything was working fine till some time back.
But unfortunately now on click of Adaptive Payment link I am getting following errors in $PayPalRequestData as RESPONSE:
Array
(
['Errors'] => array(
[0] => Array
(
[Receiver] =>
[Category] => Application
[Domain] => PLATFORM
[ErrorID] => 579040
[ExceptionID] =>
[Message] => Receiver PayPal accounts must be unique.
[Parameter] => receiver
[Severity] => Error
[Subdomain] => Application
)
[Ack] => Failure
[Build] => 20420247
[CorrelationID] => 581ecdae58e50
[Timestamp] => 2016-03-04T01:41:05.725-08:00
[PayKey] =>
[PaymentExecStatus] =>
[RedirectURL] =>
[XMLRequest] => <displayed request string>
[XMLResponse] => <displayed response string>
)
Array
(
['Errors'] => array(
[0] => Array
(
[Receiver] =>
[Category] => Application
[Domain] => PLATFORM
[ErrorID] => 579017
[ExceptionID] =>
[Message] =>The amount for the primary receiver must be greater than
or equal to the total of other chained receiver amounts
[Parameter] => receiver
[Severity] => Error
[Subdomain] => Application
)
[Ack] => Failure
[Build] => 20420247
[CorrelationID] => d85cb50b00e2e
[Timestamp] => 2016-03-04T01:46:01.853-08:00
[PayKey] =>
[PaymentExecStatus] =>
[RedirectURL] =>
[XMLRequest] => <displayed request string>
[XMLResponse] => <displayed response string>
)
The REQUEST I sent is
$Receiver = array(
'Amount' = '12.00',
'Email' = 'receiver_1#domain.com',
'InvoiceID' = '123-ABCDEFG',
'PaymentType' = 'SERVICE',
'PaymentSubType' = '',
'Phone' = array('CountryCode' = '', 'PhoneNumber' = '',
'Extension' = ''),
'Primary' = 'true'
);
$Receiver = array(
'Amount' = '5.00',
'Email' = 'receiver_2#domain.com',
'InvoiceID' = '123-ABCDEFG',
'PaymentType' = 'SERVICE',
'PaymentSubType' = '',
'Phone' = array('CountryCode' = '', 'PhoneNumber' = '',
'Extension' = ''),
'Primary' = 'true'
);
Can someone please tell me what there errors are? and how to solve those errors.

What is the Scope for using Google API Directory Services

I am already using a number of Google API services, such as Calendar and Google+ profiles, but using the Directory services is proving difficult.
Here is the scope I'm declaring in my local_config - everything has been working until I added the final line...
// Definition of service specific values like scopes, oauth token URLs, etc
'services' => array(
'analytics' => array('scope' => 'https://www.googleapis.com/auth/analytics.readonly'),
'calendar' => array(
'scope' => array(
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly",
)
),
'books' => array('scope' => 'https://www.googleapis.com/auth/books'),
'latitude' => array(
'scope' => array(
'https://www.googleapis.com/auth/latitude.all.best',
'https://www.googleapis.com/auth/latitude.all.city',
)
),
'moderator' => array('scope' => 'https://www.googleapis.com/auth/moderator'),
'oauth2' => array(
'scope' => array(
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email',
)
),
'plus' => array('scope' => 'https://www.googleapis.com/auth/plus.login'),
'siteVerification' => array('scope' => 'https://www.googleapis.com/auth/siteverification'),
'tasks' => array('scope' => 'https://www.googleapis.com/auth/tasks'),
'urlshortener' => array('scope' => 'https://www.googleapis.com/auth/urlshortener'),
'directory' => array('scope' => 'https://www.googleapis.com/auth/admin')
I have tried a few different combos, but nothing seems to work - here is the error I'm getting...
Some requested scopes were invalid.
{valid=[https://www.googleapis.com/auth/tasks,
https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/calendar.readonly, https://www.googleapis.com/auth/userinfo.profile,
https://www.googleapis.com/auth/userinfo.email], invalid=[https://www.googleapis.com/auth/admin]}
I'm trying to pull Group listings at the moment, but I'll need other Admin sdk features later.
Thanks! Let me know if I need to add any more details.
Admin SDK scopes are listed at:
https://developers.google.com/admin-sdk/directory/v1/guides/authorizing

How to get the custom values and image in Magento in Topmenu?

I'm using magento 1.7.0.2. I have add the custom value in database. But how to retrive the custom value and image in Topmanu. I have tried in below mentioned code in the palce of 'my_attribute' to replace my attribute, but i din't get the result.
Model: Mage_Catalog_Model_Observer
Method: _addCategoriesToMenu()
$categoryData = array(
'name' => $category->getName(),
'id' => $nodeId,
//'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
'is_active' => $this->_isActiveMenuCategory($category),
'my_attribute' => $category->getData('my_attribute') // Add our data in...
);
When i print the array i'll get this,
Array ( [name] => Matelas [id] => category-node-31 [is_active] => 1 [my_attribute] => )
Can any one guide me, Thanks in advance...
I am guessing you mean you have added a new custom attribute to the Category entity?
Becuase you are dealing with a Node_collection the full category object won't be loaded, try loading the full object to get what you're after:
$cat = Mage::getModel('catalog/category')->load($category->getId());
$categoryData = array(
name' => $category->getName(),
'id' => $nodeId,
//'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
'is_active' => $this->_isActiveMenuCategory($category),
'my_attribute' => $cat->getData('my_attribute') // Add our data in...
);

How to debug CI-Merchant Paypal Pro integration?

I'm trying to use the CI-Merchant library for integrating Paypal Pro (Direct Payment) and I am lost..
I have setup a UK sandbox (both a seller account preconfigured with paypal pro, and a buyer account with the info below ($params array)
Here is the response I'm getting (status failed, no message) along with the $params array I am using:
Merchant_response Object
(
[_status:protected] => failed
[_message:protected] =>
[_reference:protected] =>
[_data:protected] =>
[_redirect_url:protected] =>
[_redirect_method:protected] => GET
[_redirect_message:protected] =>
[_redirect_data:protected] =>
)
Array
(
[card_type] => Visa
[card_no] => 4269072658337891
[first_name] => Buyer
[last_name] => One
[address1] => 1 Main Terrace
[city] => Wolverhampton
[region] => West Midlands
[postcode] => W12 4LQ
[amount] => 10
[currency] => GBP
[country] => UK
)
And here is the code:
$this->load->library('merchant');
$this->merchant->load('paypal_pro');
$settings = array(
'username' => '***',
'password' => '***',
'signature' => '***',
'test_mode' => true);
$this->merchant->initialize($settings);
//params array is set through a form submit.
$response = $this->merchant->purchase($params);
echo '<pre>';
print_r($response);
print_r($params);
exit;
Please let me know how to to debug this!
Thank you,
Georges
after this code
$this->load->library('merchant');
$this->merchant->load('paypal_pro');
you need to initialize
$settings = $this->merchant->default_settings();
and bingo

Resources