code
stringlengths
31
1.39M
docstring
stringlengths
23
16.8k
func_name
stringlengths
1
126
language
stringclasses
1 value
repo
stringlengths
7
63
path
stringlengths
7
166
url
stringlengths
50
220
license
stringclasses
7 values
public function updateOrder(string $order_id, array $data) { $this->apiEndPoint = "v2/checkout/orders/{$order_id}"; $this->options['json'] = $data; $this->verb = 'patch'; return $this->doPayPalRequest(false); }
Update order details. @param string $order_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/orders/v2/#orders_patch
updateOrder
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Orders.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Orders.php
MIT
public function confirmOrder(string $order_id, array $data) { $this->apiEndPoint = "v2/checkout/orders/{$order_id}/confirm-payment-source"; $this->options['json'] = (object) $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Confirm the order. @param string $order_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string
confirmOrder
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Orders.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Orders.php
MIT
public function authorizePaymentOrder(string $order_id, array $data = []) { $this->apiEndPoint = "v2/checkout/orders/{$order_id}/authorize"; $this->options['json'] = (object) $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Authorizes payment for an order. @param string $order_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/orders/v2/#orders_authorize
authorizePaymentOrder
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Orders.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Orders.php
MIT
public function capturePaymentOrder(string $order_id, array $data = []) { $this->apiEndPoint = "v2/checkout/orders/{$order_id}/capture"; $this->options['json'] = (object) $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Captures payment for an order. @param string $order_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/orders/v2/#orders_capture
capturePaymentOrder
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Orders.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Orders.php
MIT
public function addTrackingForOrder(string $order_id, array $data) { $this->apiEndPoint = "v2/checkout/orders/{$order_id}/track"; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Add tracking information for an Order. @param string $order_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/orders/v2/#orders_track_create
addTrackingForOrder
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Orders.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Orders.php
MIT
public function createPartnerReferral(array $partner_data) { $this->apiEndPoint = 'v2/customer/partner-referrals'; $this->options['json'] = $partner_data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a Partner Referral. @param array $partner_data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/partner-referrals/v2/#partner-referrals_create
createPartnerReferral
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PartnerReferrals.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PartnerReferrals.php
MIT
public function showReferralData(string $partner_referral_id) { $this->apiEndPoint = "v2/customer/partner-referrals/{$partner_referral_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Get Partner Referral Details. @param string $partner_referral_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/partner-referrals/v2/#partner-referrals_read
showReferralData
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PartnerReferrals.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PartnerReferrals.php
MIT
public function listSellerTrackingInformation(string $partner_id, string $tracking_id) { $this->apiEndPoint = "v1/customer/partners/{$partner_id}/merchant-integrations?tracking_id={$tracking_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List Seller Tracking Information. @param string $partner_id @param string $tracking_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/partner-referrals/v1/#merchant-integration_find
listSellerTrackingInformation
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PartnerReferrals.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PartnerReferrals.php
MIT
public function showSellerStatus(string $partner_id, string $merchant_id) { $this->apiEndPoint = "v1/customer/partners/{$partner_id}/merchant-integrations/{$merchant_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show Seller Status. @param string $partner_id @param string $merchant_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/partner-referrals/v1/#merchant-integration_status
showSellerStatus
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PartnerReferrals.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PartnerReferrals.php
MIT
public function listMerchantCredentials(string $partner_id) { $this->apiEndPoint = "v1/customer/partners/{$partner_id}/merchant-integrations/credentials"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List Merchant Credentials. @param string $partner_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/partner-referrals/v1/#merchant-integration_credentials
listMerchantCredentials
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PartnerReferrals.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PartnerReferrals.php
MIT
public function showAuthorizedPaymentDetails(string $authorization_id) { $this->apiEndPoint = "v2/payments/authorizations/{$authorization_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show details for authorized payment. @param string $authorization_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments/v2/#authorizations_get
showAuthorizedPaymentDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentAuthorizations.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentAuthorizations.php
MIT
public function captureAuthorizedPayment(string $authorization_id, string $invoice_id, float $amount, string $note) { $this->apiEndPoint = "v2/payments/authorizations/{$authorization_id}/capture"; $this->options['json'] = [ 'amount' => [ 'value' => $amount, 'currency_code' => $this->currency, ], 'invoice_id' => $invoice_id, 'note_to_payer' => $note, 'final_capture' => true, ]; $this->verb = 'post'; return $this->doPayPalRequest(); }
Capture an authorized payment. @param string $authorization_id @param string $invoice_id @param float $amount @param string $note @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments/v2/#authorizations_capture
captureAuthorizedPayment
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentAuthorizations.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentAuthorizations.php
MIT
public function reAuthorizeAuthorizedPayment(string $authorization_id, float $amount) { $this->apiEndPoint = "v2/payments/authorizations/{$authorization_id}/reauthorize"; $this->options['json'] = [ 'amount' => [ 'value' => $amount, 'currency_code' => $this->currency, ], ]; $this->verb = 'post'; return $this->doPayPalRequest(); }
Reauthorize an authorized payment. @param string $authorization_id @param float $amount @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments/v2/#authorizations_reauthorize
reAuthorizeAuthorizedPayment
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentAuthorizations.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentAuthorizations.php
MIT
public function voidAuthorizedPayment(string $authorization_id) { $this->apiEndPoint = "v2/payments/authorizations/{$authorization_id}/void"; $this->verb = 'post'; return $this->doPayPalRequest(false); }
Void an authorized payment. @param string $authorization_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments/v2/#authorizations_void
voidAuthorizedPayment
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentAuthorizations.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentAuthorizations.php
MIT
public function showCapturedPaymentDetails(string $capture_id) { $this->apiEndPoint = "v2/payments/captures/{$capture_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show details for a captured payment. @param string $capture_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments/v2/#captures_get
showCapturedPaymentDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentCaptures.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentCaptures.php
MIT
public function refundCapturedPayment(string $capture_id, string $invoice_id, float $amount, string $note) { $this->apiEndPoint = "v2/payments/captures/{$capture_id}/refund"; $this->options['json'] = [ 'amount' => [ 'value' => $amount, 'currency_code' => $this->currency, ], 'invoice_id' => $invoice_id, 'note_to_payer' => $note, ]; $this->verb = 'post'; return $this->doPayPalRequest(); }
Refund a captured payment. @param string $capture_id @param string $invoice_id @param float $amount @param string $note @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments/v2/#captures_refund
refundCapturedPayment
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentCaptures.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentCaptures.php
MIT
public function listWebExperienceProfiles() { $this->apiEndPoint = 'v1/payment-experience/web-profiles'; $this->verb = 'get'; return $this->doPayPalRequest(); }
List Web Experience Profiles. @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-experience/v1/#web-profiles_get-list
listWebExperienceProfiles
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
MIT
public function createWebExperienceProfile(array $data) { $this->apiEndPoint = 'v1/payment-experience/web-profiles'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a Web Experience Profile. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-experience/v1/#web-profile_create
createWebExperienceProfile
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
MIT
public function deleteWebExperienceProfile(string $profile_id) { $this->apiEndPoint = "v1/payment-experience/web-profiles/{$profile_id}"; $this->verb = 'delete'; return $this->doPayPalRequest(); }
Delete a Web Experience Profile. @param string $profile_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-experience/v1/#web-profile_delete
deleteWebExperienceProfile
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
MIT
public function patchWebExperienceProfile(string $profile_id, array $data) { $this->apiEndPoint = "v1/payment-experience/web-profiles/{$profile_id}"; $this->options['json'] = $data; $this->verb = 'patch'; return $this->doPayPalRequest(); }
Partially update a Web Experience Profile. @param string $profile_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-experience/v1/#web-profile_partial-update
patchWebExperienceProfile
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
MIT
public function updateWebExperienceProfile(string $profile_id, array $data) { $this->apiEndPoint = "v1/payment-experience/web-profiles/{$profile_id}"; $this->options['json'] = $data; $this->verb = 'put'; return $this->doPayPalRequest(); }
Partially update a Web Experience Profile. @param string $profile_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-experience/v1/#web-profile_update
updateWebExperienceProfile
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
MIT
public function showWebExperienceProfileDetails(string $profile_id) { $this->apiEndPoint = "v1/payment-experience/web-profiles/{$profile_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Delete a Web Experience Profile. @param string $profile_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-experience/v1/#web-profile_get
showWebExperienceProfileDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentExperienceWebProfiles.php
MIT
public function createPaymentSourceToken(array $data) { $this->apiEndPoint = 'v3/vault/payment-tokens'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a payment method token. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-tokens/v3/#payment-tokens_create
createPaymentSourceToken
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens.php
MIT
public function listPaymentSourceTokens(int $page = 1, int $page_size = 10, bool $totals = true) { $this->apiEndPoint = "v3/vault/payment-tokens?customer_id={$this->customer_source['id']}&page={$page}&page_size={$page_size}&total_required={$totals}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List all the payment tokens. @param int $page @param int $page_size @param bool $totals @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-tokens/v3/#customer_payment-tokens_get
listPaymentSourceTokens
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens.php
MIT
public function showPaymentSourceTokenDetails(string $token) { $this->apiEndPoint = "v3/vault/payment-tokens/{$token}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show details for a payment method token. @param string $token @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-tokens/v3/#payment-tokens_get
showPaymentSourceTokenDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens.php
MIT
public function deletePaymentSourceToken(string $token) { $this->apiEndPoint = "v3/vault/payment-tokens/{$token}"; $this->verb = 'delete'; return $this->doPayPalRequest(false); }
Show details for a payment token. @param string $token @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-tokens/v3/#payment-tokens_delete
deletePaymentSourceToken
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens.php
MIT
public function createPaymentSetupToken(array $data) { $this->apiEndPoint = 'v3/vault/setup-tokens'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a payment setup token. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-tokens/v3/#setup-tokens_create
createPaymentSetupToken
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens.php
MIT
public function showPaymentSetupTokenDetails(string $token) { $this->apiEndPoint = "v3/vault/setup-tokens/{$token}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show details for a payment setup token. @param string $token @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payment-tokens/v3/#setup-tokens_get
showPaymentSetupTokenDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens.php
MIT
public function showRefundDetails(string $refund_id) { $this->apiEndPoint = "v2/payments/refunds/{$refund_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show details for authorized payment. @param string $refund_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments/v2/#authorizations_get
showRefundDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentRefunds.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentRefunds.php
MIT
public function createBatchPayout(array $data) { $this->apiEndPoint = 'v1/payments/payouts'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a Batch Payout. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#payouts_post
createBatchPayout
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Payouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Payouts.php
MIT
public function showBatchPayoutDetails(string $payout_id) { $this->apiEndPoint = "v1/payments/payouts/{$payout_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show Batch Payout details by ID. @param string $payout_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#payouts_get
showBatchPayoutDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Payouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Payouts.php
MIT
public function showPayoutItemDetails(string $payout_item_id) { $this->apiEndPoint = "v1/payments/payouts-item/{$payout_item_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show Payout Item details by ID. @param string $payout_item_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#payouts-item_get
showPayoutItemDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Payouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Payouts.php
MIT
public function cancelUnclaimedPayoutItem(string $payout_item_id) { $this->apiEndPoint = "v1/payments/payouts-item/{$payout_item_id}/cancel"; $this->verb = 'post'; return $this->doPayPalRequest(); }
Show Payout Item details by ID. @param string $payout_item_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#payouts-item_cancel
cancelUnclaimedPayoutItem
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Payouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Payouts.php
MIT
public function createReferencedBatchPayout(array $data) { $this->apiEndPoint = 'v1/payments/referenced-payouts'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a referenced Batch Payout. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/referenced-payouts/v1/#referenced-payouts_create_batch
createReferencedBatchPayout
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/ReferencedPayouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/ReferencedPayouts.php
MIT
public function listItemsReferencedInBatchPayout(string $batch_payout_id) { $this->apiEndPoint = "v1/payments/referenced-payouts/{$batch_payout_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show Batch Payout details by ID. @param string $batch_payout_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/referenced-payouts/v1/#referenced-payouts_get_batch_details
listItemsReferencedInBatchPayout
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/ReferencedPayouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/ReferencedPayouts.php
MIT
public function createReferencedBatchPayoutItem(array $data) { $this->apiEndPoint = 'v1/payments/referenced-payouts-items'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a referenced Batch Payout Item. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/referenced-payouts/v1/#referenced-payouts-items_create
createReferencedBatchPayoutItem
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/ReferencedPayouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/ReferencedPayouts.php
MIT
public function showReferencedPayoutItemDetails(string $payout_item_id) { $this->apiEndPoint = "v1/payments/referenced-payouts-items/{$payout_item_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show Payout Item details by ID. @param string $payout_item_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/referenced-payouts/v1/#referenced-payouts-items_get
showReferencedPayoutItemDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/ReferencedPayouts.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/ReferencedPayouts.php
MIT
public function listTransactions(array $filters, string $fields = 'all') { $filters_list = collect($filters)->isEmpty() ? '' : collect($filters)->map(function ($value, $key) { return "{$key}={$value}&"; })->implode(''); $this->apiEndPoint = "v1/reporting/transactions?{$filters_list}fields={$fields}&page={$this->current_page}&page_size={$this->page_size}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List all transactions. @param array $filters @param string $fields @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/transaction-search/v1/#transactions_get
listTransactions
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Reporting.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Reporting.php
MIT
public function listBalances(string $date = '', string $balance_currency = '') { $date = empty($date) ? Carbon::now()->toIso8601ZuluString() : Carbon::parse($date)->toIso8601ZuluString(); $currency = empty($balance_currency) ? $this->getCurrency() : $balance_currency; $this->apiEndPoint = "v1/reporting/balances?currency_code={$currency}&as_of_time={$date}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List available balance. @param string $date @param string $balance_currency @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/transaction-search/v1/#balances_get
listBalances
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Reporting.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Reporting.php
MIT
public function createSubscription(array $data) { $this->apiEndPoint = 'v1/billing/subscriptions'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a new subscription. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_create
createSubscription
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function updateSubscription(string $subscription_id, array $data) { $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}"; $this->options['json'] = $data; $this->verb = 'patch'; return $this->doPayPalRequest(false); }
Update an existing billing plan. @param string $subscription_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_patch
updateSubscription
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function showSubscriptionDetails(string $subscription_id) { $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show details for an existing subscription. @param string $subscription_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get
showSubscriptionDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function activateSubscription(string $subscription_id, string $reason) { $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}/activate"; $this->options['json'] = ['reason' => $reason]; $this->verb = 'post'; return $this->doPayPalRequest(false); }
Activate an existing subscription. @param string $subscription_id @param string $reason @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_activate
activateSubscription
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function cancelSubscription(string $subscription_id, string $reason) { $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}/cancel"; $this->options['json'] = ['reason' => $reason]; $this->verb = 'post'; return $this->doPayPalRequest(false); }
Cancel an existing subscription. @param string $subscription_id @param string $reason @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_cancel
cancelSubscription
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function suspendSubscription(string $subscription_id, string $reason) { $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}/suspend"; $this->options['json'] = ['reason' => $reason]; $this->verb = 'post'; return $this->doPayPalRequest(false); }
Suspend an existing subscription. @param string $subscription_id @param string $reason @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_suspend
suspendSubscription
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function captureSubscriptionPayment(string $subscription_id, string $note, float $amount) { $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}/capture"; $this->options['json'] = [ 'note' => $note, 'capture_type' => 'OUTSTANDING_BALANCE', 'amount' => [ 'currency_code' => $this->currency, 'value' => "{$amount}", ], ]; $this->verb = 'post'; return $this->doPayPalRequest(false); }
Capture payment for an existing subscription. @param string $subscription_id @param string $note @param float $amount @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_capture
captureSubscriptionPayment
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function reviseSubscription(string $subscription_id, array $items) { $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}/revise"; $this->options['json'] = $items; $this->verb = 'post'; return $this->doPayPalRequest(); }
Revise quantity, product or service for an existing subscription. @param string $subscription_id @param array $items @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_revise
reviseSubscription
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function listSubscriptionTransactions(string $subscription_id, $start_date = '', $end_date = '') { if (($start_date instanceof \DateTimeInterface) === false) { $start_date = Carbon::parse($start_date); } if (($end_date instanceof \DateTimeInterface) === false) { $end_date = Carbon::parse($end_date); } $start_date = $start_date->toIso8601ZuluString(); $end_date = $end_date->toIso8601ZuluString(); $this->apiEndPoint = "v1/billing/subscriptions/{$subscription_id}/transactions?start_time={$start_date}&end_time={$end_date}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List transactions for an existing subscription. @param string $subscription_id @param \DateTimeInterface|string $start_date @param \DateTimeInterface|string $end_date @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_transactions
listSubscriptionTransactions
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions.php
MIT
public function addBatchTracking(array $data) { $this->apiEndPoint = 'v1/shipping/trackers-batch'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Adds tracking information, with or without tracking numbers, for multiple PayPal transactions. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/tracking/v1/#trackers-batch_post
addBatchTracking
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Trackers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Trackers.php
MIT
public function addTracking(array $data) { $this->apiEndPoint = 'v1/shipping/trackers'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Adds tracking information for a PayPal transaction. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/tracking/v1/#trackers_post
addTracking
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Trackers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Trackers.php
MIT
public function listTrackingDetails(string $transaction_id, string $tracking_number = null) { $this->apiEndPoint = "v1/shipping/trackers?transaction_id={$transaction_id}".!empty($tracking_number) ? "&tracking_number={$tracking_number}" : ''; $this->verb = 'get'; return $this->doPayPalRequest(); }
List tracking information based on Transaction ID or tracking number. @param string $transaction_id @param string $tracking_number @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/tracking/v1/#trackers-batch_get
listTrackingDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Trackers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Trackers.php
MIT
public function updateTrackingDetails(string $tracking_id, array $data) { $this->apiEndPoint = "v1/shipping/trackers/{$tracking_id}"; $this->options['json'] = $data; $this->verb = 'put'; return $this->doPayPalRequest(false); }
Update tracking information. @param string $tracking_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/tracking/v1/#trackers_put
updateTrackingDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Trackers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Trackers.php
MIT
public function showTrackingDetails(string $tracking_id) { $this->apiEndPoint = "v1/shipping/trackers/{$tracking_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show tracking information. @param string $tracking_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/tracking/v1/#trackers_get
showTrackingDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Trackers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Trackers.php
MIT
public function createWebHook(string $url, array $events) { $this->apiEndPoint = 'v1/notifications/webhooks'; $data = ['url' => $url]; $data['event_types'] = collect($events)->map(function ($item) { return ['name' => $item]; })->toArray(); $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Create a new web hook. @param string $url @param array $events @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_post
createWebHook
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooks.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooks.php
MIT
public function listWebHooks() { $this->apiEndPoint = 'v1/notifications/webhooks'; $this->verb = 'get'; return $this->doPayPalRequest(); }
List all web hooks. @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_list
listWebHooks
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooks.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooks.php
MIT
public function deleteWebHook(string $web_hook_id) { $this->apiEndPoint = "v1/notifications/webhooks/{$web_hook_id}"; $this->verb = 'delete'; return $this->doPayPalRequest(false); }
Delete a web hook. @param string $web_hook_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_delete
deleteWebHook
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooks.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooks.php
MIT
public function updateWebHook(string $web_hook_id, array $data) { $this->apiEndPoint = "v1/notifications/webhooks/{$web_hook_id}"; $this->options['json'] = $data; $this->verb = 'patch'; return $this->doPayPalRequest(); }
Update an existing web hook. @param string $web_hook_id @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_update
updateWebHook
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooks.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooks.php
MIT
public function showWebHookDetails(string $web_hook_id) { $this->apiEndPoint = "v1/notifications/webhooks/{$web_hook_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
Show details for an existing web hook. @param string $web_hook_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_get
showWebHookDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooks.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooks.php
MIT
public function listWebHookEvents($web_hook_id) { $this->apiEndPoint = "v1/notifications/webhooks/{$web_hook_id}/event-types"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List events for an existing web hook. @param string $web_hook_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_get
listWebHookEvents
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooks.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooks.php
MIT
public function listEventTypes() { $this->apiEndPoint = 'v1/notifications/webhooks-event-types'; $this->verb = 'get'; return $this->doPayPalRequest(); }
List all events types for web hooks. @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-event-types_list
listEventTypes
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooksEvents.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooksEvents.php
MIT
public function listEvents() { $this->apiEndPoint = 'v1/notifications/webhooks-events'; $this->verb = 'get'; return $this->doPayPalRequest(); }
List all events notifications for web hooks. @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_list
listEvents
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooksEvents.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooksEvents.php
MIT
public function showEventDetails(string $event_id) { $this->apiEndPoint = "v1/notifications/webhooks-events/{$event_id}"; $this->verb = 'get'; return $this->doPayPalRequest(); }
List all events notifications for web hooks. @param string $event_id @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_get
showEventDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooksEvents.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooksEvents.php
MIT
public function resendEventNotification(string $event_id, array $items) { $this->apiEndPoint = "v1/notifications/webhooks-events/{$event_id}/resend"; $this->options['json'] = [ 'webhook_ids' => $items, ]; $this->verb = 'post'; return $this->doPayPalRequest(); }
Resend notification for the event. @param string $event_id @param array $items @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_resend
resendEventNotification
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooksEvents.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooksEvents.php
MIT
public function verifyWebHook(array $data) { $this->apiEndPoint = 'v1/notifications/verify-webhook-signature'; $this->options['json'] = $data; $this->verb = 'post'; return $this->doPayPalRequest(); }
Verify a web hook from PayPal. @param array $data @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string @see https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature_post
verifyWebHook
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/WebHooksVerification.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/WebHooksVerification.php
MIT
public function addPricingScheme(string $interval_unit, int $interval_count, float $price, bool $trial = false): \Srmklive\PayPal\Services\PayPal { $this->pricing_schemes[] = $this->addPlanBillingCycle($interval_unit, $interval_count, $price, $trial); return $this; }
Add pricing scheme for the billing plan. @param string $interval_unit @param int $interval_count @param float $price @param bool $trial @throws Throwable @return \Srmklive\PayPal\Services\PayPal
addPricingScheme
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/BillingPlans/PricingSchemes.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/BillingPlans/PricingSchemes.php
MIT
public function processBillingPlanPricingUpdates() { return $this->updatePlanPricing($this->billing_plan['id'], $this->pricing_schemes); }
Process pricing updates for an existing billing plan. @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string
processBillingPlanPricingUpdates
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/BillingPlans/PricingSchemes.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/BillingPlans/PricingSchemes.php
MIT
public function addInvoiceFilterByRecipientEmail(string $email): \Srmklive\PayPal\Services\PayPal { $this->invoice_search_filters['recipient_email'] = $email; return $this; }
@param string $email @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByRecipientEmail
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByRecipientFirstName(string $name): \Srmklive\PayPal\Services\PayPal { $this->invoice_search_filters['recipient_first_name'] = $name; return $this; }
@param string $name @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByRecipientFirstName
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByRecipientLastName(string $name): \Srmklive\PayPal\Services\PayPal { $this->invoice_search_filters['recipient_last_name'] = $name; return $this; }
@param string $name @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByRecipientLastName
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByRecipientBusinessName(string $name): \Srmklive\PayPal\Services\PayPal { $this->invoice_search_filters['recipient_business_name'] = $name; return $this; }
@param string $name @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByRecipientBusinessName
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByInvoiceNumber(string $invoice_number): \Srmklive\PayPal\Services\PayPal { $this->invoice_search_filters['invoice_number'] = $invoice_number; return $this; }
@param string $invoice_number @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByInvoiceNumber
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByInvoiceStatus(array $status): \Srmklive\PayPal\Services\PayPal { $invalid_status = false; foreach ($status as $item) { if (!in_array($item, $this->invoices_status_types)) { $invalid_status = true; } } if ($invalid_status === true) { throw new \Exception('status should be always one of these: '.implode(',', $this->invoices_date_types)); } $this->invoice_search_filters['status'] = $status; return $this; }
@param array $status @throws \Exception @return \Srmklive\PayPal\Services\PayPal @see https://developer.paypal.com/docs/api/invoicing/v2/#definition-invoice_status
addInvoiceFilterByInvoiceStatus
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByReferenceorMemo(string $reference, bool $memo = false): \Srmklive\PayPal\Services\PayPal { $field = ($memo === false) ? 'reference' : 'memo'; $this->invoice_search_filters[$field] = $reference; return $this; }
@param string $reference @param bool $memo @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByReferenceorMemo
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByCurrencyCode(string $currency_code = ''): \Srmklive\PayPal\Services\PayPal { $currency = !isset($currency_code) ? $this->getCurrency() : $currency_code; $this->invoice_search_filters['currency_code'] = $currency; return $this; }
@param string $currency_code @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByCurrencyCode
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByAmountRange(float $start_amount, float $end_amount, string $amount_currency = ''): \Srmklive\PayPal\Services\PayPal { if ($start_amount > $end_amount) { throw new \Exception('Starting amount should always be less than end amount!'); } $currency = !isset($amount_currency) ? $this->getCurrency() : $amount_currency; $this->invoice_search_filters['total_amount_range'] = [ 'lower_amount' => [ 'currency_code' => $currency, 'value' => $start_amount, ], 'upper_amount' => [ 'currency_code' => $currency, 'value' => $end_amount, ], ]; return $this; }
@param float $start_amount @param float $end_amount @param string $amount_currency @throws \Exception @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByAmountRange
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByDateRange(string $start_date, string $end_date, string $date_type): \Srmklive\PayPal\Services\PayPal { $start_date_obj = Carbon::parse($start_date); $end_date_obj = Carbon::parse($end_date); if ($start_date_obj->gt($end_date_obj)) { throw new \Exception('Starting date should always be less than the end date!'); } if (!in_array($date_type, $this->invoices_date_types)) { throw new \Exception('date type should be always one of these: '.implode(',', $this->invoices_date_types)); } $this->invoice_search_filters["{$date_type}_range"] = [ 'start' => $start_date, 'end' => $end_date, ]; return $this; }
@param string $start_date @param string $end_date @param string $date_type @throws \Exception @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByDateRange
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByArchivedStatus(bool $archived = null): \Srmklive\PayPal\Services\PayPal { $this->invoice_search_filters['archived'] = $archived; return $this; }
@param bool $archived @return \Srmklive\PayPal\Services\PayPal
addInvoiceFilterByArchivedStatus
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function addInvoiceFilterByFields(array $fields): \Srmklive\PayPal\Services\PayPal { $this->invoice_search_filters['status'] = $fields; return $this; }
@param array $fields @return \Srmklive\PayPal\Services\PayPal @see https://developer.paypal.com/docs/api/invoicing/v2/#definition-field
addInvoiceFilterByFields
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/InvoiceSearch/Filters.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/InvoiceSearch/Filters.php
MIT
public function setupOrderConfirmation(string $order_id, string $processing_instruction = '') { $body = [ 'processing_instruction' => $processing_instruction, 'application_context' => $this->experience_context, 'payment_source' => $this->payment_source, ]; return $this->confirmOrder($order_id, $body); }
Confirm payment for an order. @param string $order_id @param string $processing_instruction @throws Throwable @return array|\Psr\Http\Message\StreamInterface|string
setupOrderConfirmation
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Orders/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Orders/Helpers.php
MIT
public function setTokenSource(string $id, string $type): \Srmklive\PayPal\Services\PayPal { $token_source = [ 'id' => $id, 'type' => $type, ]; return $this->setPaymentSourceDetails('token', $token_source); }
Set payment method token by token id. @param string $id @param string $type @return \Srmklive\PayPal\Services\PayPal
setTokenSource
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
MIT
public function setCustomerSource(string $id): \Srmklive\PayPal\Services\PayPal { $this->customer_source = [ 'id' => $id, ]; return $this; }
Set payment method token customer id. @param string $id @return \Srmklive\PayPal\Services\PayPal
setCustomerSource
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
MIT
public function setPaymentSourceCard(array $data): \Srmklive\PayPal\Services\PayPal { return $this->setPaymentSourceDetails('card', $data); }
Set payment source data for credit card. @param array $data @return \Srmklive\PayPal\Services\PayPal
setPaymentSourceCard
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
MIT
public function setPaymentSourcePayPal(array $data): \Srmklive\PayPal\Services\PayPal { return $this->setPaymentSourceDetails('paypal', $data); }
Set payment source data for PayPal. @param array $data @return \Srmklive\PayPal\Services\PayPal
setPaymentSourcePayPal
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
MIT
public function setPaymentSourceVenmo(array $data): \Srmklive\PayPal\Services\PayPal { return $this->setPaymentSourceDetails('venmo', $data); }
Set payment source data for Venmo. @param array $data @return \Srmklive\PayPal\Services\PayPal
setPaymentSourceVenmo
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
MIT
protected function setPaymentSourceDetails(string $source, array $data): \Srmklive\PayPal\Services\PayPal { $this->payment_source[$source] = $data; return $this; }
Set payment source details. @param string $source @param array $data @return \Srmklive\PayPal\Services\PayPal
setPaymentSourceDetails
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
MIT
public function sendPaymentMethodRequest(bool $create_source = false) { $token_payload = ['payment_source' => $this->payment_source]; if (!empty($this->customer_source)) { $token_payload['customer'] = $this->customer_source; } return ($create_source === true) ? $this->createPaymentSetupToken(array_filter($token_payload)) : $this->createPaymentSourceToken(array_filter($token_payload)); }
Send request for creating payment method token/source. @param bool $create_source @throws \Throwable @return array|\Psr\Http\Message\StreamInterface|string
sendPaymentMethodRequest
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/PaymentMethodsTokens/Helpers.php
MIT
public function setupSubscription(string $customer_name, string $customer_email, string $start_date = '') { $body = [ 'plan_id' => $this->billing_plan['id'], 'quantity' => 1, 'subscriber' => [ 'name' => [ 'given_name' => $customer_name, ], 'email_address' => $customer_email, ], ]; if (!empty($start_date)) { $body['start_time'] = Carbon::parse($start_date)->toIso8601String(); } if ($this->has_setup_fee) { $body['plan'] = [ 'payment_preferences' => $this->payment_preferences, ]; } if (isset($this->shipping_address)) { $body['subscriber']['shipping_address'] = $this->shipping_address; } if (isset($this->experience_context)) { $body['application_context'] = $this->experience_context; } if (isset($this->taxes)) { $body['taxes'] = $this->taxes; } if (isset($this->custom_id)) { $body['custom_id'] = $this->custom_id; } $subscription = $this->createSubscription($body); $subscription['billing_plan_id'] = $this->billing_plan['id']; $subscription['product_id'] = $this->product['id']; unset($this->product); unset($this->billing_plan); unset($this->trial_pricing); unset($this->return_url); unset($this->cancel_url); return $subscription; }
Setup a subscription. @param string $customer_name @param string $customer_email @param string $start_date @throws Throwable @return array|\Psr\Http\Message\StreamInterface|string
setupSubscription
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addPlanTrialPricing(string $interval_type, int $interval_count, float $price = 0, int $total_cycles = 1): \Srmklive\PayPal\Services\PayPal { $this->trial_pricing = $this->addPlanBillingCycle($interval_type, $interval_count, $price, $total_cycles, true); return $this; }
Add a subscription trial pricing tier. @param string $interval_type @param int $interval_count @param float|int $price @param int $total_cycles @return \Srmklive\PayPal\Services\PayPal
addPlanTrialPricing
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addDailyPlan(string $name, string $description, float $price, int $total_cycles = 0): \Srmklive\PayPal\Services\PayPal { if (isset($this->billing_plan)) { return $this; } $plan_pricing = $this->addPlanBillingCycle('DAY', 1, $price, $total_cycles); $billing_cycles = empty($this->trial_pricing) ? [$plan_pricing] : collect([$this->trial_pricing, $plan_pricing])->filter()->toArray(); $this->addBillingPlan($name, $description, $billing_cycles); return $this; }
Create a recurring daily billing plan. @param string $name @param string $description @param float|int $price @param int $total_cycles @throws Throwable @return \Srmklive\PayPal\Services\PayPal
addDailyPlan
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addWeeklyPlan(string $name, string $description, float $price, int $total_cycles = 0): \Srmklive\PayPal\Services\PayPal { if (isset($this->billing_plan)) { return $this; } $plan_pricing = $this->addPlanBillingCycle('WEEK', 1, $price, $total_cycles); $billing_cycles = empty($this->trial_pricing) ? [$plan_pricing] : collect([$this->trial_pricing, $plan_pricing])->filter()->toArray(); $this->addBillingPlan($name, $description, $billing_cycles); return $this; }
Create a recurring weekly billing plan. @param string $name @param string $description @param float|int $price @param int $total_cycles @throws Throwable @return \Srmklive\PayPal\Services\PayPal
addWeeklyPlan
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addMonthlyPlan(string $name, string $description, float $price, int $total_cycles = 0): \Srmklive\PayPal\Services\PayPal { if (isset($this->billing_plan)) { return $this; } $plan_pricing = $this->addPlanBillingCycle('MONTH', 1, $price, $total_cycles); $billing_cycles = empty($this->trial_pricing) ? [$plan_pricing] : collect([$this->trial_pricing, $plan_pricing])->filter()->toArray(); $this->addBillingPlan($name, $description, $billing_cycles); return $this; }
Create a recurring monthly billing plan. @param string $name @param string $description @param float|int $price @param int $total_cycles @throws Throwable @return \Srmklive\PayPal\Services\PayPal
addMonthlyPlan
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addAnnualPlan(string $name, string $description, float $price, int $total_cycles = 0): \Srmklive\PayPal\Services\PayPal { if (isset($this->billing_plan)) { return $this; } $plan_pricing = $this->addPlanBillingCycle('YEAR', 1, $price, $total_cycles); $billing_cycles = empty($this->trial_pricing) ? [$plan_pricing] : collect([$this->trial_pricing, $plan_pricing])->filter()->toArray(); $this->addBillingPlan($name, $description, $billing_cycles); return $this; }
Create a recurring annual billing plan. @param string $name @param string $description @param float|int $price @param int $total_cycles @throws Throwable @return \Srmklive\PayPal\Services\PayPal
addAnnualPlan
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addCustomPlan(string $name, string $description, float $price, string $interval_unit, int $interval_count, int $total_cycles = 0): \Srmklive\PayPal\Services\PayPal { $billing_intervals = ['DAY', 'WEEK', 'MONTH', 'YEAR']; if (isset($this->billing_plan)) { return $this; } if (!in_array($interval_unit, $billing_intervals)) { throw new \RuntimeException('Billing intervals should either be '.implode(', ', $billing_intervals)); } $plan_pricing = $this->addPlanBillingCycle($interval_unit, $interval_count, $price, $total_cycles); $billing_cycles = empty($this->trial_pricing) ? [$plan_pricing] : collect([$this->trial_pricing, $plan_pricing])->filter()->toArray(); $this->addBillingPlan($name, $description, $billing_cycles); return $this; }
Create a recurring billing plan with custom intervals. @param string $name @param string $description @param float|int $price @param string $interval_unit @param int $interval_count @param int $total_cycles @throws Throwable @return \Srmklive\PayPal\Services\PayPal
addCustomPlan
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
protected function addPlanBillingCycle(string $interval_unit, int $interval_count, float $price, int $total_cycles, bool $trial = false): array { $pricing_scheme = [ 'fixed_price' => [ 'value' => bcdiv($price, 1, 2), 'currency_code' => $this->getCurrency(), ], ]; if (empty($this->trial_pricing)) { $plan_sequence = 1; } else { $plan_sequence = 2; } return [ 'frequency' => [ 'interval_unit' => $interval_unit, 'interval_count' => $interval_count, ], 'tenure_type' => ($trial === true) ? 'TRIAL' : 'REGULAR', 'sequence' => ($trial === true) ? 1 : $plan_sequence, 'total_cycles' => $total_cycles, 'pricing_scheme' => $pricing_scheme, ]; }
Add Plan's Billing cycle. @param string $interval_unit @param int $interval_count @param float $price @param int $total_cycles @param bool $trial @return array
addPlanBillingCycle
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addProduct(string $name, string $description, string $type, string $category): \Srmklive\PayPal\Services\PayPal { if (isset($this->product)) { return $this; } $request_id = Str::random(); $product = $this->createProduct([ 'name' => $name, 'description' => $description, 'type' => $type, 'category' => $category, ], $request_id); if ($error = data_get($product, 'error', false)) { throw new \RuntimeException(data_get($error, 'details.0.description', 'Failed to add product')); } $this->product = $product; return $this; }
Create a product for a subscription's billing plan. @param string $name @param string $description @param string $type @param string $category @throws Throwable @return \Srmklive\PayPal\Services\PayPal
addProduct
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addProductById(string $product_id): \Srmklive\PayPal\Services\PayPal { $this->product = [ 'id' => $product_id, ]; return $this; }
Add subscription's billing plan's product by ID. @param string $product_id @return \Srmklive\PayPal\Services\PayPal
addProductById
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addBillingPlanById(string $plan_id): \Srmklive\PayPal\Services\PayPal { $this->billing_plan = [ 'id' => $plan_id, ]; return $this; }
Add subscription's billing plan by ID. @param string $plan_id @return \Srmklive\PayPal\Services\PayPal
addBillingPlanById
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
protected function addBillingPlan(string $name, string $description, array $billing_cycles): void { $request_id = Str::random(); $plan_params = [ 'product_id' => $this->product['id'], 'name' => $name, 'description' => $description, 'status' => 'ACTIVE', 'billing_cycles' => $billing_cycles, 'payment_preferences' => [ 'auto_bill_outstanding' => true, 'setup_fee_failure_action' => 'CONTINUE', 'payment_failure_threshold' => $this->payment_failure_threshold, ], ]; $billingPlan = $this->createPlan($plan_params, $request_id); if ($error = data_get($billingPlan, 'error', false)) { throw new \RuntimeException(data_get($error, 'details.0.description', 'Failed to add billing plan')); } $this->billing_plan = $billingPlan; }
Create a product for a subscription's billing plan. @param string $name @param string $description @param array $billing_cycles @throws Throwable @return void
addBillingPlan
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addPaymentFailureThreshold(int $threshold): \Srmklive\PayPal\Services\PayPal { $this->payment_failure_threshold = $threshold; return $this; }
Set custom failure threshold when adding a subscription. @param int $threshold @return \Srmklive\PayPal\Services\PayPal
addPaymentFailureThreshold
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT
public function addSetupFee(float $price): \Srmklive\PayPal\Services\PayPal { $this->has_setup_fee = true; $this->payment_preferences = [ 'auto_bill_outstanding' => true, 'setup_fee' => [ 'value' => bcdiv($price, 1, 2), 'currency_code' => $this->getCurrency(), ], 'setup_fee_failure_action' => 'CONTINUE', 'payment_failure_threshold' => $this->payment_failure_threshold, ]; return $this; }
Add setup fee when adding a subscription. @param float $price @return \Srmklive\PayPal\Services\PayPal
addSetupFee
php
srmklive/laravel-paypal
src/Traits/PayPalAPI/Subscriptions/Helpers.php
https://github.com/srmklive/laravel-paypal/blob/master/src/Traits/PayPalAPI/Subscriptions/Helpers.php
MIT