Use Laravel Routes #84
mtvbrianking
announced in
Announcements
Replies: 2 comments
-
use Illuminate\Support\Facades\Route;
$mtnMomoBaseUri = parse_url(env('MTN_MOMO_API_BASE_URI', 'https://ericssonbasicapi2.azure-api.net/'));
Route::group([
'schema' => $mtnMomoBaseUri['scheme'],
'domain' => $mtnMomoBaseUri['host'],
'as' => 'mtn_momo.',
], function () {
Route::group(['prefix' => '/v1_0', 'as' => 'provisioning.'], function () {
Route::post('/apiuser')->name('register_app_user');
Route::get('/apiuser/{clientId}')->name('get_app_user');
Route::post('/apiuser/{clientId}/apikey')->name('generate_api_key');
});
Route::group(['prefix' => '/collection', 'as' => 'collection.'], function () {
Route::post('/token/')->name('get_token');
Route::post('/v1_0/requesttopay')->name('request_to_pay');
Route::get('/v1_0/requesttopay/{referenceId}')->name('get_transaction_status');
Route::get('/v1_0/account/balance')->name('get_balance');
Route::get('/v1_0/accountholder/{partyIdType}/{partyId}/active')->name('get_account_holder_status');
Route::get('/v1_0/accountholder/msisdn/{partyId}/basicuserinfo')->name('get_account_holder_info');
});
Route::group(['prefix' => '/disbursement', 'as' => 'disbursement.'], function () {
Route::post('/token/')->name('get_token');
Route::post('/v1_0/transfer')->name('transfer');
Route::get('/v1_0/transfer/{referenceId}')->name('get_transaction_status');
Route::get('/v1_0/account/balance')->name('get_balance');
Route::get('/v1_0/accountholder/{partyIdType}/{partyId}/active')->name('get_account_holder_status');
Route::get('/v1_0/accountholder/msisdn/{partyId}/basicuserinfo')->name('get_account_holder_info');
});
Route::group(['prefix' => '/remittance', 'as' => 'remittance.'], function () {
Route::post('/token/')->name('get_token');
Route::post('/v1_0/transfer')->name('transfer');
Route::get('/v1_0/transfer/{referenceId}')->name('get_transaction_status');
Route::get('/v1_0/account/balance')->name('get_balance');
Route::get('/v1_0/accountholder/{partyIdType}/{partyId}/active')->name('get_account_holder_status');
Route::get('/v1_0/accountholder/msisdn/{partyId}/basicuserinfo')->name('get_account_holder_info');
});
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
POST ericssonbasicapi2.azure-api.net/collection/token ..................................................................... mtn_momo.collection.get_token
GET ericssonbasicapi2.azure-api.net/collection/v1_0/account/balance .................................................... mtn_momo.collection.get_balance
GET ericssonbasicapi2.azure-api.net/collection/v1_0/accountholder/msisdn/{partyId}/basicuserinfo ........... mtn_momo.collection.get_account_holder_info
GET ericssonbasicapi2.azure-api.net/collection/v1_0/accountholder/{partyIdType}/{partyId}/active ......... mtn_momo.collection.get_account_holder_status
POST ericssonbasicapi2.azure-api.net/collection/v1_0/requesttopay .................................................... mtn_momo.collection.request_to_pay
GET ericssonbasicapi2.azure-api.net/collection/v1_0/requesttopay/{referenceId} .............................. mtn_momo.collection.get_transaction_status
POST ericssonbasicapi2.azure-api.net/disbursement/token ................................................................. mtn_momo.disbursement.get_token
GET ericssonbasicapi2.azure-api.net/disbursement/v1_0/account/balance ................................................ mtn_momo.disbursement.get_balance
GET ericssonbasicapi2.azure-api.net/disbursement/v1_0/accountholder/msisdn/{partyId}/basicuserinfo ....... mtn_momo.disbursement.get_account_holder_info
GET ericssonbasicapi2.azure-api.net/disbursement/v1_0/accountholder/{partyIdType}/{partyId}/active ..... mtn_momo.disbursement.get_account_holder_status
POST ericssonbasicapi2.azure-api.net/disbursement/v1_0/transfer .......................................................... mtn_momo.disbursement.transfer
GET ericssonbasicapi2.azure-api.net/disbursement/v1_0/transfer/{referenceId} .............................. mtn_momo.disbursement.get_transaction_status
POST ericssonbasicapi2.azure-api.net/remittance/token ..................................................................... mtn_momo.remittance.get_token
GET ericssonbasicapi2.azure-api.net/remittance/v1_0/account/balance .................................................... mtn_momo.remittance.get_balance
GET ericssonbasicapi2.azure-api.net/remittance/v1_0/accountholder/msisdn/{partyId}/basicuserinfo ........... mtn_momo.remittance.get_account_holder_info
GET ericssonbasicapi2.azure-api.net/remittance/v1_0/accountholder/{partyIdType}/{partyId}/active ......... mtn_momo.remittance.get_account_holder_status
POST ericssonbasicapi2.azure-api.net/remittance/v1_0/transfer .............................................................. mtn_momo.remittance.transfer
GET ericssonbasicapi2.azure-api.net/remittance/v1_0/transfer/{referenceId} .................................. mtn_momo.remittance.get_transaction_status
POST ericssonbasicapi2.azure-api.net/v1_0/apiuser ............................................................... mtn_momo.provisioning.register_app_user
GET ericssonbasicapi2.azure-api.net/v1_0/apiuser/{clientId} ......................................................... mtn_momo.provisioning.get_app_user
POST ericssonbasicapi2.azure-api.net/v1_0/apiuser/{clientId}/apikey .............................................. mtn_momo.provisioning.generate_api_key |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Use Laravel routes to interpret external API routes.
It should be better than using
strtr
Inspiration: 1684993016644128768
Beta Was this translation helpful? Give feedback.
All reactions