Add cổng thanh toán PayPal Pro với hotspot

Tổng Quan

PayPal Pro account cung cấp hàm giao tiếp UniFi controller đầy đủ nhất so với PayPal Standard, tuy nhiên sẽ phải mất phí hàng tháng. Vì vậy chúng tôi chỉ hướng dẫn tích hợp Paypal Standard accounts (miễn phí) vào UniFi hotspot.

 Các bước thực hiện

Part I. Tài khoản Paypal Account

  1. Vào Paypal Sandbox website, https://developer.paypal.com/
  2. "Test Accounts" > "New test account" > "Preconfigured"
  3. "Account Type" > "Website Payments Pro"
  4. See if you want to change the auto-generated "Password"
  5. "Create Account"
  6. You can now see an account being setup in the Test Accounts page, choose that and click "Enter Sanbox Test Site"
  7. Mở cửa sổ mới , "Login" with the password you set
  8. Vào "My Account" -> "Profile" tab
  9. Dưới "Account Information" > chọn "Request API credentials"
  10. Chọn "Option 1 – Paypal API" -> "Setting up API permissions and credentials"
  11. Dưới "Option 2 – Request API credentials to create your own API username and password.", chọn "View API Signatures".
  12. Make a copy of the "API Username""API Password" and "Signature", that's all you need to get Paypal Pro going

Part II. Tùy chỉnh trên Controller

  1. Create a guest WLAN (check "Guest Policy" in the Wireless Configurations page of the WLAN)
  2. "Settings" > "Guest Control"
  3. In "Guest Policies" panel > "Enable Guest Portal"
  4. "Authentication" > "Hotspot"
  5. check "Enable Portal Customization"
  6. In "Hotspot" panel > check "Payment", "Enable payment-based authorization (PayPal Website Payment Pro required)"
  7. In the Paypal Username, Password and Signature, copy and paste those you obtained from Paypal website.
  8. Since I am using Paypal Sandbox for testing purposes, I will check "Use PayPal Sandbox". In the production controller and Paypal integration, you don't check this.

Part III. Tạo các gói cước

  1. Mặc định của UniFi cấu hình sẵn (1) 8- giờ là $5.99 (2) Ngày là $8.99. Ta sẽ thiết lập lại các thông số (1) 4- giờ là $1.99 (2) 8- giờ là $2.99 and (3) Ngày là  $5.99.
  2. Ta tùy chỉnh Portal trong thư mục gốc [UniFi root directory]dataportal directory. Có 2 file cần phải sửa đổi : index.html and bundlemessages.properties.
  3. index.html chứa thông tin người dùng . Mở file ra và tìm đến gói tính năng mình chọn
  4. Trong phần chonjta tiến hành thay đổi các gói cước như trên
  5. <div class="options-box">
  6. <pre><input type="radio" value="4" name="package" id="package-4" checked="checked" /><label for="package-4">4-Hour Pass – $1.99</label>
  7. <input type="radio" value="1" name="package" id="package-1" /><label for="package-1">8-Hour Pass – $2.99</label>
  8. <input type="radio" value="2" name="package" id="package-2" /><label for="package-2">Day Pass $5.99</label>
  9.  
  10. bundlemessages.properties defines the content of a package. Open it and the file should have enough self-explanatory comments.
  11. Chỉnh sửa package-1 (8-Hour) to $2.99 and package-2 (1-Day) to $5.99.
  12. Tạo mới package for 4-Hour.
  13. ## package 4
  14.  
  15.  
  16. package.4.name=Essential 4HR
  17. package.4.charged_as=Hotspot 4-Hour Wifi
  18. Now you are all set.

Part IV. Kiểm tra mọi thứ có làm việc

  1. Bạn có thể tạo tài khoản khác Paypal Sandbox .
  2. Sauk hi kết nối vào wifi Controller sẽ chuyển bạn đến trang Portal để thanh toán cước phí rồi sử dụng
  3. Xem tài khoản của bạn đã nhận được thanh toán
  4. Xem controller chấp nhận guest sau khi thanh toán.
  5. Kiểm tra trong controller hotspot manager xem thời gian cho kết nối guest là đúng.