Skip to content

Commit

Permalink
Merge pull request #20 from xendit/revert-recurring
Browse files Browse the repository at this point in the history
Revert "add credit card recurring in client & example"
  • Loading branch information
afik authored May 16, 2017
2 parents 44bd761 + 793731a commit 588d891
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 98 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,3 @@ cd src/
php examples/issue_credit_card_refund_with_idempotency_example.php [credit_card_charge_id] [amount] [external_id] [optional-idempotency-key]
```

# Subscribe Credit Card Recurring Payment
```
cd src/
php examples/subscribe_credit_card_recurring_payment_example.php [token_id] [initial_charge_amount] [initial_charge_external_id]
```

# Capture Subsequent Credit Card Recurring Payment
```
cd src/
php examples/capture_subsequent_credit_card_recurring_payment_example.php [subscription_id] [amount] [external_id]
```
55 changes: 0 additions & 55 deletions src/XenditPHPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,60 +288,5 @@ function validateBankAccountHolderName ($bank_account_number, $bank_code) {
$responseObject = json_decode($response, true);
return $responseObject;
}

function subscribeCreditCardRecurringPayment ($token_id, $initial_charge_amount, $initial_charge_external_id) {
$curl = curl_init();

$headers = array();
$headers[] = 'Content-Type: application/json';

$end_point = $this->server_domain.'/recurring_credit_card_subscription';

$data['token_id'] = $token_id;
$data['initial_charge_amount'] = $initial_charge_amount;
$data['initial_charge_external_id'] = $initial_charge_external_id;

$payload = json_encode($data);

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_USERPWD, $this->secret_api_key.":");
curl_setopt($curl, CURLOPT_URL, $end_point);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($curl);
curl_close($curl);

$responseObject = json_decode($response, true);
return $responseObject;
}

function captureSubsequentCreditCardRecurringPayment ($subscription_id, $amount, $external_id) {
$curl = curl_init();

$headers = array();
$headers[] = 'Content-Type: application/json';

$end_point = $this->server_domain.'/recurring_credit_card_subscription/'.$subscription_id.'/charges';

$data['amount'] = $amount;
$data['external_id'] = $external_id;

$payload = json_encode($data);

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_USERPWD, $this->secret_api_key.":");
curl_setopt($curl, CURLOPT_URL, $end_point);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($curl);
curl_close($curl);

$responseObject = json_decode($response, true);
return $responseObject;
}
}
?>

This file was deleted.

16 changes: 0 additions & 16 deletions src/examples/subscribe_credit_card_recurring_payment_example.php

This file was deleted.

0 comments on commit 588d891

Please sign in to comment.