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";
}
Related
I am making an app like Uber. I want to pay employees every start of week. but i don't have any idea about it. Every week the system will calculate and pay the driver's salary.
With the Bank information submitted by the customer, I transferred money from the customer to the admin, but I don't know how to pay the driver's salary.o the customer.
This my code
// account test
$bank = $stripe->tokens->create([
'bank_account' => [
'country' => 'US',
'currency' => 'usd',
'account_holder_name' => 'Jenny Rosen',
'account_holder_type' => 'individual',
'routing_number' => '110000000',
'account_number' => '000123456789',
],
]);
// create account
$account = \Stripe\Account::create(
array(
"country" => "US",
'type' => 'custom',
'capabilities' => [
'card_payments' => [
'requested' => true,
],
'transfers' => [
'requested' => true,
],
],
'external_account' => $bank->id
)
);
$re = $stripe->transfers->create([
'amount' => 400,
'currency' => 'usd',
'destination' => $account->id,
'transfer_group' => 'ORDER_95',
]);
return $re;
Error response:
"Your destination account needs to have at least one of the following capabilities enabled: transfers, legacy_payments".
How to pay employee via Stripe. Please help me !
I've been getting this error from omnipay bridge whenever I try to capture credit card payment:
Credit card details has to be set explicitly or there has to be an action that supports ObtainCreditCard request.
Here's my code:
//...
$payum = (new PayumBuilder())
->addDefaultStorages()
->addGateway('paymentexpress_pxpost', ['factory' => 'omnipay_paymentexpress_pxpost', 'username' => 'some_username', 'password'=>'some_password'])
->getPayum();
$card = [
'number' => $request->input('cc_number'),
'expiryMonth' => $request->input('expiry_month'),
'expiryYear' => $request->input('expiry_year'),
'cvv' => $request->input('cvv'),
'name' => $request->input('card_name')
];
$payment = new ArrayObject(['amount' => '1.00', 'currency' => 'AUD', 'card' => $card]);
if ($reply = $payum->getGateway('paymentexpress_pxpost')->execute(new Capture($payment), true)) {
// convert reply to http response
}
//...
The ->execute() function is the one that throws an error. I also referred to the same issue from Error: Credit card details has to be set explicitly or there has to be an action that supports ObtainCreditCard request.
Why do you create a new payum builder instead of using the one from laravel package. The one from package have some additional stuff set (like obtain credit card action).
Accoding to the docs you should do something like this
App::resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) {
$payumBuilder
->addGateway('paymentexpress_pxpost', [
'factory' => 'omnipay_paymentexpress_pxpost',
'username' => 'some_username',
'password'=>'some_password'
])
;
});
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.
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
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);