コード例 #1
0
ファイル: StripeTests.java プロジェクト: mduduzik/flowframe
 @Test
 public void testChargePartialRefundPerCallAPIKey() throws StripeException {
   Charge createdCharge = Charge.create(defaultChargeParams);
   Map<String, Object> refundParams = new HashMap<String, Object>();
   final Integer REFUND_AMOUNT = 50;
   refundParams.put("amount", REFUND_AMOUNT);
   Charge refundedCharge = createdCharge.refund(refundParams, Stripe.apiKey);
   assertFalse(refundedCharge.getRefunded());
   assertEquals(refundedCharge.getAmountRefunded(), REFUND_AMOUNT);
 }
コード例 #2
0
ファイル: StripeTests.java プロジェクト: mduduzik/flowframe
 /**
  * Ensure the provided parameter for API key is actually being used. All other PerCallAPIKey
  * methods assume this part works.
  *
  * @throws StripeException
  */
 @Test
 public void testPerCallAPIUsage() throws StripeException {
   Charge createdCharge = Charge.create(defaultChargeParams, Stripe.apiKey);
   assertFalse(createdCharge.getRefunded());
   try {
     Charge.create(defaultChargeParams, "INVALID_KEY_HERE");
     fail();
   } catch (Exception e) {
   }
 }
コード例 #3
0
ファイル: StripeTests.java プロジェクト: mduduzik/flowframe
  @Test
  public void testChargeCreate() throws StripeException {
    Charge createdCharge = Charge.create(defaultChargeParams);
    assertFalse(createdCharge.getRefunded());

    assertEquals(1, createdCharge.getFeeDetails().size());

    Fee fee = createdCharge.getFeeDetails().get(0);
    assertEquals("stripe_fee", fee.getType());
    assertEquals(createdCharge.getFee(), fee.getAmount());
    assertEquals(createdCharge.getCurrency(), fee.getCurrency());
    assertEquals(null, fee.getApplication());
  }
コード例 #4
0
ファイル: StripeTests.java プロジェクト: mduduzik/flowframe
 @Test
 public void testChargeRefundPerCallAPIKey() throws StripeException {
   Charge createdCharge = Charge.create(defaultChargeParams, Stripe.apiKey);
   Charge refundedCharge = createdCharge.refund(Stripe.apiKey);
   assertTrue(refundedCharge.getRefunded());
 }
コード例 #5
0
ファイル: StripeTests.java プロジェクト: mduduzik/flowframe
 @Test
 public void testChargeCreatePerCallAPIKey() throws StripeException {
   Charge createdCharge = Charge.create(defaultChargeParams, Stripe.apiKey);
   assertFalse(createdCharge.getRefunded());
 }
コード例 #6
0
ファイル: StripeTests.java プロジェクト: mduduzik/flowframe
 @Test
 public void testChargeRefund() throws StripeException {
   Charge createdCharge = Charge.create(defaultChargeParams);
   Charge refundedCharge = createdCharge.refund();
   assertTrue(refundedCharge.getRefunded());
 }