<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yu-Wei 張育瑋 Chang on Medium]]></title>
        <description><![CDATA[Stories by Yu-Wei 張育瑋 Chang on Medium]]></description>
        <link>https://medium.com/@ab839296302?source=rss-b463531b9a16------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ehxbYBPcDMm-eVj_.jpg</url>
            <title>Stories by Yu-Wei 張育瑋 Chang on Medium</title>
            <link>https://medium.com/@ab839296302?source=rss-b463531b9a16------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:32:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ab839296302/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Swift TayPay串接]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/swift-taypay%E4%B8%B2%E6%8E%A5-d4babd39b331?source=rss-b463531b9a16------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4babd39b331</guid>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Yu-Wei 張育瑋 Chang]]></dc:creator>
            <pubDate>Sat, 29 Jun 2019 02:57:12 GMT</pubDate>
            <atom:updated>2019-06-29T02:57:56.148Z</atom:updated>
            <content:encoded><![CDATA[<p>這篇主要介紹TayPay串接的概念<br>詳細的步驟可以參考TayPay官網文件,先看實作結果<br>官網：<a href="https://docs.tappaysdk.com/tutorial/zh/home.html">https://docs.tappaysdk.com/tutorial/zh/home.html</a><br>官方範例：<a href="https://onedrive.live.com/download?cid=2E7ABBDC6C509913&amp;resid=2E7ABBDC6C509913%215173&amp;authkey=AH5sDA8pWBPnQ0U">下載</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*0uz6KVCtwd3jkhsimfGsQA.gif" /></figure><h4>環境設置</h4><p>申請TapPay Portal , 主要需要以下東西<br>* App ID (應用程式)<br>* App Key (應用程式)<br>* x-api-key / partner_key (帳戶資訊)<br>* Merchant ID (商家管理)</p><p>測試卡號<br>card number 4242 4242 4242 4242<br>01/23 ccv 123</p><p>匯入TPDirect.frameeork <br>載點：<a href="https://docs.tappaysdk.com/apple-pay/zh/front.html#environment">https://docs.tappaysdk.com/apple-pay/zh/front.html#environment</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8EI-FIQLAOVWUBPSXTV_7g.jpeg" /></figure><p>由上面我們可以知道大致步驟<br>*首先client會向TapPayServer請求一個Prime<br>*將Prime與你想要存的資料傳到server端 <br>*Server依據TapPay伺服器接收的格式定義HTTP請求來發送資料給TapPayServer<br>*等銀行傳回結果給TapPay , TapPay再傳規定好格式的資料給我們，拿到資訊後就看你要回傳什麼給client端了</p><h4>程式部分</h4><p>先到AppDelegate進行設定，遮住部分第一個為App ID 第二個為App Key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X2osv4jFXYKy1qaMlgXnjw.png" /></figure><p>在viewDidLoad內我們先設置<br>1.顯示輸入信用卡資訊的View<br>2.輸入卡號後底部線框的顏色<br>3.檢查信用卡目前的狀態</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J22uGcIt2kGwcTjxleOVuQ.png" /></figure><p>接著在按鈕內設定好成功與失敗callback，之後我們就可以用getPrime()來取得Prime字串，如果失敗我們可以將訊息列印出來，官方文件有一個顯示所有失敗訊息的列表，可以去那邊尋找失敗的原因，也可以寄信給官方。</p><p>如果成功我們就可以在把Prime跟需要的訊息傳給server，下面附上TayPay規定的傳送格式</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVCxskaJ-WOaC9ePyBxxRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJHlZBte8R27AKTeWusdvA.png" /></figure><p>當然，如果你只是想練習串接不想寫Server端程式來儲存資訊，你也可以在拿到Prime時透過client端對TapPayServer發送Http Post請求，這樣TapPay就會把結果直接回給client端了</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kyatkF1GSGgp0a-aI3atwg.png" /></figure><p>以上就是TayPay串接的步驟，說難其實也還好，最主要對第一次接觸的人步驟會有些繁瑣，理清概念之後其實還蠻簡單的，感謝各位的觀看。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4babd39b331" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/swift-taypay%E4%B8%B2%E6%8E%A5-d4babd39b331">Swift TayPay串接</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift串接第三方API之關鍵字收尋]]></title>
            <link>https://medium.com/peter-pan-swift-ios-class/swift%E4%B8%B2%E6%8E%A5%E7%AC%AC%E4%B8%89%E6%96%B9api%E4%B9%8B%E9%97%9C%E9%8D%B5%E5%AD%97%E6%94%B6%E5%B0%8B-4c48e701900e?source=rss-b463531b9a16------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c48e701900e</guid>
            <dc:creator><![CDATA[Yu-Wei 張育瑋 Chang]]></dc:creator>
            <pubDate>Sat, 18 May 2019 15:51:11 GMT</pubDate>
            <atom:updated>2019-06-27T04:25:23.305Z</atom:updated>
            <content:encoded><![CDATA[<p>閒閒沒事找到一個蠻有趣的API：GDELT GEO 2.0 API <a href="https://blog.gdeltproject.org/gdelt-geo-2-0-api-debuts/">https://blog.gdeltproject.org/gdelt-geo-2-0-api-debuts/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8fRuXUKwjLmOZzUjzS29w.png" /></figure><p>文章內表示它集結了從1979年到現在所有開放的資料，每天捕捉世界各地正在發生的事情，事件的發生背景及參與者，以及各地的反應; 看起來好像真的很強大，有興趣的人可以看裡面文章查查調用的方法，今天就教大家一些比較基本的用法並實做出來吧</p><ol><li>關鍵字搜索調用方法</li></ol><p>https://api.gdeltproject.org/api/v2/geo/geo?query=（想查詢的東西）</p><p>後面還可以加上：format（格式），timespan（時間範圍），maxpoints（最多顯示的點）來限定搜索條件，舉個例子，如果你想搜索1天2小時內每個地區所有有關貿易戰的文章個數，返回JSON數據可以如下寫</p><p><a href="https://api.gdeltproject.org/api/v2/geo/geo?query=">https://api.gdeltproject.org/api/v2/geo/geo?query=</a> trade war＆format = GeoJSON＆timespan = 1d2h</p><p>2. UI樣式</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3oi4Tf-doIJIfVIznZqUg.png" /></figure><p>3.依回傳JSON格式創造自訂類別</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zf97hsDUTvKHGdFPq0Ecng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*UQDomz5hRi9SPNQX0zcREw.png" /></figure><p>值得注意的是，它所回傳的照片URL個是不一，有的沒有值 有的是https 有的是http(Swift http無法連線的解決方法請參照 Peter老師的 <a href="https://reurl.cc/v84go">https://reurl.cc/v84go</a>) ，因此沒有值得話我預設給他一張not found圖</p><p>4.撰寫程式碼：</p><p>這邊就不再一一贅述每個實作方法，請依自己喜好設計想要呈現的結果，我的設計是輸入關鍵字後會把結果傳到tableViewController上，再來依選項轉跳到顯示所有結果的地圖上或這單獨一個地區的頁面，以下是實作結果和github上連結</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*mcidEfY9IyzSkCKGLBIj5g.gif" /></figure><p><a href="https://github.com/CYUzKRay/Search.git">CYUzKRay/Search</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c48e701900e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peter-pan-swift-ios-class/swift%E4%B8%B2%E6%8E%A5%E7%AC%AC%E4%B8%89%E6%96%B9api%E4%B9%8B%E9%97%9C%E9%8D%B5%E5%AD%97%E6%94%B6%E5%B0%8B-4c48e701900e">Swift串接第三方API之關鍵字收尋</a> was originally published in <a href="https://medium.com/peter-pan-swift-ios-class">彼得潘的 Swift iOS / Flutter App 開發教室</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>