Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stripeHeaders(headers: Headers) {
- headers.append('Content-Type', 'application/x-www-form-urlencoded');
- headers.append('Authorization', 'Bearer ' + this.apiKey);
- }
- updateBilling(customerId, cardNumber, expiryMonth, expiryYear, cvc): Observable<any> {
- let headers = new Headers();
- this.stripeHeaders(headers);
- let jsonParams = {
- source: {
- object: 'card',
- number: cardNumber,
- exp_month: expiryMonth,
- exp_year: expiryYear,
- cvc: cvc
- }
- }
- let stringParams = 'source={"object":"card","number":' + cardNumber + ',"exp_month":' + expiryMonth + ',"exp_year":' + expiryYear + ',"cvc":' + cvc + '}';
- return this.http.post('https://api.stripe.com/v1/customers/' + customerId, body, { headers: headers } )
- .map(res => res.json());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement