veritrans / SNAP-Woocommerce

MIT License
19 stars 16 forks source link

customer_details.email format is invalid #10

Closed madebyaris closed 6 years ago

madebyaris commented 6 years ago

Hi I got an error from noreply@midtrans.com just like the title. here's a little respond from mail {"first_name":"Yoppi","last_name":"","email":"","phone":""

in my case, my customer don't really need to input their email. so they just need to checkout.

by the way I'm using WordPress and WooCommerce. and it's in sandbox

rizdaprasetya commented 6 years ago

Hi @madebyaris

If you completely don't need any customer data recorded in Midtrans, you can try to remove this line of code in this file: https://github.com/veritrans/SNAP-Woocommerce/blob/master/class/class.midtrans-gateway.php#L324

$params['customer_details'] = $customer_details;

File: class/class.midtrans-gateway.php Line: 324

That should prevent you from getting the validation error. Thanks

madebyaris commented 6 years ago

Thanks for the reply @rizdaprasetya , I think, our internal still need customer data in Midtrans too.

what if I do this? so when the user does not type their email, I'll fill the email with a dummy one (for example toko@online.id), is Midtrans will become suspicious with that email (if our user doesn't type their email all the time).

thanks for advance

rizdaprasetya commented 6 years ago

@madebyaris

so when the user does not type their email, I'll fill the email with a dummy one (for example toko@online.id), is Midtrans will become suspicious with that email (if our user doesn't type their email all the time).

Sure you can do that. in Sandbox there won't be any issue. In production other than Credit Card won't be any issue too.

But in Production with Credit Card channel, Midtrans use Fraud Detection System which might think the email is suspicious, you can fix this issue, by manually requesting whitelist for that specific email. You can request whitelist email when you proceed to business agreement, you will be contacted by one of Midtrans sales person, make sure you let him know. Thanks

madebyaris commented 6 years ago

Thanks for the answer, you great man