Index: grails-app/controllers/com/lemans/payment/ApiV1PaymentProfileController.groovy =================================================================== diff -u -re72864e6ccc7d874f25bc1aca95fb2c1e47d3d06 -r54a36db7b49411724ab12533916d1916fec38bfe --- grails-app/controllers/com/lemans/payment/ApiV1PaymentProfileController.groovy (.../ApiV1PaymentProfileController.groovy) (revision e72864e6ccc7d874f25bc1aca95fb2c1e47d3d06) +++ grails-app/controllers/com/lemans/payment/ApiV1PaymentProfileController.groovy (.../ApiV1PaymentProfileController.groovy) (revision 54a36db7b49411724ab12533916d1916fec38bfe) @@ -362,6 +362,87 @@ } /** + * @descshort Post the failed profile to D365 + * @headers pfLoggedInDealerCode (Platform Only), pfLoggedInUserName (Platform Only) + * @note + * Platform to send pfLoggedInDealerCode and pfLoggedInUserName for audit purposes and to check the rights of the loggedInDealer + * @samplein for URL : ../mediator-service/api/v2/dm/16/dealer/DUT007/paymentProfile/ + * {code} + * { + * "token": "ZWUwYjVlY2I0MGY0MjRlYzZiOGE5YmQ2MGFlYmNkNDA=", + * "hpfToken": "hpfToken", + * "encKey": "encKey", + * "billingName": "Rayudu", + * "billingAddress1": "123 Test St.", + * "billingAddress2": null, + * "billingCity": "Somewhere", + * "billingState": "CA", + * "billingPostalCode": "90001", + * "billingCountry": "US", + * "dealerCode": "DUT007", + * "phoneNumber": "", + * "emailAddress": "", + * } + * {code} + * @sampleout + * {code} + * { + * "results": { + * "paymentProfileId": 98, + * "customerId": "DUT007_VRAMISETTI_GICW", + * "billingId": "50FV91", + * "dealerCode": "DUT007", + * "dealerName": "DUTCHESS REC VEHICLE INC", + * "userName": "VRAMISETTI", + * "profileTypeId": 10001, + * "profileTypeCode": "P", + * "profileTypeDescr": "Personal", + * "customerName": "RAYUDU", + * "creditCardTypeId": 37001, + * "creditCardTypeCode": "VS", + * "creditCardTypeDisplay": "Visa", + * "creditCardLastFour": "1111", + * "expirationMonth": "04", + * "expirationYear": "2019", + * "creditCardExpired": 2, + * "profileStatus": "EXPIRED", + * "billingName": "Rayudu", + * "billingAddress1": "123 Test St.", + * "billingAddress2": null, + * "billingCity": "Somewhere", + * "billingState": "CA", + * "billingPostalCode": "90001", + * "billingCountry": "US", + * "emailAddress": null, + * "phoneNumber": null, + * "lemansRestricted": false, + * "mainframeCreateDate": "2019-12-16T09:09:49", + * "dateInactivated": null, + * "inactivatedBy": null, + * "dateCreated": "2019-12-16T09:09:49", + * "createdBy": "INSIDE\\HELPDESK", + * "lastUpdated": "2019-12-16T09:09:49", + * "lastUpdatedBy": "INSIDE\\HELPDESK", + * "version": 0 + * } + * } + * {code} + * @permission permission_16_accounts.profiles.view, permission_16_accounts.profiles.edit + * @service Payment-Service-V1 + * @group Profiles + * @http POST + */ + @TargetEndPointMapping(value='/$customerId', method= RequestMethod.POST) + @Secured(closure = { + ctx.securityService.loggedInWithDomainAndHasAnyPermissions(16, ['permission_16_accounts.profiles.edit']) + }) + def postFailedProfileToD365() { + renderPaymentV2("/dm/$params.dm/dealer/$params.dealerCode/payment/profile/$params.customerId") + } + + + + /** * @descshort Update profile of a Dealer by customerId. * @headers pfLoggedInDealerCode (Platform Only), pfLoggedInUserName (Platform Only) * @note