コード例 #1
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public List<Subscription> getMerchantSubscriptions(
     String merchantId, String userId, Date before, Date after) {
   Map<String, String> params = new HashMap<String, String>();
   if (userId != null) params.put("user_id", userId);
   if (before != null) params.put("before", formatUTC(before));
   if (after != null) params.put("after", formatUTC(after));
   return fromJson(
       httpClient.get(url(format(ApiPath.MERCHANT_SUBSCRIPTIONS, merchantId), params), headers()),
       new TypeToken<ArrayList<Subscription>>() {}.getType());
 }
コード例 #2
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public List<Bill> getMerchantBills(
     String merchantId,
     String sourceId,
     String subscriptionId,
     String preAuthorizationId,
     String userId,
     Date before,
     Date after,
     Boolean paid) {
   Map<String, String> params = new HashMap<String, String>();
   if (sourceId != null) params.put("source_id", sourceId);
   if (subscriptionId != null) params.put("subscription_id", subscriptionId);
   if (preAuthorizationId != null) params.put("pre_authorization_id", preAuthorizationId);
   if (userId != null) params.put("user_id", userId);
   if (before != null) params.put("before", formatUTC(before));
   if (after != null) params.put("after", formatUTC(after));
   if (paid != null) params.put("paid", paid.toString());
   return fromJson(
       httpClient.get(url(format(ApiPath.MERCHANT_BILLS, merchantId), params), headers()),
       new TypeToken<ArrayList<Bill>>() {}.getType());
 }
コード例 #3
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Bill refundBill(String billId) {
   return fromJson(
       httpClient.post(format(ApiPath.BILL_REFUND, billId), headers(), null), Bill.class);
 }
コード例 #4
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Bill cancelBill(String billId) {
   return fromJson(
       httpClient.put(format(ApiPath.BILL_CANCEL, billId), headers(), null), Bill.class);
 }
コード例 #5
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Bill getBill(String billId) {
   return fromJson(httpClient.get(format("%s/%s", ApiPath.BILL, billId), headers()), Bill.class);
 }
コード例 #6
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public List<User> getMerchantUsers(String merchantId) {
   return fromJson(
       httpClient.get(format(ApiPath.MERCHANT_USERS, merchantId), headers()),
       new TypeToken<ArrayList<User>>() {}.getType());
 }
コード例 #7
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Merchant getMerchant(String merchantId) {
   return fromJson(
       httpClient.get(format("%s/%s", ApiPath.MERCHANT, merchantId), headers()), Merchant.class);
 }
コード例 #8
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Payout getPayout(String payoutId) {
   return fromJson(
       httpClient.get(format("%s/%s", ApiPath.PAYOUT, payoutId), headers()), Payout.class);
 }
コード例 #9
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public List<Payout> getMerchantPayouts(String merchantId) {
   return fromJson(
       httpClient.get(format(ApiPath.MERCHANT_PAYOUTS, merchantId), headers()),
       new TypeToken<ArrayList<Payout>>() {}.getType());
 }
コード例 #10
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Bill postPreAuthorizedBill(PreAuthorizedBill preAuthorizedBill) {
   return fromJson(
       httpClient.post(ApiPath.BILL, headers(), toJson(preAuthorizedBill, "bill")), Bill.class);
 }
コード例 #11
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public PreAuthorization cancelPreAuthorization(String preAuthorizationId) {
   return fromJson(
       httpClient.put(
           format(ApiPath.PRE_AUTHORIZATION_CANCEL, preAuthorizationId), headers(), null),
       PreAuthorization.class);
 }
コード例 #12
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public PreAuthorization getPreAuthorization(String preAuthorizationId) {
   return fromJson(
       httpClient.get(format("%s/%s", ApiPath.PRE_AUTHORIZATION, preAuthorizationId), headers()),
       PreAuthorization.class);
 }
コード例 #13
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Subscription cancelSubscription(String subscriptionId) {
   return fromJson(
       httpClient.put(format(ApiPath.SUBSCRIPTION_CANCEL, subscriptionId), headers(), null),
       Subscription.class);
 }
コード例 #14
0
ファイル: Api.java プロジェクト: Simha009/gocardless-java
 public Subscription getSubscription(String subscriptionId) {
   return fromJson(
       httpClient.get(format("%s/%s", ApiPath.SUBSCRIPTION, subscriptionId), headers()),
       Subscription.class);
 }