Skip to content

Nglicloud/Djark

Repository files navigation

totum-checkout-service

Resources used

###SSM parameters

1)/spring-config/totumcheckout_test/totumcheckout.datasource.url
2)/spring-config/totumcheckout_test/totumcheckout.datasource.username
3)/spring-config/totumcheckout_test/totumcheckout.datasource.password
4)/spring-config/totumcheckout_test/legacy.authorization.token
5)/spring-config/totumcheckout_test/legacy.create.pay.baseUrl

###SNS

1)Environment-totum-cardproduction-checkoutservice-event

###SQS

1)Environment-totum-isicdata-checkout-service-input
2)Environment-totum-upsummary-service-input (Ups Summary service)
3)Environment-totum-checkout-service-recursive-input
4)Environment-totum-carddetailchange (Shared Infra)
5)Environment-totum-emaildrop (Shared Infra)
6)Environment-totum-finance-trans-queue (Payment Gateway Service)

###mysqldb schema payment_transaction

1) payment_transaction
2) payment_transaction_audit
3) sale_transaction

Endpoints

a) POST /checkout/clientToken :

	Authorization : AWS_IAM

	API Key Required : true

	HTTP Headers :  Name - X-TOTUM-Authorization Mapped from - context.identity.cognitoAuthenticationProvider

	This endpoint is called from the front-end to access the braintree, client token is required which is passed as a response from this API. Internally calls CBS endpoint.

Sample response :
	{"jsonapi":{"version":"1.0"},"data":{"id":"PaymentClientToken-0001","type":"x-nux-checkout-clienttoken-v1.0.0",   "attributes":{"client_token":"token_value"}}}

b) POST /checkout/product :

	Authorization : AWS_IAM

	API Key Required : true

	HTTP Headers :  Name - X-TOTUM-Authorization Mapped from - context.identity.cognitoAuthenticationProvider

	Once the frontend gets nonce from the payment gateway this endpoint is called for payment.
	We create transaction id which is the combination of "upid + product id + current date" and enter the record in payment_transaction table. Initially the payment_staus is IN_PROGRESS.
	Then we create the saleObject which has below checks :
	  -Calls the totum-product-service GET /product/{productid} to get product details
	  --if voucher is applicable we get voucher details from the product call.
	  -checks if the product is new purchase or renewal or replacement
	  -checks if the product has isic included : if yes we call the isic /allocate endpoint to get ISIC /ITIC number
	  -checks if pass is included in the bundle

	Then calls the CBS endpoint POST /api/Sales/Operations/CardProduction
	On success :
	  -if sale is discounted (voucher applied) it calls voucher service to update the voucher status
	  -call to userprofile-service to update user attributes.
	  -if pass included then calls pass-application-service
	  -Async event is published to update the sale_transaction table to record sale information provided by CBS and also update the payment_status as SUCCESS
	  -if isic included then publishes msg to <env>-totum-isicdata-checkout-service-input queue which is listened by isic-service
	  -if renewal card then for refreshing the card the msg is published in <env>-totum-carddetailchange queue
	  -Email message is published to <env>-totum-emaildrop Queue which is listened by totum-email-service to inform user   about card purchase.

c) POST /checkout/pass-app-conclude : This endpoint is called from pass-application-service to call card production on pass final status.

d) POST /checkout/product/{upid} : This endpoint is called from pass-application-service when we have to Reset PASS journey for rejected users from Admin.

SQS

  1. -totum-checkout-service-recursive-input : Checkout service publishes a message when there is a duplicate payment. And checkout itself has a code to listen to this queue.This then logs duplicate payment data in the db.

  2. -totum-upsummary-service-input : Checkout service listens to this queue. totum-user-profile-summary-service publishes a message to this queue when user's pass is rejected. Then internally calls CBS POST /api/Sales/Operations/PASSFinalisation endpoint.

  3. -totum-isicdata-checkout-service-input : If isic/itic included in the product purchased by the user then checkout service publishes msg to this queue, which is listened by nux-isic-registration-service

  4. -totum-carddetailchange : Publishes a message to Refresh cards in case of renewals and when the user pass application gets approved.

  5. -totum-emaildrop : Publishes a message to this queue, which is listened by totum-email-service which triggers email to inform the user about card purchase/pass application status. Sample message body- { "jsonapi": { "version": "1.0" }, "data": { "id": "432c964e", "type": "x-mail-dispatch-ticket-v1.0.0", "attributes": { "duration": "1", "firstName": "Will", "lastName": "Smith", "amount": "14.99", "messageType": "card-payment-v1.0.0", "deliveryAddress": "Campus Shop ,Library Building, Long Street,IP4 1QJ", "instruction": "You will be able to collect your card from Campus Shop ,Library Building, Long Street,IP4 1QJ in 7 days.", "recipientAddr": "int_reg1@mailinator.com", "reference_number": "6tf0tsp5", "passPresent": "false", "productName": "TOTUM 1 year with ISIC", "products": "TOTUM discounts,ISIC membership (digital only)" } } }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published