Changes for page Vipps direct API
Last modified by Asbjørn Ulsberg on 2019/07/11 15:00
From version 80.3
edited by Fredrik Köhler
on 2018/10/03 15:00
on 2018/10/03 15:00
To version 80.4
edited by Fredrik Köhler
on 2018/10/04 16:57
on 2018/10/04 16:57
Change comment: There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -2,10 +2,10 @@ 2 2 3 3 Vipps is a two-phase payment method supported by the major norwegian banks. In the direct API scenario, PayEx receives a mobile number (MSISDN) directly from the merchant UI. PayEx performs a payment that the consumer must confirm in the Vipps mobile app. 4 4 5 -* When the consumer/end-user starts the purchase process, you make a POST request towards PayEx with the collected P URCHASEinformation.6 -* After that, you need to collect the consumer's mobile number and make a POST request towards PayEx. 5 +* When the consumer/end-user starts the purchase process, you make a {{code}}POST{{/code}} request towards PayEx with the collected ##Purchase## information. 6 +* After that, you need to collect the consumer's mobile number and make a {{code}}POST{{/code}} request towards PayEx. 7 7 * PayEx will handle the dialogue with Vipps and the consumer will have to confirm the purchase in the Vipps app. 8 -* Finally you will receive a payment callback when the Vipps dialogue is completed, and you will have to make a GET 8 +* Finally you will receive a payment callback when the Vipps dialogue is completed, and you will have to make a {{code}}GET{{/code}}request to check the payment status. 9 9 * The flow is explained in the picture below: 10 10 11 11 [[image:Vipps_flow_directAPI.png||width="850"]] ... ... @@ -14,22 +14,24 @@ 14 14 15 15 The API-requests are displayed in the sequence diagram below. 16 16 17 -**IMPORTANT:** //Please make sure to use the complete URI's that are returned in the JSON object from the specific request you make. If you parse any content and include it in your local stored URI's - you risk breaking compability when PayEx release future updates.//17 +**IMPORTANT:** **Please make sure to use the complete URI's that are returned in the JSON object from the specific request you make. If you parse any content and include it in your local stored URI's - you risk breaking compability when PayEx release future updates.** 18 18 19 19 The general rest-based API model are described in the[[ API Reference & Technical Information>>doc:Main.ecommerce.technical-reference.WebHome]]. 20 20 21 -(% id="HOptions" %) 22 -== Options == 21 +(% id="HOptionsbeforepostingapayment" %) 22 +=== Options before posting a payment === 23 23 24 -All valid options when posting ina payment with##operation##equal to##Purchase##, are described in [[the technical reference>>doc:Main.ecommerce.technical-reference.vipps-payments.WebHome]].24 +All valid options when posting a payment with operation equal to Purchase, are described in [[the technical reference>>https://developer.payex.com/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/viabill-payments/]]. 25 25 26 -* Authorization (two-phase): 27 -** The ##intent## of a Vipps ##purchase## is always ##Authorization##. The amount will be reserved but not charged. You will later (i.e. when you are ready to ship the purchased products) have to make a [[Capture>>doc:Main.ecommerce.technical-reference.vipps-payments.WebHome||anchor="HCaptures"]] or [[Cancel>>doc:Main.ecommerce.technical-reference.vipps-payments.WebHome||anchor="HCancellations"]] request. 28 -* PayEx will [[##POST## a Callback request>>doc:Main.ecommerce.technical-reference.vipps-payments.WebHome||anchor="HCallback"]] to the ##callbackUrl## given when the payment was created, whenever changes to the payment occur. 29 -* It is possible to [[abort a payment>>doc:Main.ecommerce.technical-reference.vipps-payments.WebHome||anchor="HAbort"]] if the payment has no successful transactions. 26 +(% id="HTypeofauthorization28Intent29." %) 27 +==== Type of authorization (Intent). ==== 30 30 31 -== Sequence diagrams == 29 +* **Authorization (two-phase)**: The intent of a Vipps purchase is always ##Authorization##. The amount will be reserved but not charged. You will later (i.e. if a physical product, when you are ready to ship the purchased products) have to make a [[Capture>>https://developer.payex.com/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCaptures]] or [[Cancel>>https://developer.payex.com/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCancellations]] request. 30 +* **Callback from PayEx:** Whenever changes to the payment occur a [[Callback request>>https://developer.payex.com/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCallback]] will be posted to the callbackUrl, generated when the payment was created. 31 +* **Abort:** It is possible to [[abort a payment>>https://developer.payex.com/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HAbort]] if the payment has no successful transactions. 32 32 33 +== Payment flow == 34 + 33 33 The sequence diagram below shows the two requests you have to send to PayEx to make a purchase. The links will take you directly to the API description for the specific request. 34 34 35 35 {{plantuml}} ... ... @@ -66,8 +66,8 @@ 66 66 end box 67 67 68 68 Participant Merchant 69 -Participant P AYEX.FRONTEND70 -Participant P AYEX.BACKEND71 +Participant PayEx.FrontEnd 72 +Participant PayEx.BackEnd 71 71 participant Vipps.API 72 72 'participant TSP 73 73 ... ... @@ -75,22 +75,22 @@ 75 75 Browser -> Merchant: start purchase (pay with VIPPS) 76 76 Activate Merchant 77 77 78 -Merchant -> P AYEX.FRONTEND: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCreate Vipps payments]]80 +Merchant -> PayEx.FrontEnd: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCreate Vipps payments]] 79 79 note left: First API request 80 -Activate P AYEX.FRONTEND81 -P AYEX.FRONTEND--> Merchant: payment resource82 -Deactivate P AYEX.FRONTEND82 +Activate PayEx.FrontEnd 83 +PayEx.FrontEnd --> Merchant: payment resource 84 +Deactivate PayEx.FrontEnd 83 83 Merchant --> Browser: Collect mobile number in UI 84 84 Browser -> Browser: Enter mobile number 85 85 Browser -> Merchant: Mobile number 86 -Merchant -> P AYEX.FRONTEND: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HAuthorizations Vipps authorizations]]88 +Merchant -> PayEx.FrontEnd: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HAuthorizations Vipps authorizations]] 87 87 note left: Second API request 88 -Activate P AYEX.FRONTEND89 -P AYEX.FRONTEND-> Vipps.API: Initialize Vipps payment90 +Activate PayEx.FrontEnd 91 +PayEx.FrontEnd -> Vipps.API: Initialize Vipps payment 90 90 Activate Vipps.API 91 -Vipps.API --> P AYEX.FRONTEND: HTTP response92 -'Deactivate P AYEX.FRONTEND93 -P AYEX.FRONTEND--> Merchant: Authorization response (State=AwaitingActivity)93 +Vipps.API --> PayEx.FrontEnd: HTTP response 94 +'Deactivate PayEx.FrontEnd 95 +PayEx.FrontEnd --> Merchant: Authorization response (State=AwaitingActivity) 94 94 Merchant --> Browser: Response (check your phone) 95 95 Deactivate Merchant 96 96 note left: Merchant should wait for [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCallback Vipps Callback]] before proceeding ... ... @@ -99,20 +99,20 @@ 99 99 Vipps.API -> Vipps_App: Confirm Payment UI 100 100 Vipps_App -> Vipps_App: Confirmation Dialogue 101 101 Vipps_App --> Vipps.API: Confirmation 102 -Vipps.API -> P AYEX.BACKEND: make payment103 -activate P AYEX.BACKEND104 -P AYEX.BACKEND-> PAYEX.BACKEND: execute payment105 -P AYEX.BACKEND--> Vipps.API: response104 +Vipps.API -> PayEx.BackEnd: make payment 105 +activate PayEx.BackEnd 106 +PayEx.BackEnd -> PayEx.BackEnd: execute payment 107 +PayEx.BackEnd --> Vipps.API: response 106 106 Deactivate Vipps.API 107 -P AYEX.BACKEND-/ PAYEX.FRONTEND: payment result108 -deactivate P AYEX.BACKEND109 -'Activate P AYEX.FRONTEND110 -P AYEX.FRONTEND-/ Merchant: Payment Callback109 +PayEx.BackEnd -/ PayEx.FrontEnd: payment result 110 +deactivate PayEx.BackEnd 111 +'Activate PayEx.FrontEnd 112 +PayEx.FrontEnd -/ Merchant: Payment Callback 111 111 Activate Merchant 112 -Merchant -> P AYEX.FRONTEND: GET [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments Vipps payments]]114 +Merchant -> PayEx.FrontEnd: GET [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments Vipps payments]] 113 113 note left: Third API request 114 -P AYEX.FRONTEND-->Merchant: Payment resource115 -'Deactivate P AYEX.FRONTEND116 +PayEx.FrontEnd-->Merchant: Payment resource 117 +'Deactivate PayEx.FrontEnd 116 116 Merchant-->Browser: Display purchase result 117 117 Deactivate Merchant 118 118 ... ... @@ -122,8 +122,8 @@ 122 122 == Options after posting a payment == 123 123 124 124 * Be prepared to [[receive a callback from PayEx>>doc:Main.ecommerce.technical-reference.vipps-payments.WebHome||anchor="HCallback"]]. 125 -* V IPPSonly support two-phase transactions (AUTHORIZE), which mean that you must implement the CAPTUREand CANCELrequests.126 -* For reversals, you will need to implement the R EVERSALrequest.127 +* Vipps only support two-phase transactions (##Authorize##), which mean that you must implement the Capture and Cancel requests. 128 +* For reversals, you will need to implement the Reversal request. 127 127 128 128 === Capture Sequence === 129 129 ... ... @@ -159,18 +159,18 @@ 159 159 skinparam NoteFontColor #333333 160 160 161 161 Actor Merchant 162 -Participant P AYEX.FRONTEND163 -Participant P AYEX.BACKEND164 -Merchant->P AYEX.FRONTEND: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCaptures Vipps captures]]164 +Participant PayEx.FrontEnd 165 +Participant PayEx.BackEnd 166 +Merchant->PayEx.FrontEnd: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCaptures Vipps captures]] 165 165 Activate Merchant 166 -Activate P AYEX.FRONTEND167 -P AYEX.FRONTEND->PAYEX.FRONTEND: validate input168 -P AYEX.FRONTEND-> PAYEX.BACKEND: call capture method169 -Activate P AYEX.BACKEND170 -P AYEX.BACKEND-->PAYEX.FRONTEND: capture result171 -Deactivate P AYEX.BACKEND172 -P AYEX.FRONTEND-->Merchant: transaction resource173 -Deactivate P AYEX.FRONTEND168 +Activate PayEx.FrontEnd 169 +PayEx.FrontEnd->PayEx.FrontEnd: validate input 170 +PayEx.FrontEnd -> PayEx.BackEnd: call capture method 171 +Activate PayEx.BackEnd 172 +PayEx.BackEnd-->PayEx.FrontEnd: capture result 173 +Deactivate PayEx.BackEnd 174 +PayEx.FrontEnd-->Merchant: transaction resource 175 +Deactivate PayEx.FrontEnd 174 174 Deactivate Merchant 175 175 @enduml 176 176 {{/plantuml}} ... ... @@ -209,18 +209,18 @@ 209 209 skinparam NoteFontColor #333333 210 210 211 211 Actor Merchant 212 -Participant P AYEX.FRONTEND213 -Participant P AYEX.BACKEND214 -Merchant->P AYEX.FRONTEND: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCancellations Vipps cancellations]]214 +Participant PayEx.FrontEnd 215 +Participant PayEx.BackEnd 216 +Merchant->PayEx.FrontEnd: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HCancellations Vipps cancellations]] 215 215 Activate Merchant 216 -Activate P AYEX.FRONTEND217 -P AYEX.FRONTEND->PAYEX.FRONTEND: validate input218 -P AYEX.FRONTEND-> PAYEX.BACKEND: call cancel method219 -Activate P AYEX.BACKEND220 -P AYEX.BACKEND-->PAYEX.FRONTEND: cancel result221 -Deactivate P AYEX.BACKEND222 -P AYEX.FRONTEND-->Merchant: transaction resource223 -Deactivate P AYEX.FRONTEND218 +Activate PayEx.FrontEnd 219 +PayEx.FrontEnd->PayEx.FrontEnd: validate input 220 +PayEx.FrontEnd-> PayEx.BackEnd: call cancel method 221 +Activate PayEx.BackEnd 222 +PayEx.BackEnd-->PayEx.FrontEnd: cancel result 223 +Deactivate PayEx.BackEnd 224 +PayEx.FrontEnd-->Merchant: transaction resource 225 +Deactivate PayEx.FrontEnd 224 224 Deactivate Merchant 225 225 @enduml 226 226 {{/plantuml}} ... ... @@ -259,18 +259,18 @@ 259 259 skinparam NoteFontColor #333333 260 260 261 261 Actor Merchant 262 -Participant P AYEX.FRONTEND263 -Participant P AYEX.BACKEND264 -Merchant->P AYEX.FRONTEND: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HReversals Vipps reversals]]264 +Participant PayEx.FrontEnd 265 +Participant PayEx.BackEnd 266 +Merchant->PayEx.FrontEnd: POST [[/xwiki/wiki/developer/view/Main/ecommerce/technical-reference/vipps-payments/#HReversals Vipps reversals]] 265 265 Activate Merchant 266 -Activate P AYEX.FRONTEND267 -P AYEX.FRONTEND->PAYEX.FRONTEND: validate input268 -P AYEX.FRONTEND-> PAYEX.BACKEND: call credit method269 -Activate P AYEX.BACKEND270 -P AYEX.BACKEND-->PAYEX.FRONTEND: credit result271 -Deactivate P AYEX.BACKEND272 -P AYEX.FRONTEND-->Merchant: transaction resource273 -Deactivate P AYEX.FRONTEND268 +Activate PayEx.FrontEnd 269 +PayEx.FrontEnd ->PayEx.FrontEnd: validate input 270 +PayEx.FrontEnd -> PayEx.BackEnd: call credit method 271 +Activate PayEx.BackEnd 272 +PayEx.BackEnd-->PayEx.FrontEnd: credit result 273 +Deactivate PayEx.BackEnd 274 +PayEx.FrontEnd-->Merchant: transaction resource 275 +Deactivate PayEx.FrontEnd 274 274 Deactivate Merchant 275 275 @enduml 276 276 {{/plantuml}}