Customers
#
Create CustomerCreates a customer record that holds billing information and is useful for card vaulting purposes.
#
PayloadRefer to Paymongo documentation for payload guidelines.
#
Sampleuse Luigel\Paymongo\Facades\Paymongo;
$customer = Paymongo::customer()->create([ 'first_name' => 'Juan', 'last_name' => 'Doe', 'phone' => '+639123456789', 'email' => 'customer@email.com', 'default_device' => 'phone']);
#
Get CustomerRetrieve a customer by passing the customer id to the find($id)
method.
#
Sampleuse Luigel\Paymongo\Facades\Paymongo;
$customer = Paymongo::customer()->find('cus_b9ENKVqcHBfQQmv26uDYDCsD');
#
Edit CustomerEdit a customer by using the find($id)
method and chaining the ->update()
method. Or by chaning ->update()
to your existing instance.
#
Sampleuse Luigel\Paymongo\Facades\Paymongo;
$customer = Paymongo::customer() ->find('cus_b9ENKVqcHBfQQmv26uDYDCsD') ->update([ 'first_name' => 'Jane' ]);
#
Delete CustomerDelete a customer by using the find($id)
method and chaining the ->delete()
method. Or by chaning ->delete()
to your existing instance.
#
Sampleuse Luigel\Paymongo\Facades\Paymongo;
$link = Paymongo::customer() ->find('cus_b9ENKVqcHBfQQmv26uDYDCsD') ->delete();
#
Retrieve Customer's Payment MethodsRetrieve the customer's payment methods by using the find($id)
method and chaining the ->paymentMethods()
method. Or by chaning ->paymentMethods()
to your existing instance.
#
Sampleuse Luigel\Paymongo\Facades\Paymongo;
$link = Paymongo::customer() ->find('cus_b9ENKVqcHBfQQmv26uDYDCsD') ->paymentMethods();