Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Payment Service in Android App by LINE Pay API

Building Payment Service in Android App by LINE Pay API

LINE Developers Thailand

September 13, 2020
Tweet

More Decks by LINE Developers Thailand

Other Decks in Technology

Transcript

  1. 14:25 - 15:55
    Somkiat Khitwongwattana
    Building Payment
    Service in Android App
    by LINE Pay API
    Android Engineer, LINE MAN Wongnai

    View full-size slide

  2. Building Payment
    Service in
    Android app by
    LINE Pay API

    View full-size slide

  3. Thailand
    Global, Japan and Taiwan

    View full-size slide

  4. Reduce your costs
    Reasonable fees
    Increase your sales
    Convenient to use
    LINE Pay API
    Why?

    View full-size slide

  5. 4.5 Million Rabbit LINE Pay Users
    Thailand in 2018
    ~ 10.2% of LINE Users
    source : vgi.co.th

    View full-size slide

  6. LINE MAN JD CENTRAL Watsons Konvy
    myAIS
    McDonald's
    Thailand
    OfficeMate
    and more!

    View full-size slide

  7. Registration

    View full-size slide

  8. https://pay.line.me
    For Merchant

    View full-size slide

  9. https://pay.line.me/th/developers/main/main
    For Developer

    View full-size slide

  10. LINE Pay API Version 3
    Version 2
    Version 1
    https://pay.line.me/documents/online_v3_en.html

    View full-size slide

  11. https://bit.ly/integrate-line-pay-api-v3-th
    LINE Chat Bot + LINE Pay API

    View full-size slide

  12. LINE Pay
    API
    Your
    Server
    Your
    App
    LINE
    App
    Android Server

    View full-size slide

  13. Navigate App to Rabbit LINE Pay
    Your App
    LINE App

    View full-size slide

  14. Navigate App to Rabbit LINE Pay
    Your App
    LINE App

    View full-size slide

  15. Navigate App to Rabbit LINE Pay
    Your App
    LINE App

    View full-size slide

  16. Navigate App to Rabbit LINE Pay
    Your App
    LINE App

    View full-size slide

  17. Transaction Successful
    Your App
    LINE App

    View full-size slide

  18. Transaction Successful
    Your App
    LINE App

    View full-size slide

  19. Transaction Successful
    Your App
    LINE App

    View full-size slide

  20. Transaction Successful
    Your App
    LINE App

    View full-size slide

  21. Transaction Cancelled
    Your App
    LINE App

    View full-size slide

  22. Transaction Cancelled
    Your App
    LINE App

    View full-size slide

  23. Transaction Cancelled
    Your App
    LINE App

    View full-size slide

  24. Transaction Failed
    Your App
    LINE App

    View full-size slide

  25. Transaction Failed
    Your App
    LINE App

    View full-size slide

  26. Transaction Failed
    Your App
    LINE App

    View full-size slide

  27. Your App LINE App Your Server LINE Pay API
    Start

    View full-size slide

  28. Your App LINE App Your Server LINE Pay API
    Create Order
    Start

    View full-size slide

  29. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Start

    View full-size slide

  30. Request API's request body

    View full-size slide

  31. Request API's request body

    View full-size slide

  32. Request API's request body

    View full-size slide

  33. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Start

    View full-size slide

  34. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Start

    View full-size slide

  35. Request API's response

    View full-size slide

  36. Request API's response

    View full-size slide

  37. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Start

    View full-size slide

  38. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Start

    View full-size slide

  39. Check LINE app and LINE Pay supported in Android

    View full-size slide

  40. Open Google Play or other app store to install LINE app

    View full-size slide

  41. Open LINE Pay API's payment URL

    View full-size slide

  42. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Start

    View full-size slide

  43. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Start

    View full-size slide

  44. Deep Link From Rabbit LINE Pay
    ltdc://payment/confirm-order?transactionId=...&orderId=...
    Confirm URL
    ltdc://payment/cancel-order?transactionId=...&orderId=...
    Cancel URL

    View full-size slide

  45. Deep Link From Rabbit LINE Pay
    ltdc://payment/confirm-order?transactionId=...&orderId=...
    Confirm URL
    ltdc://payment/cancel-order?transactionId=...&orderId=...
    Cancel URL

    View full-size slide

  46. Activity with deep link for complete payment

    View full-size slide

  47. Activity with deep link for complete payment

    View full-size slide

  48. Activity with deep link for complete payment

    View full-size slide

  49. Activity with deep link for complete payment

    View full-size slide

  50. Activity with deep link for cancel payment

    View full-size slide

  51. Activity with deep link for cancel payment

    View full-size slide

  52. Activity with deep link for cancel payment

    View full-size slide

  53. Get query parameters from deep link's URL

    View full-size slide

  54. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Start

    View full-size slide

  55. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Order Payment Complete
    • Order ID
    Start
    • Transaction ID

    View full-size slide

  56. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Order Payment Complete
    • Order ID
    Confirm API
    Start
    • Transaction ID

    View full-size slide

  57. Confirm API's request body

    View full-size slide

  58. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Order Payment Complete
    • Order ID
    Confirm API
    Start
    • Transaction ID

    View full-size slide

  59. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Order Payment Complete
    • Order ID
    Confirm API
    • Payment Info
    Response
    Start
    • Transaction ID

    View full-size slide

  60. Confirm API 's response

    View full-size slide

  61. Confirm API 's response

    View full-size slide

  62. Confirm API 's response

    View full-size slide

  63. Confirm API 's response

    View full-size slide

  64. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Order Payment Complete
    • Order ID
    Confirm API
    • Payment Info
    Response
    Start
    • Transaction ID

    View full-size slide

  65. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    • Payment Token
    • Payment URL
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    (By Deep Link)
    Order Payment Complete
    • Order ID
    Confirm API
    • Payment Info
    Response
    Start
    End
    Response
    • Transaction ID

    View full-size slide

  66. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    • Transaction ID
    Order Payment Complete
    • Order ID
    Confirm API
    • Payment Info
    Response
    Start
    End
    Response
    • Transaction ID

    View full-size slide

  67. Your App LINE App Your Server LINE Pay API
    Create Order
    Request API
    Response
    • Transaction ID
    Response
    • Payment URL
    Open LINE App
    (With Payment URL)
    Complete
    • Transaction ID
    Order Payment Complete
    • Order ID
    Confirm API
    • Payment Info
    Response
    Start
    End
    Response
    • Transaction ID

    View full-size slide

  68. Production
    API Endpoint
    https://api-pay.line.me
    Sandbox
    https://sandbox-api-pay.line.me

    View full-size slide

  69. Production
    API Endpoint
    https://api-pay.line.me
    Sandbox
    https://sandbox-api-pay.line.me

    View full-size slide

  70. Sandbox
    https://sandbox-web-pay.line.me/web/payment/...
    Web
    linesandbox://pay/payment/...
    App
    Production
    https://web-pay.line.me/web/payment/...
    Web
    line://pay/payment/...
    App

    View full-size slide

  71. Sandbox
    https://sandbox-web-pay.line.me/web/payment/...
    Web
    linesandbox://pay/payment/...
    App
    Production
    https://web-pay.line.me/web/payment/...
    Web
    line://pay/payment/...
    App

    View full-size slide