Comments (14)
Will do, although they aren't the fastest cats :)
Awesome package btw 👍
from revolut-php.
Hi, great that you're using this package.
The response itself is parsed automatically as an array.
So your variable $counterparty
will be an array that has the following information:
https://revolutdev.github.io/business-api/#add-revolut-counterparty
I would wrap this code in a try / catch block though.
from revolut-php.
Apologies this is within a try /catch
try {
$pay = new Revolut($this->api_key);
$counterparty = $pay->counterparties->create(
array (
'company_name' => user()->companies()->first()->name,
'bank_country' => 'GB',
'currency' => 'GBP',
'account_no' => $request->account_no,
'sort_code' => $request->sort_code,
"email" => user()->email,
"phone" => user()->tel,
'profile_type' => 'business',
'address' =>
array (
'street_line1' => user()->companies()->first()->address_line_1,
'street_line2' => user()->companies()->first()->address_line_2,
'region' => '',
'postcode' => user()->companies()->first()->postcode,
'city' => user()->companies()->first()->city,
'country' => 'GB',
),
)
);
} catch (Exception $e) {
\Log::info($e);
return response()->json(['message' => 'There was something wrong, please try again.', 404]);
}
So $pay
as the array in, but once this is sent to Revolut I want to get their response to I can save the successful creation details.
from revolut-php.
What do you get when you do print_r($counterparty);
after this call?
from revolut-php.
Nothing it seems.... :(
from revolut-php.
Seems there's an error either my end or theirs:
POST https://b2b.revolut.com/api/1.0/counterparty` resulted in a `400 Bad Request` response: {"message":"Sort code is in invalid format","code":4002}
Even though sending within the array like so "sort_code" => "$request->sort_code",
from revolut-php.
The sort_code parameter should be a string like "223344".
Are you including any hyphens maybe? "22-33-44" should be posted as "223344"
from revolut-php.
Yeah just posting as "000000"
from revolut-php.
Can you get a full request body / headers which is giving you this error?
Please check that you omit any sensitive data such as API Keys.
Otherwise I suggest to contact Revolut for Business directly.
from revolut-php.
Yeah API keys everything looks good as I did when I tested it before, so I will contact them directly.
from revolut-php.
Ok, do update the issue here if you hear back, thanks!
from revolut-php.
Was Revolut able to solve your issue? Anything specific to the package?
from revolut-php.
Nope, to be honest they were lacking in these areas shall we say. Also it appears they don't do what we wanted it to do, so for now at least we are staying with Stripe.
from revolut-php.
PS, the package is fine, just Revolut not so...
from revolut-php.
Related Issues (17)
- Revolut API ignores "type" queryFilter for Transactions
- Problem with access to the account HOT 16
- Incorrect Request HOT 2
- Merchant API beta
- Token issue HOT 1
- counterparties->create does not work HOT 2
- create-payment: Required 'profile id' is missing HOT 4
- Guzzle 7 HOT 2
- Won't install above PHP 7.0
- Payment /pay authorization problem HOT 1
- Class "Lcobucci\JWT\Configuration" not found
- Problem with access to the account
- Authentication Error
- {"message":"Required 'payments' is missing","code":2101} HOT 4
- New version of this package, help needed? HOT 3
- Disabled API key => new authentication via OAuth HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from revolut-php.