샌드박스를 통해 결제 테스트를 진행하고 있습니다.
결제를 하면 onEvent: (event)에는 success 이벤트가 발생되나 processProductGrant 이벤트가 발생하고 있지 않는데요, 샌드박스여서 그런걸까요 ?
환경은 ReactNative 입니다.
const cleanup = IAP.createOneTimePurchaseOrder({
options: {
sku: productId.trim(),
processProductGrant: async ({ orderId }) => {
console.error(`processProductGrant orderId: ${JSON.stringify(orderId)}`);
try {
console.error(`processProductGrant try purchase start`);
const result = await purchase(atk, transactionId, orderId);
return result.success;
} catch (error) {
console.error(`processProductGrant error: ${error}`);
return false;
}
}
},
onEvent: (event) => {
console.error(`processProductGrant event: ${JSON.stringify(event)}`);
},
onError: (error) => {
console.error(`processProductGrant onError: ${error}`);
},
});