Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A wrapper for the Ramp API

NotificationsYou must be signed in to change notification settings

r0aringthunder/ramp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Available services

Publishing the ramp config

Command

php artisan vendor:publish --tag=rampapi-config

publishedconfig/ramp.php

<?phpreturn ['client_id' =>env('RAMP_CLIENT_ID','your_client_id'),'client_secret' =>env('RAMP_CLIENT_SECRET','your_client_secret'),'prod_ready' =>env('PROD_READY',false),'scopes' =>env('RAMP_SCOPES','accounting:read accounting:write bills:read business:read cards:read cards:write cashbacks:read departments:read departments:write entities:read leads:read leads:write limits:read limits:write locations:read locations:write memos:read merchants:read receipt_integrations:read receipt_integrations:write receipts:read reimbursements:read spend_programs:read spend_programs:write statements:read transactions:read transfers:read users:read users:write'),];

Examples

Fetching a list of users

useR0aringthunder\RampApi\Ramp;publicfunctionrampUsers(){$ramp =newRamp();$users =$ramp->users->listUsers();returnresponse()->json($users);}

Fetching all cards

useR0aringthunder\RampApi\Ramp;publicfunctionfetchCards(){$ramp =newRamp();$cards =$ramp->cards->listCards();returnresponse()->json($cards['data']);}

Fetching a single card

useR0aringthunder\RampApi\Ramp;publicfunctionfetchCard(){$ramp =newRamp();$card =$ramp->cards->fetchCard('[CARD ID]');returnresponse()->json($card);}

Important

At the time of implementation the API and Ramp dashbaord take approximately 5 minutes to sync but the API reacts immediately to changes

Important

The only file types accepted by Ramp arepng, webp, heif, pdf, heic, jpg, jpeg

Uploading a receipt to a transaction

useR0aringthunder\RampApi\Ramp;useIlluminate\Http\Request;publicfunctionuploadReceipt(Request$request){$ramp =newRamp();$file =$request->file('receipts');$path =$file->getRealPath();return$ramp->receipts->upload(      ['user_id' =>$request->input('ramp_user_id'),'transaction_id' =>$request->input('ramp_transaction_id'),      ],$path  );}

Tip

On$path you can use an uploaded file or a link to a file (Ex. an S3 link)

More exmaples coming...


[8]ページ先頭

©2009-2025 Movatter.jp