Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Add new method
Browse files Browse the repository at this point in the history
  • Loading branch information
vad9s6 committed Nov 9, 2021
1 parent 0ce61ba commit 75b9cda
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 122 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### v0.0.4

- Added method `getAllCards`
- Added method `getCustomer`
- Added method `setDefaultCard`
- Updated docs

### v0.0.3

- Added method `addSourceToCustomer`
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,47 @@ const stripe = await loadStripe("pk_test_TYooMQauvdEDq54NiTphI7jx");
| confirmPaymentIntentByCard | [client_secret], [card_id] | Confirm payment with the user's payment intent card. |
| addSourceToCustomer | [source or token], [customer_id], [ephemeral_key] | Add payment method to customer (from source or token). |
| deleteSourceFromCustomer | [source_id], [customer_id], [ephemeral_key] | Delete payment method from customer. |
| getAllCards | [ephemeral_key], [customer_id] | Get all cards from customer. |
| getCustomer | [ephemeral_key], [customer_id] | Get customer.
|
| setDefaultCard | [defaultCardId], [ephemeral_key], [customer_id] | Set default card.
|

## Examples

```
stripe.confirmPaymentIntentByCard(
'pi_3Jrk80HdlMaZle3e1tGtSxiH_secret_mWdWNlqJfkYEoYOml1GqRPyPm',
'pi_3Jrk80HdlMaZle3e1tGtSxiH_secret_mWdWNlqJfkYEoYOml1GqRPyPm',
'card_1JrMi8HdlMaZle3eSPPOvapJ'
);
stripe.addSourceToCustomer(
'tok_visa',
'cus_KO9SkBdMeHoMXR',
'tok_visa',
'cus_KO9SkBdMeHoMXR',
'ek_test_YWNjdF8xSFhSd0xIZGxNYVpsZTNlLENrVUxKWWNjZExxSDJDb1VKa1YwaXU5VDZVcmVmQXQ_00drAg7pBQ'
);
stripe.deleteSourceFromCustomer(
'card_1JroRSHdlMaZle3e4EIGOZuv',
'cus_KO9SkBdMeHoMXR',
'card_1JroRSHdlMaZle3e4EIGOZuv',
'cus_KO9SkBdMeHoMXR',
'ek_test_YWNjdF8xSFhSd0xIZGxNYVpsZTNlLENrVUxKWWNjZExxSDJDb1VKa1YwaXU5VDZVcmVmQXQ_00drAg7pBQ'
);
stripe.getAllCards(
'ek_test_YWNjdF8xSFhSd0xIZGxNYVpsZTNlLENrVUxKWWNjZExxSDJDb1VKa1YwaXU5VDZVcmVmQXQ_00drAg7pBQ',
'cus_KO9SkBdMeHoMXR'
);
stripe.getCustomer(
'ek_test_YWNjdF8xSFhSd0xIZGxNYVpsZTNlLENrVUxKWWNjZExxSDJDb1VKa1YwaXU5VDZVcmVmQXQ_00drAg7pBQ',
'cus_KO9SkBdMeHoMXR'
);
stripe.setDefaultCard(
'card_1JrMi8HdlMaZle3eSPPOvapJ',
'ek_test_YWNjdF8xSFhSd0xIZGxNYVpsZTNlLENrVUxKWWNjZExxSDJDb1VKa1YwaXU5VDZVcmVmQXQ_00drAg7pBQ',
'cus_KO9SkBdMeHoMXR'
);
```

## Scripts
Expand Down
Loading

0 comments on commit 75b9cda

Please sign in to comment.