I currently have a fully working cart and checkout process through PayPal _xcart method, but I want to migrate it to REST API, mainly because I want to mitigate the possibility of price-jacking. Currently my IPN does check for price jack and sets the according flags so the product doesn’t get downloaded…
Tag: rest
Yii2 CORS with Auth not working for non CRUD actions
I am building an API in Yii2 and have added CORS and authentication. This works fine for all Create/Read/Update/Delete actions but not for custom actions. Has anyone experienced this before? URL …
Laravel 5 Eloquent appending relationships to JSON on multiple levels
So it is pretty easy to include relationships on models such as: when there’s a get request to the user resource, it will include associated roles automagically. But in this setup, the role resources returned with user resource also includes it’s own included relationships like: This generates hug…
paypal sdk ‘Class ‘PayPalRestApiContext’ not found’
I’m trying to implement paypal api sdk using this code require(‘vendor/autoload.php’); use PayPalRestApiContext; use PayPalAuthOAuthTokenCredential; $api = new ApiContext( new …
ZF2 Apigility Rest – unable to get multiple params
I’m using Apigility to build my Rest APIs. I want to build have the ability to take in multiple parameters. Such as http://mydomain.com/users/1/activities/4 I now this is possible from this page: https://github.com/zfcampus/zf-apigility/issues/10 I have edit my module route to: ‘route’ =>…
What is a “Payload”? e.g XML Payload
While browsing some web service docs, I came across the word “payload”, “xml payload” … From wikipedia: “*Payload in computing (sometimes referred to as the actual or body data) is the cargo of a …
How to pass custom header to RESTful call?
There are some web service APIs that I need to connect to for my website. Most of the APIs involve something like this: But one web service requires the API key to be set in a custom HTTP header. How do I make the request to this API url and pass the custom header at the same time? Answer You
Call a REST API in PHP
Our client had given me a REST API to which I need to make a PHP call. But as a matter of fact, the documentation given with the API is very limited, so I don’t really know how to call the service. I’ve tried to Google it, but the only thing that came up was an already expired Yahoo! tutorial
PHP multipart form data PUT request?
I’m writing a RESTful API. I’m having trouble with uploading images using the different verbs. Consider: I have an object which can be created/modified/deleted/viewed via a post/put/delete/get request to a URL. The request is multi part form when there is a file to upload, or application/xml when …
RESTful API methods; HEAD & OPTIONS
I’m writing a RESTful API module for an application in PHP, and I’m a bit mixed on the verbs HEAD and OPTIONS. OPTIONS Used to retrieve the available HTTP verbs for a given resource? HEAD Used to determine whether a given resource is available? If someone could clarify* these verbs, that would be…