Parse Cloud 코드 용 Stripe API는 어떻게 설정합니까? 나는 코드를 작동시킬 수 있었지만 그것을 편집하고 싶다. 아래 함수는 "stripe.customers.create"이며, 소스 행을 제거 할 때만 작동합니다. 어떻게 토큰을 요청할 수 있습니까? 스트라이프 고객을 파싱 사용자에게 연결하려고합니다.Parse Cloud 코드 용 Stripe API 설정 방법
Parse.Cloud.define("customer", function(request, response){
stripe.customers.create({
description: request.params.description
//source: request.params.token
}, function(err, customer) {
if(err){
console.log(err);
response.error(err);
}
else{
console.log(customer);
response.success(customer);
}
});
});
'source' 인수로이 코드를 실행하려고 시도 할 때 잘못된 점을 분명하게 설명해 주시겠습니까? 토큰이 거부 된 것일 수 있습니까? 테스트 모드에 있다면, '4242424242424242'카드 번호를 사용하여 확인할 수 있습니다. 또한 request.params.description의 끝 부분에','(쉼표)를 추가하는 것을 잊지 않도록합니다. – andrewnelder
@andrewnelder 감사합니다. 나는 당신이 제안한 것을 끝내고 고객이 만들어졌습니다. 그러나 Xcode 콘솔에 토큰이 생성되었음을 보여 주지만 카드는 고객과 연결되지 않습니다. –