Updating Payment Info using API
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Updating Payment Info using API
Hi Everyone,
I'm new to aimeos, and I'm using aimeos laravel package as the backend. I'm developing the frontend using react native, so that I can use it for both web and mobile.
My payment gateway is javascript based, once the payment gateway returns the status, i need to update the payment status in aimeos using an API. I have gone through the API documentation but couldn't find a way to update the payment status.
My environment: Laravel 5.5, PHP 7.1.5, Aimeos 2017.10
Kindly let me know how to proceed further.
Thanks in Advance.
I'm new to aimeos, and I'm using aimeos laravel package as the backend. I'm developing the frontend using react native, so that I can use it for both web and mobile.
My payment gateway is javascript based, once the payment gateway returns the status, i need to update the payment status in aimeos using an API. I have gone through the API documentation but couldn't find a way to update the payment status.
My environment: Laravel 5.5, PHP 7.1.5, Aimeos 2017.10
Kindly let me know how to proceed further.
Thanks in Advance.
Re: Updating Payment Info using API
The JSON REST API doesn't currently have an endpoint for updating the order payment status. The main problem is: How can you update the payment status in a secure way without enabling attackers to update the status to any value theirselves?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Updating Payment Info using API
The best and most secure way to update the payment status in your setup is to pass the notification (update) URL to the payment gateway and use the returned payment status only for displaying it to the customer. The payment gateway will send a "server to server" notification with the payment status at the same time and will update the status value in the database.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Updating Payment Info using API
Thanks for your suggestion. I have checked the database tables, "mshop_order" is the table having the info about the payment status, is it enough to update this table or I need to update any other tables as well. Is there any predefined class / method available to update the payment status.
Re: Updating Payment Info using API
You should always use the order controller to update the order items:
https://aimeos.org/api/latest/class-Aim ... ndard.html
https://aimeos.org/api/latest/class-Aim ... ndard.html
Code: Select all
$cntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'order' );
$item = $cntl->getItem( $id, false );
$item->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_RECEIVED );
$cntl->saveItem( $item );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star