2014-01-14 76 views

回答

8

Citrus爲高效的技術集成提供了一些真正簡化的開發人員指南。讓我們通過示例網上銀行整合。剩餘的步驟可以通過The Citrus Developer's Guide找到。

  1. 保密密鑰
  2. 訪問密鑰
  3. 簽到重點
  4. 簽到祕密
  5. 註冊碼
  6. 實施例和Citruslibrary -
  7. 註冊祕密
  • 從下載試劑盒中。添加Citruslibrary作爲示例的依賴項。來自Github。

    混帳克隆https://github.com/citruspay/open-android-v2.git

  • 看一看初始化函數。您可以使用柑橘配置來設置密鑰。

    private void init() 
    { 
         Config citrus = new Config(); 
         citrus.setEnv("sandbox"); //replace it with production when you are ready 
         citrus.setupSignupId("merchant-signup"); 
         citrus.setupSignupSecret("3e2288d3a1a3f59ef6f93373884d2ca1"); 
         citrus.setSigninId("merchant-wallet"); 
         citrus.setSigninSecret("c40798d3c12114b5bb19f2051d9ed181"); 
    } 
    
  • 從您的server.Collect用戶details.Call收費API。

    private void cardpay(String bill_string) 
        { 
         Bill bill = new Bill(bill_string); 
         Card card = new Card("4111111111111111", "11", "21", "000", "Tony Stark", "debit"); 
         UserDetails userDetails = new UserDetails(customer); 
         PG paymentgateway = new PG(card, bill, userDetails); 
         paymentgateway.charge(new Callback() 
          { 
           @Override 
           public void onTaskexecuted(String success, String error) 
           { 
             processresponse(success, error); 
           } 
          } 
         }); 
        } 
    
  • 調用負責與網路銀行

    private void bankpay(String bill_string) 
    { 
        Bill bill = new Bill(bill_string); 
        Bank netbank = new Bank("CID002"); 
        UserDetails userDetails = new UserDetails(customer); 
        PG paymentgateway = new PG(netbank, bill, userDetails); 
        paymentgateway.charge(new Callback() 
         { 
          @Override 
          public void onTaskexecuted(String success, String error) 
           { 
            processresponse(success, error); 
           } 
         }); 
        } 
    
+1

涼.. !!所有密鑰都由?提供? –

+1

這些鑰匙由Citrus提供。在Citrus商家面板上找到。 :) http://www.citruspay.com/ – Daenarys

+0

@Daenarys我可以看到在網上銀行銀行選項非常少的選項。是因爲沙箱環境嗎?另外bill_string將從我們的服務器生成? – Shubham